diff --git a/java-document-ai/google-cloud-document-ai/pom.xml b/java-document-ai/google-cloud-document-ai/pom.xml index 802104ca096..56a6fa37cd5 100644 --- a/java-document-ai/google-cloud-document-ai/pom.xml +++ b/java-document-ai/google-cloud-document-ai/pom.xml @@ -125,6 +125,12 @@ testlib test + + com.google.api.grpc + grpc-google-common-protos + 2.9.0 + test + diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java index d0747349bcb..040bca01808 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java @@ -16,16 +16,30 @@ package com.google.cloud.documentai.v1; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1.stub.DocumentProcessorServiceStub; import com.google.cloud.documentai.v1.stub.DocumentProcessorServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; +import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -44,7 +58,7 @@ * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } @@ -205,15 +219,21 @@ public final OperationsClient getHttpJsonOperationsClient() { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use its + * [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProcessResponse processDocument(ProcessorName name) { + public final ProcessResponse processDocument(ResourceName name) { ProcessRequest request = ProcessRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return processDocument(request); @@ -230,12 +250,18 @@ public final ProcessResponse processDocument(ProcessorName name) { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use its + * [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ProcessResponse processDocument(String name) { @@ -258,6 +284,7 @@ public final ProcessResponse processDocument(String name) { * ProcessRequest.newBuilder() * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setSkipHumanReview(true) + * .setFieldMask(FieldMask.newBuilder().build()) * .build(); * ProcessResponse response = documentProcessorServiceClient.processDocument(request); * } @@ -285,6 +312,7 @@ public final ProcessResponse processDocument(ProcessRequest request) { * ProcessRequest.newBuilder() * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setSkipHumanReview(true) + * .setFieldMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = * documentProcessorServiceClient.processDocumentCallable().futureCall(request); @@ -309,17 +337,20 @@ public final UnaryCallable processDocumentCalla * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * BatchProcessResponse response = * documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture - batchProcessDocumentsAsync(ProcessorName name) { + batchProcessDocumentsAsync(ResourceName name) { BatchProcessRequest request = BatchProcessRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return batchProcessDocumentsAsync(request); @@ -337,13 +368,16 @@ public final UnaryCallable processDocumentCalla * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); * BatchProcessResponse response = * documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture @@ -449,8 +483,8 @@ public final UnaryCallable batchProcessDocuments // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Send a document for Human Review. The input document should be processed by the specified - * processor. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -459,30 +493,29 @@ public final UnaryCallable batchProcessDocuments * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * HumanReviewConfigName humanReviewConfig = - * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - * ReviewDocumentResponse response = - * documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get(); + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * FetchProcessorTypesResponse response = + * documentProcessorServiceClient.fetchProcessorTypes(parent); * } * } * - * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document - * will be reviewed with. + * @param parent Required. The project of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture - reviewDocumentAsync(HumanReviewConfigName humanReviewConfig) { - ReviewDocumentRequest request = - ReviewDocumentRequest.newBuilder() - .setHumanReviewConfig(humanReviewConfig == null ? null : humanReviewConfig.toString()) + public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .build(); - return reviewDocumentAsync(request); + return fetchProcessorTypes(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Send a document for Human Review. The input document should be processed by the specified - * processor. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -491,28 +524,27 @@ public final UnaryCallable batchProcessDocuments * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String humanReviewConfig = - * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); - * ReviewDocumentResponse response = - * documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * FetchProcessorTypesResponse response = + * documentProcessorServiceClient.fetchProcessorTypes(parent); * } * } * - * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document - * will be reviewed with. + * @param parent Required. The project of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture - reviewDocumentAsync(String humanReviewConfig) { - ReviewDocumentRequest request = - ReviewDocumentRequest.newBuilder().setHumanReviewConfig(humanReviewConfig).build(); - return reviewDocumentAsync(request); + public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder().setParent(parent).build(); + return fetchProcessorTypes(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Send a document for Human Review. The input document should be processed by the specified - * processor. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -521,29 +553,26 @@ public final UnaryCallable batchProcessDocuments * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ReviewDocumentRequest request = - * ReviewDocumentRequest.newBuilder() - * .setHumanReviewConfig( - * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) - * .setEnableSchemaValidation(true) + * FetchProcessorTypesRequest request = + * FetchProcessorTypesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .build(); - * ReviewDocumentResponse response = - * documentProcessorServiceClient.reviewDocumentAsync(request).get(); + * FetchProcessorTypesResponse response = + * documentProcessorServiceClient.fetchProcessorTypes(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 OperationFuture - reviewDocumentAsync(ReviewDocumentRequest request) { - return reviewDocumentOperationCallable().futureCall(request); + public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypesRequest request) { + return fetchProcessorTypesCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Send a document for Human Review. The input document should be processed by the specified - * processor. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -552,29 +581,25 @@ public final UnaryCallable batchProcessDocuments * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ReviewDocumentRequest request = - * ReviewDocumentRequest.newBuilder() - * .setHumanReviewConfig( - * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) - * .setEnableSchemaValidation(true) + * FetchProcessorTypesRequest request = + * FetchProcessorTypesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .build(); - * OperationFuture future = - * documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request); + * ApiFuture future = + * documentProcessorServiceClient.fetchProcessorTypesCallable().futureCall(request); * // Do something. - * ReviewDocumentResponse response = future.get(); + * FetchProcessorTypesResponse response = future.get(); * } * } */ - public final OperationCallable< - ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> - reviewDocumentOperationCallable() { - return stub.reviewDocumentOperationCallable(); + public final UnaryCallable + fetchProcessorTypesCallable() { + return stub.fetchProcessorTypesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Send a document for Human Review. The input document should be processed by the specified - * processor. + * Lists the processor types that exist. * *

Sample code: * @@ -583,50 +608,2325 @@ public final UnaryCallable batchProcessDocuments * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ReviewDocumentRequest request = - * ReviewDocumentRequest.newBuilder() - * .setHumanReviewConfig( - * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) - * .setEnableSchemaValidation(true) + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (ProcessorType element : + * documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + * + * @param parent Required. The location of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorTypesPagedResponse listProcessorTypes(LocationName parent) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProcessorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processor types that exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ProcessorType element :
+   *       documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The location of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorTypesPagedResponse listProcessorTypes(String parent) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder().setParent(parent).build(); + return listProcessorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processor types that exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorTypesRequest request =
+   *       ListProcessorTypesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
    *           .build();
-   *   ApiFuture future =
-   *       documentProcessorServiceClient.reviewDocumentCallable().futureCall(request);
+   *   for (ProcessorType element :
+   *       documentProcessorServiceClient.listProcessorTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListProcessorTypesPagedResponse listProcessorTypes( + ListProcessorTypesRequest request) { + return listProcessorTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processor types that exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorTypesRequest request =
+   *       ListProcessorTypesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listProcessorTypesPagedCallable().futureCall(request);
    *   // Do something.
-   *   Operation response = future.get();
+   *   for (ProcessorType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
*/ - public final UnaryCallable reviewDocumentCallable() { - return stub.reviewDocumentCallable(); + public final UnaryCallable + listProcessorTypesPagedCallable() { + return stub.listProcessorTypesPagedCallable(); } - @Override - public final void close() { - stub.close(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processor types that exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorTypesRequest request =
+   *       ListProcessorTypesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorTypesResponse response =
+   *         documentProcessorServiceClient.listProcessorTypesCallable().call(request);
+   *     for (ProcessorType element : response.getProcessorTypesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorTypesCallable() { + return stub.listProcessorTypesCallable(); } - @Override - public void shutdown() { - stub.shutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorsPagedResponse listProcessors(LocationName parent) { + ListProcessorsRequest request = + ListProcessorsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProcessors(request); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorsPagedResponse listProcessors(String parent) { + ListProcessorsRequest request = ListProcessorsRequest.newBuilder().setParent(parent).build(); + return listProcessors(request); } - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Processor element :
+   *       documentProcessorServiceClient.listProcessors(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListProcessorsPagedResponse listProcessors(ListProcessorsRequest request) { + return listProcessorsPagedCallable().call(request); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listProcessorsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Processor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorsPagedCallable() { + return stub.listProcessorsPagedCallable(); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorsResponse response =
+   *         documentProcessorServiceClient.listProcessorsCallable().call(request);
+   *     for (Processor element : response.getProcessorsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorsCallable() { + return stub.listProcessorsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   Processor response = documentProcessorServiceClient.getProcessor(name);
+   * }
+   * }
+ * + * @param name Required. The processor resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor getProcessor(ProcessorName name) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   Processor response = documentProcessorServiceClient.getProcessor(name);
+   * }
+   * }
+ * + * @param name Required. The processor resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor getProcessor(String name) { + GetProcessorRequest request = GetProcessorRequest.newBuilder().setName(name).build(); + return getProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetProcessorRequest request =
+   *       GetProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   Processor response = documentProcessorServiceClient.getProcessor(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 Processor getProcessor(GetProcessorRequest request) { + return getProcessorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetProcessorRequest request =
+   *       GetProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.getProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Processor response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getProcessorCallable() { + return stub.getProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor version detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name);
+   * }
+   * }
+ * + * @param name Required. The processor resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProcessorVersion getProcessorVersion(ProcessorVersionName name) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getProcessorVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor version detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name);
+   * }
+   * }
+ * + * @param name Required. The processor resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ProcessorVersion getProcessorVersion(String name) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder().setName(name).build(); + return getProcessorVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor version detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetProcessorVersionRequest request =
+   *       GetProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(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 ProcessorVersion getProcessorVersion(GetProcessorVersionRequest request) { + return getProcessorVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor version detail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetProcessorVersionRequest request =
+   *       GetProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.getProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   ProcessorVersion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getProcessorVersionCallable() { + return stub.getProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   for (ProcessorVersion element :
+   *       documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project, location and processor) to list all versions. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorVersionsPagedResponse listProcessorVersions(ProcessorName parent) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProcessorVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   for (ProcessorVersion element :
+   *       documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project, location and processor) to list all versions. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorVersionsPagedResponse listProcessorVersions(String parent) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder().setParent(parent).build(); + return listProcessorVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ProcessorVersion element :
+   *       documentProcessorServiceClient.listProcessorVersions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListProcessorVersionsPagedResponse listProcessorVersions( + ListProcessorVersionsRequest request) { + return listProcessorVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listProcessorVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ProcessorVersion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorVersionsPagedCallable() { + return stub.listProcessorVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorVersionsResponse response =
+   *         documentProcessorServiceClient.listProcessorVersionsCallable().call(request);
+   *     for (ProcessorVersion element : response.getProcessorVersionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorVersionsCallable() { + return stub.listProcessorVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorVersionAsync( + ProcessorVersionName name) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorVersionAsync( + String name) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder().setName(name).build(); + return deleteProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(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 deleteProcessorVersionAsync( + DeleteProcessorVersionRequest request) { + return deleteProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .deleteProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable() { + return stub.deleteProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deleteProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteProcessorVersionCallable() { + return stub.deleteProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + deployProcessorVersionAsync(ProcessorVersionName name) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + deployProcessorVersionAsync(String name) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder().setName(name).build(); + return deployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(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 + deployProcessorVersionAsync(DeployProcessorVersionRequest request) { + return deployProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .deployProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   DeployProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return stub.deployProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deployProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deployProcessorVersionCallable() { + return stub.deployProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be undeployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + undeployProcessorVersionAsync(ProcessorVersionName name) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return undeployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be undeployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + undeployProcessorVersionAsync(String name) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder().setName(name).build(); + return undeployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(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 + undeployProcessorVersionAsync(UndeployProcessorVersionRequest request) { + return undeployProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .undeployProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   UndeployProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return stub.undeployProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.undeployProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + undeployProcessorVersionCallable() { + return stub.undeployProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Processor processor = Processor.newBuilder().build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) under which to create the processor. + * Format: `projects/{project}/locations/{location}` + * @param processor Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor createProcessor(LocationName parent, Processor processor) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProcessor(processor) + .build(); + return createProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Processor processor = Processor.newBuilder().build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) under which to create the processor. + * Format: `projects/{project}/locations/{location}` + * @param processor Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor createProcessor(String parent, Processor processor) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder().setParent(parent).setProcessor(processor).build(); + return createProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setProcessor(Processor.newBuilder().build())
+   *           .build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(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 Processor createProcessor(CreateProcessorRequest request) { + return createProcessorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setProcessor(Processor.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.createProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Processor response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createProcessorCallable() { + return stub.createProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   documentProcessorServiceClient.deleteProcessorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorAsync( + ProcessorName name) { + DeleteProcessorRequest request = + DeleteProcessorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteProcessorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   documentProcessorServiceClient.deleteProcessorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorAsync(String name) { + DeleteProcessorRequest request = DeleteProcessorRequest.newBuilder().setName(name).build(); + return deleteProcessorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   documentProcessorServiceClient.deleteProcessorAsync(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 deleteProcessorAsync( + DeleteProcessorRequest request) { + return deleteProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.deleteProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteProcessorOperationCallable() { + return stub.deleteProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deleteProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteProcessorCallable() { + return stub.deleteProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   EnableProcessorResponse response =
+   *       documentProcessorServiceClient.enableProcessorAsync(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 + enableProcessorAsync(EnableProcessorRequest request) { + return enableProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.enableProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   EnableProcessorResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable() { + return stub.enableProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.enableProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable enableProcessorCallable() { + return stub.enableProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
+   *       DisableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   DisableProcessorResponse response =
+   *       documentProcessorServiceClient.disableProcessorAsync(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 + disableProcessorAsync(DisableProcessorRequest request) { + return disableProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
+   *       DisableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.disableProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   DisableProcessorResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return stub.disableProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
+   *       DisableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.disableProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable disableProcessorCallable() { + return stub.disableProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that + * will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   SetDefaultProcessorVersionRequest request =
+   *       SetDefaultProcessorVersionRequest.newBuilder()
+   *           .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDefaultProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   SetDefaultProcessorVersionResponse response =
+   *       documentProcessorServiceClient.setDefaultProcessorVersionAsync(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< + SetDefaultProcessorVersionResponse, SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionAsync(SetDefaultProcessorVersionRequest request) { + return setDefaultProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that + * will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   SetDefaultProcessorVersionRequest request =
+   *       SetDefaultProcessorVersionRequest.newBuilder()
+   *           .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDefaultProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture
+   *       future =
+   *           documentProcessorServiceClient
+   *               .setDefaultProcessorVersionOperationCallable()
+   *               .futureCall(request);
+   *   // Do something.
+   *   SetDefaultProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return stub.setDefaultProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that + * will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   SetDefaultProcessorVersionRequest request =
+   *       SetDefaultProcessorVersionRequest.newBuilder()
+   *           .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDefaultProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.setDefaultProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + setDefaultProcessorVersionCallable() { + return stub.setDefaultProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Send a document for Human Review. The input document should be processed by the specified + * processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * 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 + */ + public final OperationFuture + reviewDocumentAsync(HumanReviewConfigName humanReviewConfig) { + ReviewDocumentRequest request = + ReviewDocumentRequest.newBuilder() + .setHumanReviewConfig(humanReviewConfig == null ? null : humanReviewConfig.toString()) + .build(); + return reviewDocumentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Send a document for Human Review. The input document should be processed by the specified + * processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * 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 + */ + public final OperationFuture + reviewDocumentAsync(String humanReviewConfig) { + ReviewDocumentRequest request = + ReviewDocumentRequest.newBuilder().setHumanReviewConfig(humanReviewConfig).build(); + return reviewDocumentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Send a document for Human Review. The input document should be processed by the specified + * processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setEnableSchemaValidation(true)
+   *           .setDocumentSchema(DocumentSchema.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 + */ + public final OperationFuture + reviewDocumentAsync(ReviewDocumentRequest request) { + return reviewDocumentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Send a document for Human Review. The input document should be processed by the specified + * processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setEnableSchemaValidation(true)
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ReviewDocumentResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable() { + return stub.reviewDocumentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Send a document for Human Review. The input document should be processed by the specified + * processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setEnableSchemaValidation(true)
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.reviewDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reviewDocumentCallable() { + return stub.reviewDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : documentProcessorServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         documentProcessorServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = documentProcessorServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListProcessorTypesPagedResponse + extends AbstractPagedListResponse< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage, + ListProcessorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProcessorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProcessorTypesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProcessorTypesPagedResponse(ListProcessorTypesPage page) { + super(page, ListProcessorTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProcessorTypesPage + extends AbstractPage< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage> { + + private ListProcessorTypesPage( + PageContext context, + ListProcessorTypesResponse response) { + super(context, response); + } + + private static ListProcessorTypesPage createEmptyPage() { + return new ListProcessorTypesPage(null, null); + } + + @Override + protected ListProcessorTypesPage createPage( + PageContext context, + ListProcessorTypesResponse response) { + return new ListProcessorTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProcessorTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage, + ListProcessorTypesFixedSizeCollection> { + + private ListProcessorTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProcessorTypesFixedSizeCollection createEmptyCollection() { + return new ListProcessorTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListProcessorTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProcessorTypesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListProcessorsPagedResponse + extends AbstractPagedListResponse< + ListProcessorsRequest, + ListProcessorsResponse, + Processor, + ListProcessorsPage, + ListProcessorsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProcessorsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProcessorsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProcessorsPagedResponse(ListProcessorsPage page) { + super(page, ListProcessorsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProcessorsPage + extends AbstractPage< + ListProcessorsRequest, ListProcessorsResponse, Processor, ListProcessorsPage> { + + private ListProcessorsPage( + PageContext context, + ListProcessorsResponse response) { + super(context, response); + } + + private static ListProcessorsPage createEmptyPage() { + return new ListProcessorsPage(null, null); + } + + @Override + protected ListProcessorsPage createPage( + PageContext context, + ListProcessorsResponse response) { + return new ListProcessorsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProcessorsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProcessorsRequest, + ListProcessorsResponse, + Processor, + ListProcessorsPage, + ListProcessorsFixedSizeCollection> { + + private ListProcessorsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProcessorsFixedSizeCollection createEmptyCollection() { + return new ListProcessorsFixedSizeCollection(null, 0); + } + + @Override + protected ListProcessorsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProcessorsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListProcessorVersionsPagedResponse + extends AbstractPagedListResponse< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage, + ListProcessorVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProcessorVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProcessorVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProcessorVersionsPagedResponse(ListProcessorVersionsPage page) { + super(page, ListProcessorVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProcessorVersionsPage + extends AbstractPage< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage> { + + private ListProcessorVersionsPage( + PageContext + context, + ListProcessorVersionsResponse response) { + super(context, response); + } + + private static ListProcessorVersionsPage createEmptyPage() { + return new ListProcessorVersionsPage(null, null); + } + + @Override + protected ListProcessorVersionsPage createPage( + PageContext + context, + ListProcessorVersionsResponse response) { + return new ListProcessorVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProcessorVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage, + ListProcessorVersionsFixedSizeCollection> { + + private ListProcessorVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProcessorVersionsFixedSizeCollection createEmptyCollection() { + return new ListProcessorVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListProcessorVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProcessorVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } } } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java index 6207218d6c0..26bdd5e1aff 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java @@ -16,6 +16,11 @@ package com.google.cloud.documentai.v1; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -26,10 +31,16 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.documentai.v1.stub.DocumentProcessorServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -91,6 +102,155 @@ public UnaryCallSettings batchProcessDocumentsSe .batchProcessDocumentsOperationSettings(); } + /** Returns the object with the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings + fetchProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).fetchProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorsSettings(); + } + + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .listProcessorVersionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to createProcessor. */ + public UnaryCallSettings createProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).createProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public UnaryCallSettings deleteProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).deleteProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public OperationCallSettings + deleteProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public UnaryCallSettings enableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).enableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public OperationCallSettings< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .enableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public UnaryCallSettings disableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).disableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public OperationCallSettings< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .disableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionOperationSettings(); + } + /** Returns the object with the settings used for calls to reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return ((DocumentProcessorServiceStubSettings) getStubSettings()).reviewDocumentSettings(); @@ -104,6 +264,17 @@ public UnaryCallSettings reviewDocumentSetting .reviewDocumentOperationSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getLocationSettings(); + } + public static final DocumentProcessorServiceSettings create( DocumentProcessorServiceStubSettings stub) throws IOException { return new DocumentProcessorServiceSettings.Builder(stub.toBuilder()).build(); @@ -238,6 +409,145 @@ public UnaryCallSettings.Builder processDocumen return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); } + /** Returns the builder for the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings.Builder + fetchProcessorTypesSettings() { + return getStubSettingsBuilder().fetchProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return getStubSettingsBuilder().listProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return getStubSettingsBuilder().listProcessorsSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getStubSettingsBuilder().getProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getStubSettingsBuilder().getProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return getStubSettingsBuilder().listProcessorVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return getStubSettingsBuilder().deleteProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deleteProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return getStubSettingsBuilder().deployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return getStubSettingsBuilder().undeployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().undeployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createProcessor. */ + public UnaryCallSettings.Builder createProcessorSettings() { + return getStubSettingsBuilder().createProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public UnaryCallSettings.Builder deleteProcessorSettings() { + return getStubSettingsBuilder().deleteProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public OperationCallSettings.Builder + deleteProcessorOperationSettings() { + return getStubSettingsBuilder().deleteProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public UnaryCallSettings.Builder enableProcessorSettings() { + return getStubSettingsBuilder().enableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public OperationCallSettings.Builder< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return getStubSettingsBuilder().enableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public UnaryCallSettings.Builder + disableProcessorSettings() { + return getStubSettingsBuilder().disableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public OperationCallSettings.Builder< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return getStubSettingsBuilder().disableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionOperationSettings(); + } + /** Returns the builder for the settings used for calls to reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return getStubSettingsBuilder().reviewDocumentSettings(); @@ -250,6 +560,18 @@ public UnaryCallSettings.Builder reviewDocumen return getStubSettingsBuilder().reviewDocumentOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public DocumentProcessorServiceSettings build() throws IOException { return new DocumentProcessorServiceSettings(this); diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json index 7076d6edb48..2376feb9d39 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json @@ -13,11 +13,59 @@ "BatchProcessDocuments": { "methods": ["batchProcessDocumentsAsync", "batchProcessDocumentsAsync", "batchProcessDocumentsAsync", "batchProcessDocumentsOperationCallable", "batchProcessDocumentsCallable"] }, + "CreateProcessor": { + "methods": ["createProcessor", "createProcessor", "createProcessor", "createProcessorCallable"] + }, + "DeleteProcessor": { + "methods": ["deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorOperationCallable", "deleteProcessorCallable"] + }, + "DeleteProcessorVersion": { + "methods": ["deleteProcessorVersionAsync", "deleteProcessorVersionAsync", "deleteProcessorVersionAsync", "deleteProcessorVersionOperationCallable", "deleteProcessorVersionCallable"] + }, + "DeployProcessorVersion": { + "methods": ["deployProcessorVersionAsync", "deployProcessorVersionAsync", "deployProcessorVersionAsync", "deployProcessorVersionOperationCallable", "deployProcessorVersionCallable"] + }, + "DisableProcessor": { + "methods": ["disableProcessorAsync", "disableProcessorOperationCallable", "disableProcessorCallable"] + }, + "EnableProcessor": { + "methods": ["enableProcessorAsync", "enableProcessorOperationCallable", "enableProcessorCallable"] + }, + "FetchProcessorTypes": { + "methods": ["fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypesCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetProcessor": { + "methods": ["getProcessor", "getProcessor", "getProcessor", "getProcessorCallable"] + }, + "GetProcessorVersion": { + "methods": ["getProcessorVersion", "getProcessorVersion", "getProcessorVersion", "getProcessorVersionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListProcessorTypes": { + "methods": ["listProcessorTypes", "listProcessorTypes", "listProcessorTypes", "listProcessorTypesPagedCallable", "listProcessorTypesCallable"] + }, + "ListProcessorVersions": { + "methods": ["listProcessorVersions", "listProcessorVersions", "listProcessorVersions", "listProcessorVersionsPagedCallable", "listProcessorVersionsCallable"] + }, + "ListProcessors": { + "methods": ["listProcessors", "listProcessors", "listProcessors", "listProcessorsPagedCallable", "listProcessorsCallable"] + }, "ProcessDocument": { "methods": ["processDocument", "processDocument", "processDocument", "processDocumentCallable"] }, "ReviewDocument": { "methods": ["reviewDocumentAsync", "reviewDocumentAsync", "reviewDocumentAsync", "reviewDocumentOperationCallable", "reviewDocumentCallable"] + }, + "SetDefaultProcessorVersion": { + "methods": ["setDefaultProcessorVersionAsync", "setDefaultProcessorVersionOperationCallable", "setDefaultProcessorVersionCallable"] + }, + "UndeployProcessorVersion": { + "methods": ["undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionOperationCallable", "undeployProcessorVersionCallable"] } } } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java index 9b3d0ae3c0c..42bc2d8a0ab 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Document AI API + * + *

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

======================= DocumentProcessorServiceClient ======================= * @@ -31,7 +33,7 @@ * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java index 370b89a2e85..9d5163b63fc 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java @@ -16,19 +16,61 @@ package com.google.cloud.documentai.v1.stub; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + 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.documentai.v1.BatchProcessMetadata; import com.google.cloud.documentai.v1.BatchProcessRequest; import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorVersion; import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -62,6 +104,133 @@ public UnaryCallable batchProcessDocumentsCallab throw new UnsupportedOperationException("Not implemented: batchProcessDocumentsCallable()"); } + public UnaryCallable + fetchProcessorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: fetchProcessorTypesCallable()"); + } + + public UnaryCallable + listProcessorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorTypesPagedCallable()"); + } + + public UnaryCallable + listProcessorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorTypesCallable()"); + } + + public UnaryCallable + listProcessorsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorsPagedCallable()"); + } + + public UnaryCallable listProcessorsCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorsCallable()"); + } + + public UnaryCallable getProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: getProcessorCallable()"); + } + + public UnaryCallable getProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getProcessorVersionCallable()"); + } + + public UnaryCallable + listProcessorVersionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listProcessorVersionsPagedCallable()"); + } + + public UnaryCallable + listProcessorVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorVersionsCallable()"); + } + + public OperationCallable + deleteProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteProcessorVersionOperationCallable()"); + } + + public UnaryCallable deleteProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProcessorVersionCallable()"); + } + + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deployProcessorVersionOperationCallable()"); + } + + public UnaryCallable deployProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deployProcessorVersionCallable()"); + } + + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: undeployProcessorVersionOperationCallable()"); + } + + public UnaryCallable + undeployProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: undeployProcessorVersionCallable()"); + } + + public UnaryCallable createProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: createProcessorCallable()"); + } + + public OperationCallable + deleteProcessorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProcessorOperationCallable()"); + } + + public UnaryCallable deleteProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProcessorCallable()"); + } + + public OperationCallable + enableProcessorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: enableProcessorOperationCallable()"); + } + + public UnaryCallable enableProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: enableProcessorCallable()"); + } + + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: disableProcessorOperationCallable()"); + } + + public UnaryCallable disableProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: disableProcessorCallable()"); + } + + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDefaultProcessorVersionOperationCallable()"); + } + + public UnaryCallable + setDefaultProcessorVersionCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDefaultProcessorVersionCallable()"); + } + public OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable() { @@ -72,6 +241,19 @@ public UnaryCallable reviewDocumentCallable() throw new UnsupportedOperationException("Not implemented: reviewDocumentCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java index 7da61e8f603..837e38a2c73 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java @@ -16,7 +16,13 @@ package com.google.cloud.documentai.v1.stub; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -31,26 +37,70 @@ import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; 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.documentai.v1.BatchProcessMetadata; import com.google.cloud.documentai.v1.BatchProcessRequest; import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorType; +import com.google.cloud.documentai.v1.ProcessorVersion; import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -103,10 +153,301 @@ public class DocumentProcessorServiceStubSettings private final OperationCallSettings< BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> batchProcessDocumentsOperationSettings; + private final UnaryCallSettings + fetchProcessorTypesSettings; + private final PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings; + private final PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings; + private final UnaryCallSettings getProcessorSettings; + private final UnaryCallSettings + getProcessorVersionSettings; + private final PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings; + private final UnaryCallSettings + deleteProcessorVersionSettings; + private final OperationCallSettings< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings; + private final UnaryCallSettings + deployProcessorVersionSettings; + private final OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings; + private final UnaryCallSettings + undeployProcessorVersionSettings; + private final OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings; + private final UnaryCallSettings createProcessorSettings; + private final UnaryCallSettings deleteProcessorSettings; + private final OperationCallSettings + deleteProcessorOperationSettings; + private final UnaryCallSettings enableProcessorSettings; + private final OperationCallSettings< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings; + private final UnaryCallSettings disableProcessorSettings; + private final OperationCallSettings< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings; + private final UnaryCallSettings + setDefaultProcessorVersionSettings; + private final OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings; private final UnaryCallSettings reviewDocumentSettings; private final OperationCallSettings< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListProcessorTypesRequest, ListProcessorTypesResponse, ProcessorType> + LIST_PROCESSOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListProcessorTypesRequest, ListProcessorTypesResponse, ProcessorType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProcessorTypesRequest injectToken( + ListProcessorTypesRequest payload, String token) { + return ListProcessorTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProcessorTypesRequest injectPageSize( + ListProcessorTypesRequest payload, int pageSize) { + return ListProcessorTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProcessorTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProcessorTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProcessorTypesResponse payload) { + return payload.getProcessorTypesList() == null + ? ImmutableList.of() + : payload.getProcessorTypesList(); + } + }; + + private static final PagedListDescriptor + LIST_PROCESSORS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProcessorsRequest injectToken(ListProcessorsRequest payload, String token) { + return ListProcessorsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProcessorsRequest injectPageSize( + ListProcessorsRequest payload, int pageSize) { + return ListProcessorsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProcessorsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProcessorsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProcessorsResponse payload) { + return payload.getProcessorsList() == null + ? ImmutableList.of() + : payload.getProcessorsList(); + } + }; + + private static final PagedListDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion> + LIST_PROCESSOR_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProcessorVersionsRequest injectToken( + ListProcessorVersionsRequest payload, String token) { + return ListProcessorVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProcessorVersionsRequest injectPageSize( + ListProcessorVersionsRequest payload, int pageSize) { + return ListProcessorVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProcessorVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProcessorVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListProcessorVersionsResponse payload) { + return payload.getProcessorVersionsList() == null + ? ImmutableList.of() + : payload.getProcessorVersionsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + LIST_PROCESSOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ListProcessorTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProcessorTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_PROCESSOR_TYPES_PAGE_STR_DESC, request, context); + return ListProcessorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + LIST_PROCESSORS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProcessorsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PROCESSORS_PAGE_STR_DESC, request, context); + return ListProcessorsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + LIST_PROCESSOR_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProcessorVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion> + pageContext = + PageContext.create( + callable, LIST_PROCESSOR_VERSIONS_PAGE_STR_DESC, request, context); + return ListProcessorVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; /** Returns the object with the settings used for calls to processDocument. */ public UnaryCallSettings processDocumentSettings() { @@ -124,6 +465,143 @@ public UnaryCallSettings batchProcessDocumentsSe return batchProcessDocumentsOperationSettings; } + /** Returns the object with the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings + fetchProcessorTypesSettings() { + return fetchProcessorTypesSettings; + } + + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return listProcessorTypesSettings; + } + + /** Returns the object with the settings used for calls to listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return listProcessorsSettings; + } + + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return getProcessorSettings; + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return getProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return listProcessorVersionsSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return deleteProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return deleteProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return deployProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return deployProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return undeployProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return undeployProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to createProcessor. */ + public UnaryCallSettings createProcessorSettings() { + return createProcessorSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public UnaryCallSettings deleteProcessorSettings() { + return deleteProcessorSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public OperationCallSettings + deleteProcessorOperationSettings() { + return deleteProcessorOperationSettings; + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public UnaryCallSettings enableProcessorSettings() { + return enableProcessorSettings; + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public OperationCallSettings< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return enableProcessorOperationSettings; + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public UnaryCallSettings disableProcessorSettings() { + return disableProcessorSettings; + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public OperationCallSettings< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return disableProcessorOperationSettings; + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return setDefaultProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return setDefaultProcessorVersionOperationSettings; + } + /** Returns the object with the settings used for calls to reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return reviewDocumentSettings; @@ -136,6 +614,17 @@ public UnaryCallSettings reviewDocumentSetting return reviewDocumentOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public DocumentProcessorServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -246,8 +735,36 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I batchProcessDocumentsSettings = settingsBuilder.batchProcessDocumentsSettings().build(); batchProcessDocumentsOperationSettings = settingsBuilder.batchProcessDocumentsOperationSettings().build(); + fetchProcessorTypesSettings = settingsBuilder.fetchProcessorTypesSettings().build(); + listProcessorTypesSettings = settingsBuilder.listProcessorTypesSettings().build(); + listProcessorsSettings = settingsBuilder.listProcessorsSettings().build(); + getProcessorSettings = settingsBuilder.getProcessorSettings().build(); + getProcessorVersionSettings = settingsBuilder.getProcessorVersionSettings().build(); + listProcessorVersionsSettings = settingsBuilder.listProcessorVersionsSettings().build(); + deleteProcessorVersionSettings = settingsBuilder.deleteProcessorVersionSettings().build(); + deleteProcessorVersionOperationSettings = + settingsBuilder.deleteProcessorVersionOperationSettings().build(); + deployProcessorVersionSettings = settingsBuilder.deployProcessorVersionSettings().build(); + deployProcessorVersionOperationSettings = + settingsBuilder.deployProcessorVersionOperationSettings().build(); + undeployProcessorVersionSettings = settingsBuilder.undeployProcessorVersionSettings().build(); + undeployProcessorVersionOperationSettings = + settingsBuilder.undeployProcessorVersionOperationSettings().build(); + createProcessorSettings = settingsBuilder.createProcessorSettings().build(); + deleteProcessorSettings = settingsBuilder.deleteProcessorSettings().build(); + deleteProcessorOperationSettings = settingsBuilder.deleteProcessorOperationSettings().build(); + enableProcessorSettings = settingsBuilder.enableProcessorSettings().build(); + enableProcessorOperationSettings = settingsBuilder.enableProcessorOperationSettings().build(); + disableProcessorSettings = settingsBuilder.disableProcessorSettings().build(); + disableProcessorOperationSettings = settingsBuilder.disableProcessorOperationSettings().build(); + setDefaultProcessorVersionSettings = + settingsBuilder.setDefaultProcessorVersionSettings().build(); + setDefaultProcessorVersionOperationSettings = + settingsBuilder.setDefaultProcessorVersionOperationSettings().build(); reviewDocumentSettings = settingsBuilder.reviewDocumentSettings().build(); reviewDocumentOperationSettings = settingsBuilder.reviewDocumentOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for DocumentProcessorServiceStubSettings. */ @@ -261,11 +778,74 @@ public static class Builder private final OperationCallSettings.Builder< BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> batchProcessDocumentsOperationSettings; + private final UnaryCallSettings.Builder + fetchProcessorTypesSettings; + private final PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings; + private final PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings; + private final UnaryCallSettings.Builder getProcessorSettings; + private final UnaryCallSettings.Builder + getProcessorVersionSettings; + private final PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings; + private final UnaryCallSettings.Builder + deleteProcessorVersionSettings; + private final OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder + deployProcessorVersionSettings; + private final OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder + undeployProcessorVersionSettings; + private final OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder + createProcessorSettings; + private final UnaryCallSettings.Builder + deleteProcessorSettings; + private final OperationCallSettings.Builder< + DeleteProcessorRequest, Empty, DeleteProcessorMetadata> + deleteProcessorOperationSettings; + private final UnaryCallSettings.Builder + enableProcessorSettings; + private final OperationCallSettings.Builder< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings; + private final UnaryCallSettings.Builder + disableProcessorSettings; + private final OperationCallSettings.Builder< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings; + private final UnaryCallSettings.Builder + setDefaultProcessorVersionSettings; + private final OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings; private final UnaryCallSettings.Builder reviewDocumentSettings; private final OperationCallSettings.Builder< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -277,6 +857,7 @@ public static class Builder ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -296,6 +877,8 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(120000L)) .build(); definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -309,12 +892,54 @@ protected Builder(ClientContext clientContext) { processDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchProcessDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder(); + fetchProcessorTypesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProcessorTypesSettings = PagedCallSettings.newBuilder(LIST_PROCESSOR_TYPES_PAGE_STR_FACT); + listProcessorsSettings = PagedCallSettings.newBuilder(LIST_PROCESSORS_PAGE_STR_FACT); + getProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProcessorVersionsSettings = + PagedCallSettings.newBuilder(LIST_PROCESSOR_VERSIONS_PAGE_STR_FACT); + deleteProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + deployProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deployProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + undeployProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeployProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + createProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorOperationSettings = OperationCallSettings.newBuilder(); + enableProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + enableProcessorOperationSettings = OperationCallSettings.newBuilder(); + disableProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + disableProcessorOperationSettings = OperationCallSettings.newBuilder(); + setDefaultProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); reviewDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); reviewDocumentOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - processDocumentSettings, batchProcessDocumentsSettings, reviewDocumentSettings); + processDocumentSettings, + batchProcessDocumentsSettings, + fetchProcessorTypesSettings, + listProcessorTypesSettings, + listProcessorsSettings, + getProcessorSettings, + getProcessorVersionSettings, + listProcessorVersionsSettings, + deleteProcessorVersionSettings, + deployProcessorVersionSettings, + undeployProcessorVersionSettings, + createProcessorSettings, + deleteProcessorSettings, + enableProcessorSettings, + disableProcessorSettings, + setDefaultProcessorVersionSettings, + reviewDocumentSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -325,12 +950,57 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { batchProcessDocumentsSettings = settings.batchProcessDocumentsSettings.toBuilder(); batchProcessDocumentsOperationSettings = settings.batchProcessDocumentsOperationSettings.toBuilder(); + fetchProcessorTypesSettings = settings.fetchProcessorTypesSettings.toBuilder(); + listProcessorTypesSettings = settings.listProcessorTypesSettings.toBuilder(); + listProcessorsSettings = settings.listProcessorsSettings.toBuilder(); + getProcessorSettings = settings.getProcessorSettings.toBuilder(); + getProcessorVersionSettings = settings.getProcessorVersionSettings.toBuilder(); + listProcessorVersionsSettings = settings.listProcessorVersionsSettings.toBuilder(); + deleteProcessorVersionSettings = settings.deleteProcessorVersionSettings.toBuilder(); + deleteProcessorVersionOperationSettings = + settings.deleteProcessorVersionOperationSettings.toBuilder(); + deployProcessorVersionSettings = settings.deployProcessorVersionSettings.toBuilder(); + deployProcessorVersionOperationSettings = + settings.deployProcessorVersionOperationSettings.toBuilder(); + undeployProcessorVersionSettings = settings.undeployProcessorVersionSettings.toBuilder(); + undeployProcessorVersionOperationSettings = + settings.undeployProcessorVersionOperationSettings.toBuilder(); + createProcessorSettings = settings.createProcessorSettings.toBuilder(); + deleteProcessorSettings = settings.deleteProcessorSettings.toBuilder(); + deleteProcessorOperationSettings = settings.deleteProcessorOperationSettings.toBuilder(); + enableProcessorSettings = settings.enableProcessorSettings.toBuilder(); + enableProcessorOperationSettings = settings.enableProcessorOperationSettings.toBuilder(); + disableProcessorSettings = settings.disableProcessorSettings.toBuilder(); + disableProcessorOperationSettings = settings.disableProcessorOperationSettings.toBuilder(); + setDefaultProcessorVersionSettings = settings.setDefaultProcessorVersionSettings.toBuilder(); + setDefaultProcessorVersionOperationSettings = + settings.setDefaultProcessorVersionOperationSettings.toBuilder(); reviewDocumentSettings = settings.reviewDocumentSettings.toBuilder(); reviewDocumentOperationSettings = settings.reviewDocumentOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - processDocumentSettings, batchProcessDocumentsSettings, reviewDocumentSettings); + processDocumentSettings, + batchProcessDocumentsSettings, + fetchProcessorTypesSettings, + listProcessorTypesSettings, + listProcessorsSettings, + getProcessorSettings, + getProcessorVersionSettings, + listProcessorVersionsSettings, + deleteProcessorVersionSettings, + deployProcessorVersionSettings, + undeployProcessorVersionSettings, + createProcessorSettings, + deleteProcessorSettings, + enableProcessorSettings, + disableProcessorSettings, + setDefaultProcessorVersionSettings, + reviewDocumentSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -370,11 +1040,91 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .fetchProcessorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listProcessorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listProcessorsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listProcessorVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deployProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .undeployProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .enableProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .disableProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setDefaultProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .reviewDocumentSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .batchProcessDocumentsOperationSettings() .setInitialCallSettings( @@ -399,6 +1149,182 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .deleteProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeleteProcessorVersionMetadata.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 + .deployProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + DeployProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeployProcessorVersionMetadata.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 + .undeployProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + UndeployProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UndeployProcessorVersionMetadata.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 + .deleteProcessorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteProcessorMetadata.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 + .enableProcessorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(EnableProcessorResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(EnableProcessorMetadata.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 + .disableProcessorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(DisableProcessorResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DisableProcessorMetadata.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 + .setDefaultProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + SetDefaultProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + SetDefaultProcessorVersionMetadata.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 .reviewDocumentOperationSettings() .setInitialCallSettings( @@ -462,6 +1388,159 @@ public UnaryCallSettings.Builder processDocumen return batchProcessDocumentsOperationSettings; } + /** Returns the builder for the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings.Builder + fetchProcessorTypesSettings() { + return fetchProcessorTypesSettings; + } + + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return listProcessorTypesSettings; + } + + /** Returns the builder for the settings used for calls to listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return listProcessorsSettings; + } + + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getProcessorSettings; + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return listProcessorVersionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return deleteProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return deleteProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return deployProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return deployProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return undeployProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return undeployProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to createProcessor. */ + public UnaryCallSettings.Builder createProcessorSettings() { + return createProcessorSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public UnaryCallSettings.Builder deleteProcessorSettings() { + return deleteProcessorSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteProcessorOperationSettings() { + return deleteProcessorOperationSettings; + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public UnaryCallSettings.Builder enableProcessorSettings() { + return enableProcessorSettings; + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return enableProcessorOperationSettings; + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public UnaryCallSettings.Builder + disableProcessorSettings() { + return disableProcessorSettings; + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return disableProcessorOperationSettings; + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return setDefaultProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return setDefaultProcessorVersionOperationSettings; + } + /** Returns the builder for the settings used for calls to reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return reviewDocumentSettings; @@ -476,6 +1555,18 @@ public UnaryCallSettings.Builder reviewDocumen return reviewDocumentOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public DocumentProcessorServiceStubSettings build() throws IOException { return new DocumentProcessorServiceStubSettings(this); diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java index 7c8c7f96a67..c8bcdc0cc3d 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java @@ -16,6 +16,11 @@ package com.google.cloud.documentai.v1.stub; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -26,14 +31,51 @@ import com.google.cloud.documentai.v1.BatchProcessMetadata; import com.google.cloud.documentai.v1.BatchProcessRequest; import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorVersion; import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -68,6 +110,162 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + fetchProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessors") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.documentai.v1.DocumentProcessorService/GetProcessor") + .setRequestMarshaller(ProtoUtils.marshaller(GetProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + enableProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(EnableProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + disableProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(DisableProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor reviewDocumentMethodDescriptor = MethodDescriptor.newBuilder() @@ -79,14 +277,91 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable processDocumentCallable; private final UnaryCallable batchProcessDocumentsCallable; private final OperationCallable batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; private final UnaryCallable reviewDocumentCallable; private final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -153,6 +428,156 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings + fetchProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listProcessorsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listProcessorVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + undeployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings enableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings disableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + setDefaultProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("processor", String.valueOf(request.getProcessor())); + return params.build(); + }) + .build(); GrpcCallSettings reviewDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(reviewDocumentMethodDescriptor) @@ -163,6 +588,26 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.processDocumentCallable = callableFactory.createUnaryCallable( @@ -178,6 +623,119 @@ protected GrpcDocumentProcessorServiceStub( settings.batchProcessDocumentsOperationSettings(), clientContext, operationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + operationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + operationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + operationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + operationsStub); this.reviewDocumentCallable = callableFactory.createUnaryCallable( reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); @@ -187,6 +745,15 @@ protected GrpcDocumentProcessorServiceStub( settings.reviewDocumentOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -212,6 +779,151 @@ public UnaryCallable batchProcessDocumentsCallab return batchProcessDocumentsOperationCallable; } + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + @Override public UnaryCallable reviewDocumentCallable() { return reviewDocumentCallable; @@ -224,6 +936,22 @@ public UnaryCallable reviewDocumentCallable() return reviewDocumentOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java index 745b9ea5975..4a45ee5db83 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java @@ -16,6 +16,11 @@ package com.google.cloud.documentai.v1.stub; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -34,12 +39,49 @@ import com.google.cloud.documentai.v1.BatchProcessMetadata; import com.google.cloud.documentai.v1.BatchProcessRequest; import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorVersion; import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; import java.io.IOException; import java.util.ArrayList; @@ -60,26 +102,522 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServiceStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() - .add(BatchProcessResponse.getDescriptor()) - .add(ReviewDocumentResponse.getDescriptor()) + .add(UndeployProcessorVersionResponse.getDescriptor()) + .add(EnableProcessorResponse.getDescriptor()) + .add(SetDefaultProcessorVersionMetadata.getDescriptor()) + .add(EnableProcessorMetadata.getDescriptor()) .add(ReviewDocumentOperationMetadata.getDescriptor()) + .add(SetDefaultProcessorVersionResponse.getDescriptor()) .add(BatchProcessMetadata.getDescriptor()) + .add(DeleteProcessorMetadata.getDescriptor()) + .add(DeleteProcessorVersionMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(DeployProcessorVersionResponse.getDescriptor()) + .add(DisableProcessorResponse.getDescriptor()) + .add(BatchProcessResponse.getDescriptor()) + .add(ReviewDocumentResponse.getDescriptor()) + .add(UndeployProcessorVersionMetadata.getDescriptor()) + .add(DeployProcessorVersionMetadata.getDescriptor()) + .add(DisableProcessorMetadata.getDescriptor()) .build(); - private static final ApiMethodDescriptor - processDocumentMethodDescriptor = - ApiMethodDescriptor.newBuilder() + private static final ApiMethodDescriptor + processDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:process", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + batchProcessDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchProcessRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + fetchProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessors") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.documentai.v1.DocumentProcessorService/GetProcessor") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorVersion.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse> + listProcessorVersionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + undeployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UndeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("processor", request.getProcessor())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + enableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() .setFullMethodName( - "google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument") + "google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() + ProtoMessageRequestFormatter.newBuilder() .setPath( - "/v1/{name=projects/*/locations/*/processors/*}:process", + "/v1/{name=projects/*/locations/*/processors/*}:enable", request -> { Map fields = new HashMap<>(); - ProtoRestSerializer serializer = + ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; @@ -87,7 +625,7 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = + ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) @@ -97,26 +635,29 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .toBody("*", request.toBuilder().clearName().build())) .build()) .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ProcessResponse.getDefaultInstance()) + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) + .setOperationSnapshotFactory( + (EnableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) .build(); - private static final ApiMethodDescriptor - batchProcessDocumentsMethodDescriptor = - ApiMethodDescriptor.newBuilder() + private static final ApiMethodDescriptor + disableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() .setFullMethodName( - "google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments") + "google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() + ProtoMessageRequestFormatter.newBuilder() .setPath( - "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", + "/v1/{name=projects/*/locations/*/processors/*}:disable", request -> { Map fields = new HashMap<>(); - ProtoRestSerializer serializer = + ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; @@ -124,7 +665,7 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = + ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) @@ -139,7 +680,47 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( - (BatchProcessRequest request, Operation response) -> + (DisableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "processor", request.getProcessor()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearProcessor().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SetDefaultProcessorVersionRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); @@ -185,14 +766,140 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable processDocumentCallable; private final UnaryCallable batchProcessDocumentsCallable; private final OperationCallable batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; private final UnaryCallable reviewDocumentCallable; private final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -252,11 +959,103 @@ protected HttpJsonDocumentProcessorServiceStub( .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + fetchProcessorTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listProcessorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listProcessorsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listProcessorVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + undeployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings enableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings disableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + setDefaultProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings reviewDocumentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(reviewDocumentMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); this.processDocumentCallable = callableFactory.createUnaryCallable( @@ -272,6 +1071,119 @@ protected HttpJsonDocumentProcessorServiceStub( settings.batchProcessDocumentsOperationSettings(), clientContext, httpJsonOperationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); this.reviewDocumentCallable = callableFactory.createUnaryCallable( reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); @@ -281,6 +1193,15 @@ protected HttpJsonDocumentProcessorServiceStub( settings.reviewDocumentOperationSettings(), clientContext, httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -291,7 +1212,23 @@ public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(processDocumentMethodDescriptor); methodDescriptors.add(batchProcessDocumentsMethodDescriptor); + methodDescriptors.add(fetchProcessorTypesMethodDescriptor); + methodDescriptors.add(listProcessorTypesMethodDescriptor); + methodDescriptors.add(listProcessorsMethodDescriptor); + methodDescriptors.add(getProcessorMethodDescriptor); + methodDescriptors.add(getProcessorVersionMethodDescriptor); + methodDescriptors.add(listProcessorVersionsMethodDescriptor); + methodDescriptors.add(deleteProcessorVersionMethodDescriptor); + methodDescriptors.add(deployProcessorVersionMethodDescriptor); + methodDescriptors.add(undeployProcessorVersionMethodDescriptor); + methodDescriptors.add(createProcessorMethodDescriptor); + methodDescriptors.add(deleteProcessorMethodDescriptor); + methodDescriptors.add(enableProcessorMethodDescriptor); + methodDescriptors.add(disableProcessorMethodDescriptor); + methodDescriptors.add(setDefaultProcessorVersionMethodDescriptor); methodDescriptors.add(reviewDocumentMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; } @@ -315,6 +1252,151 @@ public UnaryCallable batchProcessDocumentsCallab return batchProcessDocumentsOperationCallable; } + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + @Override public UnaryCallable reviewDocumentCallable() { return reviewDocumentCallable; @@ -327,6 +1409,22 @@ public UnaryCallable reviewDocumentCallable() return reviewDocumentOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java index 58a126650d4..07771d3f650 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java @@ -28,8 +28,13 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1beta3.stub.DocumentProcessorServiceStub; import com.google.cloud.documentai.v1beta3.stub.DocumentProcessorServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; import com.google.protobuf.Empty; @@ -53,7 +58,7 @@ * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } @@ -215,15 +220,22 @@ public final OperationsClient getHttpJsonOperationsClient() { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of the + * [Processor][google.cloud.documentai.v1beta3.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use for processing. + * If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will + * use its [default + * version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProcessResponse processDocument(ProcessorName name) { + public final ProcessResponse processDocument(ResourceName name) { ProcessRequest request = ProcessRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return processDocument(request); @@ -240,12 +252,19 @@ public final ProcessResponse processDocument(ProcessorName name) { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of the + * [Processor][google.cloud.documentai.v1beta3.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use for processing. + * If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will + * use its [default + * version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ProcessResponse processDocument(String name) { @@ -269,6 +288,7 @@ public final ProcessResponse processDocument(String name) { * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) * .setSkipHumanReview(true) + * .setFieldMask(FieldMask.newBuilder().build()) * .build(); * ProcessResponse response = documentProcessorServiceClient.processDocument(request); * } @@ -297,6 +317,7 @@ public final ProcessResponse processDocument(ProcessRequest request) { * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) * .setSkipHumanReview(true) + * .setFieldMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = * documentProcessorServiceClient.processDocumentCallable().futureCall(request); @@ -321,17 +342,21 @@ public final UnaryCallable processDocumentCalla * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * BatchProcessResponse response = * documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of + * [Processor][google.cloud.documentai.v1beta3.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture - batchProcessDocumentsAsync(ProcessorName name) { + batchProcessDocumentsAsync(ResourceName name) { BatchProcessRequest request = BatchProcessRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return batchProcessDocumentsAsync(request); @@ -349,13 +374,17 @@ public final UnaryCallable processDocumentCalla * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); * BatchProcessResponse response = * documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); * } * } * - * @param name Required. The processor resource name. + * @param name Required. The resource name of + * [Processor][google.cloud.documentai.v1beta3.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]. Format: + * `projects/{project}/locations/{location}/processors/{processor}`, or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture @@ -467,7 +496,8 @@ public final UnaryCallable batchProcessDocuments // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Fetches processor types. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -482,8 +512,9 @@ public final UnaryCallable batchProcessDocuments * } * } * - * @param parent Required. The project of processor type to list. Format: - * projects/{project}/locations/{location} + * @param parent Required. The project of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent) { @@ -496,7 +527,8 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Fetches processor types. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -511,8 +543,9 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent * } * } * - * @param parent Required. The project of processor type to list. Format: - * projects/{project}/locations/{location} + * @param parent Required. The project of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) { @@ -523,7 +556,8 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Fetches processor types. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -550,7 +584,8 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypes // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Fetches processor types. + * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not + * paginated. * *

Sample code: * @@ -577,7 +612,7 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypes // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all processors which belong to this project. + * Lists the processor types that exist. * *

Sample code: * @@ -587,27 +622,29 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypes * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + * for (ProcessorType element : + * documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { * // doThingsWith(element); * } * } * } * - * @param parent Required. The parent (project and location) which owns this collection of - * Processors. Format: projects/{project}/locations/{location} + * @param parent Required. The location of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListProcessorsPagedResponse listProcessors(LocationName parent) { - ListProcessorsRequest request = - ListProcessorsRequest.newBuilder() + public final ListProcessorTypesPagedResponse listProcessorTypes(LocationName parent) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); - return listProcessors(request); + return listProcessorTypes(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all processors which belong to this project. + * Lists the processor types that exist. * *

Sample code: * @@ -617,24 +654,27 @@ public final ListProcessorsPagedResponse listProcessors(LocationName parent) { * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + * for (ProcessorType element : + * documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { * // doThingsWith(element); * } * } * } * - * @param parent Required. The parent (project and location) which owns this collection of - * Processors. Format: projects/{project}/locations/{location} + * @param parent Required. The location of processor type to list. The available processor types + * may depend on the allow-listing on projects. Format: + * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListProcessorsPagedResponse listProcessors(String parent) { - ListProcessorsRequest request = ListProcessorsRequest.newBuilder().setParent(parent).build(); - return listProcessors(request); + public final ListProcessorTypesPagedResponse listProcessorTypes(String parent) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder().setParent(parent).build(); + return listProcessorTypes(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all processors which belong to this project. + * Lists the processor types that exist. * *

Sample code: * @@ -643,14 +683,14 @@ public final ListProcessorsPagedResponse listProcessors(String parent) { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ListProcessorsRequest request = - * ListProcessorsRequest.newBuilder() + * ListProcessorTypesRequest request = + * ListProcessorTypesRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); - * for (Processor element : - * documentProcessorServiceClient.listProcessors(request).iterateAll()) { + * for (ProcessorType element : + * documentProcessorServiceClient.listProcessorTypes(request).iterateAll()) { * // doThingsWith(element); * } * } @@ -659,13 +699,14 @@ public final ListProcessorsPagedResponse listProcessors(String parent) { * @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 ListProcessorsPagedResponse listProcessors(ListProcessorsRequest request) { - return listProcessorsPagedCallable().call(request); + public final ListProcessorTypesPagedResponse listProcessorTypes( + ListProcessorTypesRequest request) { + return listProcessorTypesPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all processors which belong to this project. + * Lists the processor types that exist. * *

Sample code: * @@ -674,29 +715,29 @@ public final ListProcessorsPagedResponse listProcessors(ListProcessorsRequest re * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ListProcessorsRequest request = - * ListProcessorsRequest.newBuilder() + * ListProcessorTypesRequest request = + * ListProcessorTypesRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); - * ApiFuture future = - * documentProcessorServiceClient.listProcessorsPagedCallable().futureCall(request); + * ApiFuture future = + * documentProcessorServiceClient.listProcessorTypesPagedCallable().futureCall(request); * // Do something. - * for (Processor element : future.get().iterateAll()) { + * for (ProcessorType element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * } */ - public final UnaryCallable - listProcessorsPagedCallable() { - return stub.listProcessorsPagedCallable(); + public final UnaryCallable + listProcessorTypesPagedCallable() { + return stub.listProcessorTypesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all processors which belong to this project. + * Lists the processor types that exist. * *

Sample code: * @@ -705,16 +746,16 @@ public final ListProcessorsPagedResponse listProcessors(ListProcessorsRequest re * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ListProcessorsRequest request = - * ListProcessorsRequest.newBuilder() + * ListProcessorTypesRequest request = + * ListProcessorTypesRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); * while (true) { - * ListProcessorsResponse response = - * documentProcessorServiceClient.listProcessorsCallable().call(request); - * for (Processor element : response.getProcessorsList()) { + * ListProcessorTypesResponse response = + * documentProcessorServiceClient.listProcessorTypesCallable().call(request); + * for (ProcessorType element : response.getProcessorTypesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -727,15 +768,14 @@ public final ListProcessorsPagedResponse listProcessors(ListProcessorsRequest re * } * } */ - public final UnaryCallable - listProcessorsCallable() { - return stub.listProcessorsCallable(); + public final UnaryCallable + listProcessorTypesCallable() { + return stub.listProcessorTypesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a processor from the type processor that the user chose. The processor will be at - * "ENABLED" state by default after its creation. + * Lists all processors which belong to this project. * *

Sample code: * @@ -745,30 +785,27 @@ public final ListProcessorsPagedResponse listProcessors(ListProcessorsRequest re * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * Processor processor = Processor.newBuilder().build(); - * Processor response = documentProcessorServiceClient.createProcessor(parent, processor); + * for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + * // doThingsWith(element); + * } * } * } * - * @param parent Required. The parent (project and location) under which to create the processor. - * Format: projects/{project}/locations/{location} - * @param processor Required. The processor to be created, requires [processor_type] and - * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @param parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Processor createProcessor(LocationName parent, Processor processor) { - CreateProcessorRequest request = - CreateProcessorRequest.newBuilder() + public final ListProcessorsPagedResponse listProcessors(LocationName parent) { + ListProcessorsRequest request = + ListProcessorsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) - .setProcessor(processor) .build(); - return createProcessor(request); + return listProcessors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a processor from the type processor that the user chose. The processor will be at - * "ENABLED" state by default after its creation. + * Lists all processors which belong to this project. * *

Sample code: * @@ -778,27 +815,24 @@ public final Processor createProcessor(LocationName parent, Processor processor) * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * Processor processor = Processor.newBuilder().build(); - * Processor response = documentProcessorServiceClient.createProcessor(parent, processor); + * for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + * // doThingsWith(element); + * } * } * } * - * @param parent Required. The parent (project and location) under which to create the processor. - * Format: projects/{project}/locations/{location} - * @param processor Required. The processor to be created, requires [processor_type] and - * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @param parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Processor createProcessor(String parent, Processor processor) { - CreateProcessorRequest request = - CreateProcessorRequest.newBuilder().setParent(parent).setProcessor(processor).build(); - return createProcessor(request); + public final ListProcessorsPagedResponse listProcessors(String parent) { + ListProcessorsRequest request = ListProcessorsRequest.newBuilder().setParent(parent).build(); + return listProcessors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a processor from the type processor that the user chose. The processor will be at - * "ENABLED" state by default after its creation. + * Lists all processors which belong to this project. * *

Sample code: * @@ -807,26 +841,29 @@ public final Processor createProcessor(String parent, Processor processor) { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * CreateProcessorRequest request = - * CreateProcessorRequest.newBuilder() + * ListProcessorsRequest request = + * ListProcessorsRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setProcessor(Processor.newBuilder().build()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") * .build(); - * Processor response = documentProcessorServiceClient.createProcessor(request); + * for (Processor element : + * documentProcessorServiceClient.listProcessors(request).iterateAll()) { + * // doThingsWith(element); + * } * } * } * * @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 Processor createProcessor(CreateProcessorRequest request) { - return createProcessorCallable().call(request); + public final ListProcessorsPagedResponse listProcessors(ListProcessorsRequest request) { + return listProcessorsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a processor from the type processor that the user chose. The processor will be at - * "ENABLED" state by default after its creation. + * Lists all processors which belong to this project. * *

Sample code: * @@ -835,26 +872,67 @@ public final Processor createProcessor(CreateProcessorRequest request) { * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * CreateProcessorRequest request = - * CreateProcessorRequest.newBuilder() + * ListProcessorsRequest request = + * ListProcessorsRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setProcessor(Processor.newBuilder().build()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") * .build(); * ApiFuture future = - * documentProcessorServiceClient.createProcessorCallable().futureCall(request); + * documentProcessorServiceClient.listProcessorsPagedCallable().futureCall(request); * // Do something. - * Processor response = future.get(); + * for (Processor element : future.get().iterateAll()) { + * // doThingsWith(element); + * } * } * } */ - public final UnaryCallable createProcessorCallable() { - return stub.createProcessorCallable(); + public final UnaryCallable + listProcessorsPagedCallable() { + return stub.listProcessorsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes - * all artifacts associated with this processor. + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorsResponse response =
+   *         documentProcessorServiceClient.listProcessorsCallable().call(request);
+   *     for (Processor element : response.getProcessorsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorsCallable() { + return stub.listProcessorsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a processor detail. * *

Sample code: * @@ -864,24 +942,22 @@ public final UnaryCallable createProcessorCal * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - * documentProcessorServiceClient.deleteProcessorAsync(name).get(); + * Processor response = documentProcessorServiceClient.getProcessor(name); * } * } * - * @param name Required. The processor resource name to be deleted. + * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteProcessorAsync( - ProcessorName name) { - DeleteProcessorRequest request = - DeleteProcessorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteProcessorAsync(request); + public final Processor getProcessor(ProcessorName name) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProcessor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes - * all artifacts associated with this processor. + * Gets a processor detail. * *

Sample code: * @@ -891,22 +967,21 @@ public final OperationFuture deleteProcessorAsyn * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { * String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); - * documentProcessorServiceClient.deleteProcessorAsync(name).get(); + * Processor response = documentProcessorServiceClient.getProcessor(name); * } * } * - * @param name Required. The processor resource name to be deleted. + * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteProcessorAsync(String name) { - DeleteProcessorRequest request = DeleteProcessorRequest.newBuilder().setName(name).build(); - return deleteProcessorAsync(request); + public final Processor getProcessor(String name) { + GetProcessorRequest request = GetProcessorRequest.newBuilder().setName(name).build(); + return getProcessor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes - * all artifacts associated with this processor. + * Gets a processor detail. * *

Sample code: * @@ -915,26 +990,24 @@ public final OperationFuture deleteProcessorAsyn * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DeleteProcessorRequest request = - * DeleteProcessorRequest.newBuilder() + * GetProcessorRequest request = + * GetProcessorRequest.newBuilder() * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .build(); - * documentProcessorServiceClient.deleteProcessorAsync(request).get(); + * Processor response = documentProcessorServiceClient.getProcessor(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 OperationFuture deleteProcessorAsync( - DeleteProcessorRequest request) { - return deleteProcessorOperationCallable().futureCall(request); + public final Processor getProcessor(GetProcessorRequest request) { + return getProcessorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes - * all artifacts associated with this processor. + * Gets a processor detail. * *

Sample code: * @@ -943,26 +1016,24 @@ public final OperationFuture deleteProcessorAsyn * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DeleteProcessorRequest request = - * DeleteProcessorRequest.newBuilder() + * GetProcessorRequest request = + * GetProcessorRequest.newBuilder() * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .build(); - * OperationFuture future = - * documentProcessorServiceClient.deleteProcessorOperationCallable().futureCall(request); + * ApiFuture future = + * documentProcessorServiceClient.getProcessorCallable().futureCall(request); * // Do something. - * future.get(); + * Processor response = future.get(); * } * } */ - public final OperationCallable - deleteProcessorOperationCallable() { - return stub.deleteProcessorOperationCallable(); + public final UnaryCallable getProcessorCallable() { + return stub.getProcessorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes - * all artifacts associated with this processor. + * Gets a processor version detail. * *

Sample code: * @@ -971,24 +1042,26 @@ public final OperationFuture deleteProcessorAsyn * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DeleteProcessorRequest request = - * DeleteProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) - * .build(); - * ApiFuture future = - * documentProcessorServiceClient.deleteProcessorCallable().futureCall(request); - * // Do something. - * future.get(); + * ProcessorVersionName name = + * ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + * ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); * } * } + * + * @param name Required. The processor resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable deleteProcessorCallable() { - return stub.deleteProcessorCallable(); + public final ProcessorVersion getProcessorVersion(ProcessorVersionName name) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getProcessorVersion(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Enables a processor + * Gets a processor version detail. * *

Sample code: * @@ -997,26 +1070,25 @@ public final UnaryCallable deleteProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * EnableProcessorRequest request = - * EnableProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) - * .build(); - * EnableProcessorResponse response = - * documentProcessorServiceClient.enableProcessorAsync(request).get(); + * String name = + * ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + * .toString(); + * ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); * } * } * - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture - enableProcessorAsync(EnableProcessorRequest request) { - return enableProcessorOperationCallable().futureCall(request); + public final ProcessorVersion getProcessorVersion(String name) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder().setName(name).build(); + return getProcessorVersion(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Enables a processor + * Gets a processor version detail. * *

Sample code: * @@ -1025,26 +1097,27 @@ public final UnaryCallable deleteProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * EnableProcessorRequest request = - * EnableProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * GetProcessorVersionRequest request = + * GetProcessorVersionRequest.newBuilder() + * .setName( + * ProcessorVersionName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + * .toString()) * .build(); - * OperationFuture future = - * documentProcessorServiceClient.enableProcessorOperationCallable().futureCall(request); - * // Do something. - * EnableProcessorResponse response = future.get(); + * ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(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 OperationCallable< - EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> - enableProcessorOperationCallable() { - return stub.enableProcessorOperationCallable(); + public final ProcessorVersion getProcessorVersion(GetProcessorVersionRequest request) { + return getProcessorVersionCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Enables a processor + * Gets a processor version detail. * *

Sample code: * @@ -1053,24 +1126,28 @@ public final UnaryCallable deleteProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * EnableProcessorRequest request = - * EnableProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * GetProcessorVersionRequest request = + * GetProcessorVersionRequest.newBuilder() + * .setName( + * ProcessorVersionName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + * .toString()) * .build(); - * ApiFuture future = - * documentProcessorServiceClient.enableProcessorCallable().futureCall(request); + * ApiFuture future = + * documentProcessorServiceClient.getProcessorVersionCallable().futureCall(request); * // Do something. - * Operation response = future.get(); + * ProcessorVersion response = future.get(); * } * } */ - public final UnaryCallable enableProcessorCallable() { - return stub.enableProcessorCallable(); + public final UnaryCallable + getProcessorVersionCallable() { + return stub.getProcessorVersionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Disables a processor + * Lists all versions of a processor. * *

Sample code: * @@ -1079,26 +1156,1076 @@ public final UnaryCallable enableProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DisableProcessorRequest request = + * ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * for (ProcessorVersion element : + * documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + * + * @param parent Required. The parent (project, location and processor) to list all versions. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorVersionsPagedResponse listProcessorVersions(ProcessorName parent) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProcessorVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   for (ProcessorVersion element :
+   *       documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project, location and processor) to list all versions. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProcessorVersionsPagedResponse listProcessorVersions(String parent) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder().setParent(parent).build(); + return listProcessorVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ProcessorVersion element :
+   *       documentProcessorServiceClient.listProcessorVersions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListProcessorVersionsPagedResponse listProcessorVersions( + ListProcessorVersionsRequest request) { + return listProcessorVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listProcessorVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ProcessorVersion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorVersionsPagedCallable() { + return stub.listProcessorVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of a processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorVersionsRequest request =
+   *       ListProcessorVersionsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorVersionsResponse response =
+   *         documentProcessorServiceClient.listProcessorVersionsCallable().call(request);
+   *     for (ProcessorVersion element : response.getProcessorVersionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProcessorVersionsCallable() { + return stub.listProcessorVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorVersionAsync( + ProcessorVersionName name) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorVersionAsync( + String name) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder().setName(name).build(); + return deleteProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   documentProcessorServiceClient.deleteProcessorVersionAsync(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 deleteProcessorVersionAsync( + DeleteProcessorVersionRequest request) { + return deleteProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .deleteProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable() { + return stub.deleteProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor version, all artifacts under the processor version will be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorVersionRequest request =
+   *       DeleteProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deleteProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteProcessorVersionCallable() { + return stub.deleteProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + deployProcessorVersionAsync(ProcessorVersionName name) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be deployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + deployProcessorVersionAsync(String name) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder().setName(name).build(); + return deployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   DeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.deployProcessorVersionAsync(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 + deployProcessorVersionAsync(DeployProcessorVersionRequest request) { + return deployProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .deployProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   DeployProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return stub.deployProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeployProcessorVersionRequest request =
+   *       DeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deployProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deployProcessorVersionCallable() { + return stub.deployProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be undeployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + undeployProcessorVersionAsync(ProcessorVersionName name) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return undeployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor version resource name to be undeployed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + undeployProcessorVersionAsync(String name) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder().setName(name).build(); + return undeployProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   UndeployProcessorVersionResponse response =
+   *       documentProcessorServiceClient.undeployProcessorVersionAsync(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 + undeployProcessorVersionAsync(UndeployProcessorVersionRequest request) { + return undeployProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .undeployProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   UndeployProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return stub.undeployProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys the processor version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   UndeployProcessorVersionRequest request =
+   *       UndeployProcessorVersionRequest.newBuilder()
+   *           .setName(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.undeployProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + undeployProcessorVersionCallable() { + return stub.undeployProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Processor processor = Processor.newBuilder().build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) under which to create the processor. + * Format: `projects/{project}/locations/{location}` + * @param processor Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor createProcessor(LocationName parent, Processor processor) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProcessor(processor) + .build(); + return createProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Processor processor = Processor.newBuilder().build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(parent, processor);
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) under which to create the processor. + * Format: `projects/{project}/locations/{location}` + * @param processor Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Processor createProcessor(String parent, Processor processor) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder().setParent(parent).setProcessor(processor).build(); + return createProcessor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setProcessor(Processor.newBuilder().build())
+   *           .build();
+   *   Processor response = documentProcessorServiceClient.createProcessor(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 Processor createProcessor(CreateProcessorRequest request) { + return createProcessorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a processor from the type processor that the user chose. The processor will be at + * "ENABLED" state by default after its creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setProcessor(Processor.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.createProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Processor response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createProcessorCallable() { + return stub.createProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   documentProcessorServiceClient.deleteProcessorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorAsync( + ProcessorName name) { + DeleteProcessorRequest request = + DeleteProcessorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteProcessorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   documentProcessorServiceClient.deleteProcessorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The processor resource name to be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProcessorAsync(String name) { + DeleteProcessorRequest request = DeleteProcessorRequest.newBuilder().setName(name).build(); + return deleteProcessorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   documentProcessorServiceClient.deleteProcessorAsync(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 deleteProcessorAsync( + DeleteProcessorRequest request) { + return deleteProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.deleteProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteProcessorOperationCallable() { + return stub.deleteProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes + * all artifacts associated with this processor. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DeleteProcessorRequest request =
+   *       DeleteProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.deleteProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteProcessorCallable() { + return stub.deleteProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   EnableProcessorResponse response =
+   *       documentProcessorServiceClient.enableProcessorAsync(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 + enableProcessorAsync(EnableProcessorRequest request) { + return enableProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.enableProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   EnableProcessorResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable() { + return stub.enableProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EnableProcessorRequest request =
+   *       EnableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.enableProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable enableProcessorCallable() { + return stub.enableProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
+   *       DisableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   DisableProcessorResponse response =
+   *       documentProcessorServiceClient.disableProcessorAsync(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 + disableProcessorAsync(DisableProcessorRequest request) { + return disableProcessorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
+   *       DisableProcessorRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.disableProcessorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   DisableProcessorResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return stub.disableProcessorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a processor + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   DisableProcessorRequest request =
    *       DisableProcessorRequest.newBuilder()
    *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
    *           .build();
-   *   DisableProcessorResponse response =
-   *       documentProcessorServiceClient.disableProcessorAsync(request).get();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.disableProcessorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable disableProcessorCallable() { + return stub.disableProcessorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] + * that will be used in + * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   SetDefaultProcessorVersionRequest request =
+   *       SetDefaultProcessorVersionRequest.newBuilder()
+   *           .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDefaultProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   SetDefaultProcessorVersionResponse response =
+   *       documentProcessorServiceClient.setDefaultProcessorVersionAsync(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 - disableProcessorAsync(DisableProcessorRequest request) { - return disableProcessorOperationCallable().futureCall(request); + public final OperationFuture< + SetDefaultProcessorVersionResponse, SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionAsync(SetDefaultProcessorVersionRequest request) { + return setDefaultProcessorVersionOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Disables a processor + * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] + * that will be used in + * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. * *

Sample code: * @@ -1107,26 +2234,38 @@ public final UnaryCallable enableProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DisableProcessorRequest request = - * DisableProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * SetDefaultProcessorVersionRequest request = + * SetDefaultProcessorVersionRequest.newBuilder() + * .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * .setDefaultProcessorVersion( + * ProcessorVersionName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + * .toString()) * .build(); - * OperationFuture future = - * documentProcessorServiceClient.disableProcessorOperationCallable().futureCall(request); + * OperationFuture + * future = + * documentProcessorServiceClient + * .setDefaultProcessorVersionOperationCallable() + * .futureCall(request); * // Do something. - * DisableProcessorResponse response = future.get(); + * SetDefaultProcessorVersionResponse response = future.get(); * } * } */ public final OperationCallable< - DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> - disableProcessorOperationCallable() { - return stub.disableProcessorOperationCallable(); + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return stub.setDefaultProcessorVersionOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Disables a processor + * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] + * that will be used in + * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and + * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. * *

Sample code: * @@ -1135,19 +2274,24 @@ public final UnaryCallable enableProcessorCal * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * DisableProcessorRequest request = - * DisableProcessorRequest.newBuilder() - * .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * SetDefaultProcessorVersionRequest request = + * SetDefaultProcessorVersionRequest.newBuilder() + * .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + * .setDefaultProcessorVersion( + * ProcessorVersionName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + * .toString()) * .build(); * ApiFuture future = - * documentProcessorServiceClient.disableProcessorCallable().futureCall(request); + * documentProcessorServiceClient.setDefaultProcessorVersionCallable().futureCall(request); * // Do something. * Operation response = future.get(); * } * } */ - public final UnaryCallable disableProcessorCallable() { - return stub.disableProcessorCallable(); + public final UnaryCallable + setDefaultProcessorVersionCallable() { + return stub.setDefaultProcessorVersionCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. @@ -1230,6 +2374,7 @@ public final UnaryCallable disableProcessorC * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) * .setEnableSchemaValidation(true) + * .setDocumentSchema(DocumentSchema.newBuilder().build()) * .build(); * ReviewDocumentResponse response = * documentProcessorServiceClient.reviewDocumentAsync(request).get(); @@ -1262,6 +2407,7 @@ public final UnaryCallable disableProcessorC * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) * .setEnableSchemaValidation(true) + * .setDocumentSchema(DocumentSchema.newBuilder().build()) * .build(); * OperationFuture future = * documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request); @@ -1294,6 +2440,7 @@ public final UnaryCallable disableProcessorC * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) * .setEnableSchemaValidation(true) + * .setDocumentSchema(DocumentSchema.newBuilder().build()) * .build(); * ApiFuture future = * documentProcessorServiceClient.reviewDocumentCallable().futureCall(request); @@ -1306,6 +2453,153 @@ public final UnaryCallable reviewDocumentCalla return stub.reviewDocumentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : documentProcessorServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         documentProcessorServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = documentProcessorServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -1336,6 +2630,86 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } + public static class ListProcessorTypesPagedResponse + extends AbstractPagedListResponse< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage, + ListProcessorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProcessorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProcessorTypesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProcessorTypesPagedResponse(ListProcessorTypesPage page) { + super(page, ListProcessorTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProcessorTypesPage + extends AbstractPage< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage> { + + private ListProcessorTypesPage( + PageContext context, + ListProcessorTypesResponse response) { + super(context, response); + } + + private static ListProcessorTypesPage createEmptyPage() { + return new ListProcessorTypesPage(null, null); + } + + @Override + protected ListProcessorTypesPage createPage( + PageContext context, + ListProcessorTypesResponse response) { + return new ListProcessorTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProcessorTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ProcessorType, + ListProcessorTypesPage, + ListProcessorTypesFixedSizeCollection> { + + private ListProcessorTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProcessorTypesFixedSizeCollection createEmptyCollection() { + return new ListProcessorTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListProcessorTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProcessorTypesFixedSizeCollection(pages, collectionSize); + } + } + public static class ListProcessorsPagedResponse extends AbstractPagedListResponse< ListProcessorsRequest, @@ -1411,4 +2785,164 @@ protected ListProcessorsFixedSizeCollection createCollection( return new ListProcessorsFixedSizeCollection(pages, collectionSize); } } + + public static class ListProcessorVersionsPagedResponse + extends AbstractPagedListResponse< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage, + ListProcessorVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProcessorVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProcessorVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProcessorVersionsPagedResponse(ListProcessorVersionsPage page) { + super(page, ListProcessorVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProcessorVersionsPage + extends AbstractPage< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage> { + + private ListProcessorVersionsPage( + PageContext + context, + ListProcessorVersionsResponse response) { + super(context, response); + } + + private static ListProcessorVersionsPage createEmptyPage() { + return new ListProcessorVersionsPage(null, null); + } + + @Override + protected ListProcessorVersionsPage createPage( + PageContext + context, + ListProcessorVersionsResponse response) { + return new ListProcessorVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProcessorVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ProcessorVersion, + ListProcessorVersionsPage, + ListProcessorVersionsFixedSizeCollection> { + + private ListProcessorVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProcessorVersionsFixedSizeCollection createEmptyCollection() { + return new ListProcessorVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListProcessorVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProcessorVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java index 951a2264b27..e0416c552a9 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.core.ApiFunction; @@ -32,6 +35,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.documentai.v1beta3.stub.DocumentProcessorServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -102,6 +109,13 @@ public UnaryCallSettings batchProcessDocumentsSe return ((DocumentProcessorServiceStubSettings) getStubSettings()).fetchProcessorTypesSettings(); } + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorTypesSettings(); + } + /** Returns the object with the settings used for calls to listProcessors. */ public PagedCallSettings< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> @@ -109,6 +123,75 @@ public UnaryCallSettings batchProcessDocumentsSe return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorsSettings(); } + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .listProcessorVersionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionOperationSettings(); + } + /** Returns the object with the settings used for calls to createProcessor. */ public UnaryCallSettings createProcessorSettings() { return ((DocumentProcessorServiceStubSettings) getStubSettings()).createProcessorSettings(); @@ -152,6 +235,23 @@ public UnaryCallSettings disableProcessorSet .disableProcessorOperationSettings(); } + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionOperationSettings(); + } + /** Returns the object with the settings used for calls to reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return ((DocumentProcessorServiceStubSettings) getStubSettings()).reviewDocumentSettings(); @@ -165,6 +265,17 @@ public UnaryCallSettings reviewDocumentSetting .reviewDocumentOperationSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getLocationSettings(); + } + public static final DocumentProcessorServiceSettings create( DocumentProcessorServiceStubSettings stub) throws IOException { return new DocumentProcessorServiceSettings.Builder(stub.toBuilder()).build(); @@ -305,6 +416,13 @@ public UnaryCallSettings.Builder processDocumen return getStubSettingsBuilder().fetchProcessorTypesSettings(); } + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return getStubSettingsBuilder().listProcessorTypesSettings(); + } + /** Returns the builder for the settings used for calls to listProcessors. */ public PagedCallSettings.Builder< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> @@ -312,6 +430,69 @@ public UnaryCallSettings.Builder processDocumen return getStubSettingsBuilder().listProcessorsSettings(); } + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getStubSettingsBuilder().getProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getStubSettingsBuilder().getProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return getStubSettingsBuilder().listProcessorVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return getStubSettingsBuilder().deleteProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deleteProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return getStubSettingsBuilder().deployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return getStubSettingsBuilder().undeployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().undeployProcessorVersionOperationSettings(); + } + /** Returns the builder for the settings used for calls to createProcessor. */ public UnaryCallSettings.Builder createProcessorSettings() { return getStubSettingsBuilder().createProcessorSettings(); @@ -353,6 +534,21 @@ public UnaryCallSettings.Builder enableProces return getStubSettingsBuilder().disableProcessorOperationSettings(); } + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionOperationSettings(); + } + /** Returns the builder for the settings used for calls to reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return getStubSettingsBuilder().reviewDocumentSettings(); @@ -365,6 +561,18 @@ public UnaryCallSettings.Builder reviewDocumen return getStubSettingsBuilder().reviewDocumentOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public DocumentProcessorServiceSettings build() throws IOException { return new DocumentProcessorServiceSettings(this); diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json index 31b3fba1339..1fb9b4c8975 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json @@ -19,6 +19,12 @@ "DeleteProcessor": { "methods": ["deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorOperationCallable", "deleteProcessorCallable"] }, + "DeleteProcessorVersion": { + "methods": ["deleteProcessorVersionAsync", "deleteProcessorVersionAsync", "deleteProcessorVersionAsync", "deleteProcessorVersionOperationCallable", "deleteProcessorVersionCallable"] + }, + "DeployProcessorVersion": { + "methods": ["deployProcessorVersionAsync", "deployProcessorVersionAsync", "deployProcessorVersionAsync", "deployProcessorVersionOperationCallable", "deployProcessorVersionCallable"] + }, "DisableProcessor": { "methods": ["disableProcessorAsync", "disableProcessorOperationCallable", "disableProcessorCallable"] }, @@ -28,6 +34,24 @@ "FetchProcessorTypes": { "methods": ["fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypesCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetProcessor": { + "methods": ["getProcessor", "getProcessor", "getProcessor", "getProcessorCallable"] + }, + "GetProcessorVersion": { + "methods": ["getProcessorVersion", "getProcessorVersion", "getProcessorVersion", "getProcessorVersionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListProcessorTypes": { + "methods": ["listProcessorTypes", "listProcessorTypes", "listProcessorTypes", "listProcessorTypesPagedCallable", "listProcessorTypesCallable"] + }, + "ListProcessorVersions": { + "methods": ["listProcessorVersions", "listProcessorVersions", "listProcessorVersions", "listProcessorVersionsPagedCallable", "listProcessorVersionsCallable"] + }, "ListProcessors": { "methods": ["listProcessors", "listProcessors", "listProcessors", "listProcessorsPagedCallable", "listProcessorsCallable"] }, @@ -36,6 +60,12 @@ }, "ReviewDocument": { "methods": ["reviewDocumentAsync", "reviewDocumentAsync", "reviewDocumentAsync", "reviewDocumentOperationCallable", "reviewDocumentCallable"] + }, + "SetDefaultProcessorVersion": { + "methods": ["setDefaultProcessorVersionAsync", "setDefaultProcessorVersionOperationCallable", "setDefaultProcessorVersionCallable"] + }, + "UndeployProcessorVersion": { + "methods": ["undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionOperationCallable", "undeployProcessorVersionCallable"] } } } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java index f221dacc22e..fddb83a67f4 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Document AI API + * + *

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

======================= DocumentProcessorServiceClient ======================= * @@ -31,7 +33,7 @@ * // It may require modifications to work in your environment. * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + * ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java index c327462a1e2..bed484470b6 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.core.BetaApi; @@ -28,6 +31,11 @@ import com.google.cloud.documentai.v1beta3.CreateProcessorRequest; import com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata; import com.google.cloud.documentai.v1beta3.DeleteProcessorRequest; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; @@ -36,14 +44,31 @@ import com.google.cloud.documentai.v1beta3.EnableProcessorResponse; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -86,6 +111,16 @@ public UnaryCallable batchProcessDocumentsCallab throw new UnsupportedOperationException("Not implemented: fetchProcessorTypesCallable()"); } + public UnaryCallable + listProcessorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorTypesPagedCallable()"); + } + + public UnaryCallable + listProcessorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorTypesCallable()"); + } + public UnaryCallable listProcessorsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listProcessorsPagedCallable()"); @@ -95,6 +130,62 @@ public UnaryCallable listProcesso throw new UnsupportedOperationException("Not implemented: listProcessorsCallable()"); } + public UnaryCallable getProcessorCallable() { + throw new UnsupportedOperationException("Not implemented: getProcessorCallable()"); + } + + public UnaryCallable getProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getProcessorVersionCallable()"); + } + + public UnaryCallable + listProcessorVersionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listProcessorVersionsPagedCallable()"); + } + + public UnaryCallable + listProcessorVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorVersionsCallable()"); + } + + public OperationCallable + deleteProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteProcessorVersionOperationCallable()"); + } + + public UnaryCallable deleteProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProcessorVersionCallable()"); + } + + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deployProcessorVersionOperationCallable()"); + } + + public UnaryCallable deployProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deployProcessorVersionCallable()"); + } + + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: undeployProcessorVersionOperationCallable()"); + } + + public UnaryCallable + undeployProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: undeployProcessorVersionCallable()"); + } + public UnaryCallable createProcessorCallable() { throw new UnsupportedOperationException("Not implemented: createProcessorCallable()"); } @@ -127,6 +218,21 @@ public UnaryCallable disableProcessorCallabl throw new UnsupportedOperationException("Not implemented: disableProcessorCallable()"); } + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDefaultProcessorVersionOperationCallable()"); + } + + public UnaryCallable + setDefaultProcessorVersionCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDefaultProcessorVersionCallable()"); + } + public OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable() { @@ -137,6 +243,19 @@ public UnaryCallable reviewDocumentCallable() throw new UnsupportedOperationException("Not implemented: reviewDocumentCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java index c6fa488835e..9c2f60a28b8 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.core.ApiFunction; @@ -53,6 +56,11 @@ import com.google.cloud.documentai.v1beta3.CreateProcessorRequest; import com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata; import com.google.cloud.documentai.v1beta3.DeleteProcessorRequest; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; @@ -61,14 +69,32 @@ import com.google.cloud.documentai.v1beta3.EnableProcessorResponse; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorType; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -130,9 +156,39 @@ public class DocumentProcessorServiceStubSettings batchProcessDocumentsOperationSettings; private final UnaryCallSettings fetchProcessorTypesSettings; + private final PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings; private final PagedCallSettings< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> listProcessorsSettings; + private final UnaryCallSettings getProcessorSettings; + private final UnaryCallSettings + getProcessorVersionSettings; + private final PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings; + private final UnaryCallSettings + deleteProcessorVersionSettings; + private final OperationCallSettings< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings; + private final UnaryCallSettings + deployProcessorVersionSettings; + private final OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings; + private final UnaryCallSettings + undeployProcessorVersionSettings; + private final OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings; private final UnaryCallSettings createProcessorSettings; private final UnaryCallSettings deleteProcessorSettings; private final OperationCallSettings @@ -145,10 +201,61 @@ public class DocumentProcessorServiceStubSettings private final OperationCallSettings< DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> disableProcessorOperationSettings; + private final UnaryCallSettings + setDefaultProcessorVersionSettings; + private final OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings; private final UnaryCallSettings reviewDocumentSettings; private final OperationCallSettings< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListProcessorTypesRequest, ListProcessorTypesResponse, ProcessorType> + LIST_PROCESSOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListProcessorTypesRequest, ListProcessorTypesResponse, ProcessorType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProcessorTypesRequest injectToken( + ListProcessorTypesRequest payload, String token) { + return ListProcessorTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProcessorTypesRequest injectPageSize( + ListProcessorTypesRequest payload, int pageSize) { + return ListProcessorTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProcessorTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProcessorTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProcessorTypesResponse payload) { + return payload.getProcessorTypesList() == null + ? ImmutableList.of() + : payload.getProcessorTypesList(); + } + }; private static final PagedListDescriptor LIST_PROCESSORS_PAGE_STR_DESC = @@ -187,6 +294,104 @@ public Iterable extractResources(ListProcessorsResponse payload) { } }; + private static final PagedListDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion> + LIST_PROCESSOR_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProcessorVersionsRequest injectToken( + ListProcessorVersionsRequest payload, String token) { + return ListProcessorVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProcessorVersionsRequest injectPageSize( + ListProcessorVersionsRequest payload, int pageSize) { + return ListProcessorVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProcessorVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProcessorVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListProcessorVersionsResponse payload) { + return payload.getProcessorVersionsList() == null + ? ImmutableList.of() + : payload.getProcessorVersionsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + LIST_PROCESSOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProcessorTypesRequest, + ListProcessorTypesResponse, + ListProcessorTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProcessorTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_PROCESSOR_TYPES_PAGE_STR_DESC, request, context); + return ListProcessorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> LIST_PROCESSORS_PAGE_STR_FACT = @@ -204,6 +409,47 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + LIST_PROCESSOR_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProcessorVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListProcessorVersionsRequest, ListProcessorVersionsResponse, ProcessorVersion> + pageContext = + PageContext.create( + callable, LIST_PROCESSOR_VERSIONS_PAGE_STR_DESC, request, context); + return ListProcessorVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to processDocument. */ public UnaryCallSettings processDocumentSettings() { return processDocumentSettings; @@ -226,6 +472,13 @@ public UnaryCallSettings batchProcessDocumentsSe return fetchProcessorTypesSettings; } + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return listProcessorTypesSettings; + } + /** Returns the object with the settings used for calls to listProcessors. */ public PagedCallSettings< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> @@ -233,6 +486,68 @@ public UnaryCallSettings batchProcessDocumentsSe return listProcessorsSettings; } + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return getProcessorSettings; + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return getProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return listProcessorVersionsSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return deleteProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return deleteProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return deployProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return deployProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return undeployProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return undeployProcessorVersionOperationSettings; + } + /** Returns the object with the settings used for calls to createProcessor. */ public UnaryCallSettings createProcessorSettings() { return createProcessorSettings; @@ -273,6 +588,21 @@ public UnaryCallSettings disableProcessorSet return disableProcessorOperationSettings; } + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return setDefaultProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return setDefaultProcessorVersionOperationSettings; + } + /** Returns the object with the settings used for calls to reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return reviewDocumentSettings; @@ -285,6 +615,17 @@ public UnaryCallSettings reviewDocumentSetting return reviewDocumentOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public DocumentProcessorServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -396,7 +737,20 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I batchProcessDocumentsOperationSettings = settingsBuilder.batchProcessDocumentsOperationSettings().build(); fetchProcessorTypesSettings = settingsBuilder.fetchProcessorTypesSettings().build(); + listProcessorTypesSettings = settingsBuilder.listProcessorTypesSettings().build(); listProcessorsSettings = settingsBuilder.listProcessorsSettings().build(); + getProcessorSettings = settingsBuilder.getProcessorSettings().build(); + getProcessorVersionSettings = settingsBuilder.getProcessorVersionSettings().build(); + listProcessorVersionsSettings = settingsBuilder.listProcessorVersionsSettings().build(); + deleteProcessorVersionSettings = settingsBuilder.deleteProcessorVersionSettings().build(); + deleteProcessorVersionOperationSettings = + settingsBuilder.deleteProcessorVersionOperationSettings().build(); + deployProcessorVersionSettings = settingsBuilder.deployProcessorVersionSettings().build(); + deployProcessorVersionOperationSettings = + settingsBuilder.deployProcessorVersionOperationSettings().build(); + undeployProcessorVersionSettings = settingsBuilder.undeployProcessorVersionSettings().build(); + undeployProcessorVersionOperationSettings = + settingsBuilder.undeployProcessorVersionOperationSettings().build(); createProcessorSettings = settingsBuilder.createProcessorSettings().build(); deleteProcessorSettings = settingsBuilder.deleteProcessorSettings().build(); deleteProcessorOperationSettings = settingsBuilder.deleteProcessorOperationSettings().build(); @@ -404,8 +758,14 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I enableProcessorOperationSettings = settingsBuilder.enableProcessorOperationSettings().build(); disableProcessorSettings = settingsBuilder.disableProcessorSettings().build(); disableProcessorOperationSettings = settingsBuilder.disableProcessorOperationSettings().build(); + setDefaultProcessorVersionSettings = + settingsBuilder.setDefaultProcessorVersionSettings().build(); + setDefaultProcessorVersionOperationSettings = + settingsBuilder.setDefaultProcessorVersionOperationSettings().build(); reviewDocumentSettings = settingsBuilder.reviewDocumentSettings().build(); reviewDocumentOperationSettings = settingsBuilder.reviewDocumentOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for DocumentProcessorServiceStubSettings. */ @@ -421,9 +781,39 @@ public static class Builder batchProcessDocumentsOperationSettings; private final UnaryCallSettings.Builder fetchProcessorTypesSettings; + private final PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings; private final PagedCallSettings.Builder< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> listProcessorsSettings; + private final UnaryCallSettings.Builder getProcessorSettings; + private final UnaryCallSettings.Builder + getProcessorVersionSettings; + private final PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings; + private final UnaryCallSettings.Builder + deleteProcessorVersionSettings; + private final OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder + deployProcessorVersionSettings; + private final OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder + undeployProcessorVersionSettings; + private final OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings; private final UnaryCallSettings.Builder createProcessorSettings; private final UnaryCallSettings.Builder @@ -441,11 +831,22 @@ public static class Builder private final OperationCallSettings.Builder< DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> disableProcessorOperationSettings; + private final UnaryCallSettings.Builder + setDefaultProcessorVersionSettings; + private final OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings; private final UnaryCallSettings.Builder reviewDocumentSettings; private final OperationCallSettings.Builder< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -493,7 +894,18 @@ protected Builder(ClientContext clientContext) { batchProcessDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder(); fetchProcessorTypesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProcessorTypesSettings = PagedCallSettings.newBuilder(LIST_PROCESSOR_TYPES_PAGE_STR_FACT); listProcessorsSettings = PagedCallSettings.newBuilder(LIST_PROCESSORS_PAGE_STR_FACT); + getProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProcessorVersionsSettings = + PagedCallSettings.newBuilder(LIST_PROCESSOR_VERSIONS_PAGE_STR_FACT); + deleteProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + deployProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deployProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + undeployProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeployProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); createProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteProcessorOperationSettings = OperationCallSettings.newBuilder(); @@ -501,20 +913,34 @@ protected Builder(ClientContext clientContext) { enableProcessorOperationSettings = OperationCallSettings.newBuilder(); disableProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); disableProcessorOperationSettings = OperationCallSettings.newBuilder(); + setDefaultProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); reviewDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); reviewDocumentOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( processDocumentSettings, batchProcessDocumentsSettings, fetchProcessorTypesSettings, + listProcessorTypesSettings, listProcessorsSettings, + getProcessorSettings, + getProcessorVersionSettings, + listProcessorVersionsSettings, + deleteProcessorVersionSettings, + deployProcessorVersionSettings, + undeployProcessorVersionSettings, createProcessorSettings, deleteProcessorSettings, enableProcessorSettings, disableProcessorSettings, - reviewDocumentSettings); + setDefaultProcessorVersionSettings, + reviewDocumentSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -526,7 +952,20 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { batchProcessDocumentsOperationSettings = settings.batchProcessDocumentsOperationSettings.toBuilder(); fetchProcessorTypesSettings = settings.fetchProcessorTypesSettings.toBuilder(); + listProcessorTypesSettings = settings.listProcessorTypesSettings.toBuilder(); listProcessorsSettings = settings.listProcessorsSettings.toBuilder(); + getProcessorSettings = settings.getProcessorSettings.toBuilder(); + getProcessorVersionSettings = settings.getProcessorVersionSettings.toBuilder(); + listProcessorVersionsSettings = settings.listProcessorVersionsSettings.toBuilder(); + deleteProcessorVersionSettings = settings.deleteProcessorVersionSettings.toBuilder(); + deleteProcessorVersionOperationSettings = + settings.deleteProcessorVersionOperationSettings.toBuilder(); + deployProcessorVersionSettings = settings.deployProcessorVersionSettings.toBuilder(); + deployProcessorVersionOperationSettings = + settings.deployProcessorVersionOperationSettings.toBuilder(); + undeployProcessorVersionSettings = settings.undeployProcessorVersionSettings.toBuilder(); + undeployProcessorVersionOperationSettings = + settings.undeployProcessorVersionOperationSettings.toBuilder(); createProcessorSettings = settings.createProcessorSettings.toBuilder(); deleteProcessorSettings = settings.deleteProcessorSettings.toBuilder(); deleteProcessorOperationSettings = settings.deleteProcessorOperationSettings.toBuilder(); @@ -534,20 +973,35 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { enableProcessorOperationSettings = settings.enableProcessorOperationSettings.toBuilder(); disableProcessorSettings = settings.disableProcessorSettings.toBuilder(); disableProcessorOperationSettings = settings.disableProcessorOperationSettings.toBuilder(); + setDefaultProcessorVersionSettings = settings.setDefaultProcessorVersionSettings.toBuilder(); + setDefaultProcessorVersionOperationSettings = + settings.setDefaultProcessorVersionOperationSettings.toBuilder(); reviewDocumentSettings = settings.reviewDocumentSettings.toBuilder(); reviewDocumentOperationSettings = settings.reviewDocumentOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( processDocumentSettings, batchProcessDocumentsSettings, fetchProcessorTypesSettings, + listProcessorTypesSettings, listProcessorsSettings, + getProcessorSettings, + getProcessorVersionSettings, + listProcessorVersionsSettings, + deleteProcessorVersionSettings, + deployProcessorVersionSettings, + undeployProcessorVersionSettings, createProcessorSettings, deleteProcessorSettings, enableProcessorSettings, disableProcessorSettings, - reviewDocumentSettings); + setDefaultProcessorVersionSettings, + reviewDocumentSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -592,11 +1046,46 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .listProcessorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .listProcessorsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .getProcessorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listProcessorVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deployProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .undeployProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createProcessorSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -617,11 +1106,26 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .setDefaultProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .reviewDocumentSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .batchProcessDocumentsOperationSettings() .setInitialCallSettings( @@ -646,6 +1150,83 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .deleteProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeleteProcessorVersionMetadata.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 + .deployProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + DeployProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeployProcessorVersionMetadata.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 + .undeployProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + UndeployProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UndeployProcessorVersionMetadata.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 .deleteProcessorOperationSettings() .setInitialCallSettings( @@ -718,6 +1299,33 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .setDefaultProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + SetDefaultProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + SetDefaultProcessorVersionMetadata.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 .reviewDocumentOperationSettings() .setInitialCallSettings( @@ -787,6 +1395,13 @@ public UnaryCallSettings.Builder processDocumen return fetchProcessorTypesSettings; } + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return listProcessorTypesSettings; + } + /** Returns the builder for the settings used for calls to listProcessors. */ public PagedCallSettings.Builder< ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> @@ -794,6 +1409,75 @@ public UnaryCallSettings.Builder processDocumen return listProcessorsSettings; } + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getProcessorSettings; + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return listProcessorVersionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return deleteProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return deleteProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return deployProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return deployProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return undeployProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return undeployProcessorVersionOperationSettings; + } + /** Returns the builder for the settings used for calls to createProcessor. */ public UnaryCallSettings.Builder createProcessorSettings() { return createProcessorSettings; @@ -841,6 +1525,23 @@ public UnaryCallSettings.Builder enableProces return disableProcessorOperationSettings; } + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return setDefaultProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return setDefaultProcessorVersionOperationSettings; + } + /** Returns the builder for the settings used for calls to reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return reviewDocumentSettings; @@ -855,6 +1556,18 @@ public UnaryCallSettings.Builder reviewDocumen return reviewDocumentOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public DocumentProcessorServiceStubSettings build() throws IOException { return new DocumentProcessorServiceStubSettings(this); diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java index de767205199..8ff51cc980f 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.core.BetaApi; @@ -32,6 +35,11 @@ import com.google.cloud.documentai.v1beta3.CreateProcessorRequest; import com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata; import com.google.cloud.documentai.v1beta3.DeleteProcessorRequest; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; @@ -40,14 +48,31 @@ import com.google.cloud.documentai.v1beta3.EnableProcessorResponse; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; @@ -99,6 +124,18 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt ProtoUtils.marshaller(FetchProcessorTypesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorTypesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor listProcessorsMethodDescriptor = MethodDescriptor.newBuilder() @@ -111,6 +148,72 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt ProtoUtils.marshaller(ListProcessorsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + getProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessor") + .setRequestMarshaller(ProtoUtils.marshaller(GetProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/UndeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor createProcessorMethodDescriptor = MethodDescriptor.newBuilder() @@ -155,6 +258,17 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/SetDefaultProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor reviewDocumentMethodDescriptor = MethodDescriptor.newBuilder() @@ -166,15 +280,64 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable processDocumentCallable; private final UnaryCallable batchProcessDocumentsCallable; private final OperationCallable batchProcessDocumentsOperationCallable; private final UnaryCallable fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; private final UnaryCallable listProcessorsCallable; private final UnaryCallable listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; private final UnaryCallable createProcessorCallable; private final UnaryCallable deleteProcessorCallable; private final OperationCallable @@ -187,10 +350,21 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt private final OperationCallable< DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; private final UnaryCallable reviewDocumentCallable; private final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -268,6 +442,17 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings + listProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings listProcessorsTransportSettings = GrpcCallSettings.newBuilder() @@ -279,6 +464,72 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings getProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listProcessorVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + undeployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings createProcessorTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createProcessorMethodDescriptor) @@ -319,6 +570,17 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings + setDefaultProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("processor", String.valueOf(request.getProcessor())); + return params.build(); + }) + .build(); GrpcCallSettings reviewDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(reviewDocumentMethodDescriptor) @@ -329,6 +591,26 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.processDocumentCallable = callableFactory.createUnaryCallable( @@ -349,12 +631,73 @@ protected GrpcDocumentProcessorServiceStub( fetchProcessorTypesTransportSettings, settings.fetchProcessorTypesSettings(), clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); this.listProcessorsCallable = callableFactory.createUnaryCallable( listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); this.listProcessorsPagedCallable = callableFactory.createPagedCallable( listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + operationsStub); this.createProcessorCallable = callableFactory.createUnaryCallable( createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); @@ -385,6 +728,17 @@ protected GrpcDocumentProcessorServiceStub( settings.disableProcessorOperationSettings(), clientContext, operationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + operationsStub); this.reviewDocumentCallable = callableFactory.createUnaryCallable( reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); @@ -394,6 +748,15 @@ protected GrpcDocumentProcessorServiceStub( settings.reviewDocumentOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -425,6 +788,18 @@ public UnaryCallable batchProcessDocumentsCallab return fetchProcessorTypesCallable; } + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + @Override public UnaryCallable listProcessorsCallable() { return listProcessorsCallable; @@ -436,6 +811,68 @@ public UnaryCallable listProcesso return listProcessorsPagedCallable; } + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + @Override public UnaryCallable createProcessorCallable() { return createProcessorCallable; @@ -475,6 +912,21 @@ public UnaryCallable disableProcessorCallabl return disableProcessorOperationCallable; } + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + @Override public UnaryCallable reviewDocumentCallable() { return reviewDocumentCallable; @@ -487,6 +939,22 @@ public UnaryCallable reviewDocumentCallable() return reviewDocumentOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java index 6bffd115852..48dd1579bcb 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.core.BetaApi; @@ -39,6 +42,11 @@ import com.google.cloud.documentai.v1beta3.CreateProcessorRequest; import com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata; import com.google.cloud.documentai.v1beta3.DeleteProcessorRequest; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; @@ -47,14 +55,31 @@ import com.google.cloud.documentai.v1beta3.EnableProcessorResponse; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; @@ -77,16 +102,23 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServiceStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() - .add(BatchProcessMetadata.getDescriptor()) - .add(Empty.getDescriptor()) .add(DisableProcessorMetadata.getDescriptor()) + .add(DeployProcessorVersionMetadata.getDescriptor()) .add(EnableProcessorMetadata.getDescriptor()) - .add(DeleteProcessorMetadata.getDescriptor()) - .add(ReviewDocumentResponse.getDescriptor()) - .add(EnableProcessorResponse.getDescriptor()) + .add(SetDefaultProcessorVersionMetadata.getDescriptor()) + .add(DeployProcessorVersionResponse.getDescriptor()) .add(BatchProcessResponse.getDescriptor()) + .add(UndeployProcessorVersionResponse.getDescriptor()) .add(DisableProcessorResponse.getDescriptor()) .add(ReviewDocumentOperationMetadata.getDescriptor()) + .add(BatchProcessMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(UndeployProcessorVersionMetadata.getDescriptor()) + .add(DeleteProcessorMetadata.getDescriptor()) + .add(ReviewDocumentResponse.getDescriptor()) + .add(EnableProcessorResponse.getDescriptor()) + .add(DeleteProcessorVersionMetadata.getDescriptor()) + .add(SetDefaultProcessorVersionResponse.getDescriptor()) .build(); private static final ApiMethodDescriptor @@ -107,6 +139,8 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -144,6 +178,8 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -200,6 +236,42 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .build()) .build(); + private static final ApiMethodDescriptor + listProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*}/processorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor listProcessorsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -236,6 +308,229 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .build()) .build(); + private static final ApiMethodDescriptor + getProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessor") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorVersion.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse> + listProcessorVersionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessorVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + undeployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/UndeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UndeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor createProcessorMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -390,6 +685,46 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/SetDefaultProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "processor", request.getProcessor()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearProcessor().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SetDefaultProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor reviewDocumentMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -432,15 +767,113 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable processDocumentCallable; private final UnaryCallable batchProcessDocumentsCallable; private final OperationCallable batchProcessDocumentsOperationCallable; private final UnaryCallable fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; private final UnaryCallable listProcessorsCallable; private final UnaryCallable listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; private final UnaryCallable createProcessorCallable; private final UnaryCallable deleteProcessorCallable; private final OperationCallable @@ -453,10 +886,21 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi private final OperationCallable< DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; private final UnaryCallable reviewDocumentCallable; private final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -523,12 +967,54 @@ protected HttpJsonDocumentProcessorServiceStub( .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + listProcessorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings listProcessorsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listProcessorsMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings getProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listProcessorVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + undeployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings createProcessorTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createProcessorMethodDescriptor) @@ -549,11 +1035,28 @@ protected HttpJsonDocumentProcessorServiceStub( .setMethodDescriptor(disableProcessorMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + setDefaultProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings reviewDocumentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(reviewDocumentMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); this.processDocumentCallable = callableFactory.createUnaryCallable( @@ -574,12 +1077,73 @@ protected HttpJsonDocumentProcessorServiceStub( fetchProcessorTypesTransportSettings, settings.fetchProcessorTypesSettings(), clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); this.listProcessorsCallable = callableFactory.createUnaryCallable( listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); this.listProcessorsPagedCallable = callableFactory.createPagedCallable( listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); this.createProcessorCallable = callableFactory.createUnaryCallable( createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); @@ -610,6 +1174,17 @@ protected HttpJsonDocumentProcessorServiceStub( settings.disableProcessorOperationSettings(), clientContext, httpJsonOperationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); this.reviewDocumentCallable = callableFactory.createUnaryCallable( reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); @@ -619,6 +1194,15 @@ protected HttpJsonDocumentProcessorServiceStub( settings.reviewDocumentOperationSettings(), clientContext, httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -630,12 +1214,22 @@ public static List getMethodDescriptors() { methodDescriptors.add(processDocumentMethodDescriptor); methodDescriptors.add(batchProcessDocumentsMethodDescriptor); methodDescriptors.add(fetchProcessorTypesMethodDescriptor); + methodDescriptors.add(listProcessorTypesMethodDescriptor); methodDescriptors.add(listProcessorsMethodDescriptor); + methodDescriptors.add(getProcessorMethodDescriptor); + methodDescriptors.add(getProcessorVersionMethodDescriptor); + methodDescriptors.add(listProcessorVersionsMethodDescriptor); + methodDescriptors.add(deleteProcessorVersionMethodDescriptor); + methodDescriptors.add(deployProcessorVersionMethodDescriptor); + methodDescriptors.add(undeployProcessorVersionMethodDescriptor); methodDescriptors.add(createProcessorMethodDescriptor); methodDescriptors.add(deleteProcessorMethodDescriptor); methodDescriptors.add(enableProcessorMethodDescriptor); methodDescriptors.add(disableProcessorMethodDescriptor); + methodDescriptors.add(setDefaultProcessorVersionMethodDescriptor); methodDescriptors.add(reviewDocumentMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; } @@ -665,6 +1259,18 @@ public UnaryCallable batchProcessDocumentsCallab return fetchProcessorTypesCallable; } + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + @Override public UnaryCallable listProcessorsCallable() { return listProcessorsCallable; @@ -676,6 +1282,68 @@ public UnaryCallable listProcesso return listProcessorsPagedCallable; } + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + @Override public UnaryCallable createProcessorCallable() { return createProcessorCallable; @@ -715,6 +1383,21 @@ public UnaryCallable disableProcessorCallabl return disableProcessorOperationCallable; } + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + @Override public UnaryCallable reviewDocumentCallable() { return reviewDocumentCallable; @@ -727,6 +1410,22 @@ public UnaryCallable reviewDocumentCallable() return reviewDocumentOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java index e1de51f9f06..d1f43171dee 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java @@ -16,6 +16,11 @@ package com.google.cloud.documentai.v1; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -25,10 +30,21 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1.stub.HttpJsonDocumentProcessorServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.concurrent.ExecutionException; import javax.annotation.Generated; @@ -83,7 +99,7 @@ public void processDocumentTest() throws Exception { .build(); mockService.addResponse(expectedResponse); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); ProcessResponse actualResponse = client.processDocument(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -111,7 +127,7 @@ public void processDocumentExceptionTest() throws Exception { mockService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); client.processDocument(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -175,7 +191,7 @@ public void batchProcessDocumentsTest() throws Exception { .build(); mockService.addResponse(resultOperation); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); @@ -203,7 +219,7 @@ public void batchProcessDocumentsExceptionTest() throws Exception { mockService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); client.batchProcessDocumentsAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { @@ -257,21 +273,16 @@ public void batchProcessDocumentsExceptionTest2() throws Exception { } @Test - public void reviewDocumentTest() throws Exception { - ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("reviewDocumentTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void fetchProcessorTypesTest() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) .build(); - mockService.addResponse(resultOperation); + mockService.addResponse(expectedResponse); - HumanReviewConfigName humanReviewConfig = - HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -290,37 +301,32 @@ public void reviewDocumentTest() throws Exception { } @Test - public void reviewDocumentExceptionTest() throws Exception { + public void fetchProcessorTypesExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - HumanReviewConfigName humanReviewConfig = - HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.reviewDocumentAsync(humanReviewConfig).get(); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.fetchProcessorTypes(parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { + } catch (InvalidArgumentException e) { + // Expected exception. } } @Test - public void reviewDocumentTest2() throws Exception { - ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("reviewDocumentTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void fetchProcessorTypesTest2() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) .build(); - mockService.addResponse(resultOperation); + mockService.addResponse(expectedResponse); - String humanReviewConfig = - "projects/project-1917/locations/location-1917/processors/processor-1917/humanReviewConfig"; + String parent = "projects/project-5833/locations/location-5833"; - ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -339,18 +345,1412 @@ public void reviewDocumentTest2() throws Exception { } @Test - public void reviewDocumentExceptionTest2() throws Exception { + public void fetchProcessorTypesExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String humanReviewConfig = - "projects/project-1917/locations/location-1917/processors/processor-1917/humanReviewConfig"; - client.reviewDocumentAsync(humanReviewConfig).get(); + String parent = "projects/project-5833/locations/location-5833"; + client.fetchProcessorTypes(parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest2() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorTypesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest2() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest2() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorVersionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.listProcessorVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest2() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorVersionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; + client.listProcessorVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProcessorVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + client.deleteProcessorVersionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deleteProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteProcessorVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + + client.deleteProcessorVersionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.deleteProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deployProcessorVersionTest() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deployProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deployProcessorVersionTest2() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deployProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.deployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void undeployProcessorVersionTest() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void undeployProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.undeployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void undeployProcessorVersionTest2() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void undeployProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.undeployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Processor processor = Processor.newBuilder().build(); + + Processor actualResponse = client.createProcessor(parent, processor); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Processor processor = Processor.newBuilder().build(); + client.createProcessor(parent, processor); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Processor processor = Processor.newBuilder().build(); + + Processor actualResponse = client.createProcessor(parent, processor); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createProcessorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Processor processor = Processor.newBuilder().build(); + client.createProcessor(parent, processor); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProcessorTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + client.deleteProcessorAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.deleteProcessorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteProcessorTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + + client.deleteProcessorAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteProcessorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + client.deleteProcessorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void enableProcessorTest() throws Exception { + EnableProcessorResponse expectedResponse = EnableProcessorResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("enableProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + + EnableProcessorResponse actualResponse = client.enableProcessorAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void enableProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + client.enableProcessorAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void disableProcessorTest() throws Exception { + DisableProcessorResponse expectedResponse = DisableProcessorResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("disableProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + + DisableProcessorResponse actualResponse = client.disableProcessorAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void disableProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + client.disableProcessorAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void setDefaultProcessorVersionTest() throws Exception { + SetDefaultProcessorVersionResponse expectedResponse = + SetDefaultProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setDefaultProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + + SetDefaultProcessorVersionResponse actualResponse = + client.setDefaultProcessorVersionAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setDefaultProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + client.setDefaultProcessorVersionAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void reviewDocumentTest() throws Exception { + ReviewDocumentResponse expectedResponse = + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reviewDocumentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + HumanReviewConfigName humanReviewConfig = + HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reviewDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HumanReviewConfigName humanReviewConfig = + HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void reviewDocumentTest2() throws Exception { + ReviewDocumentResponse expectedResponse = + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reviewDocumentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String humanReviewConfig = + "projects/project-1917/locations/location-1917/processors/processor-1917/humanReviewConfig"; + + ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reviewDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String humanReviewConfig = + "projects/project-1917/locations/location-1917/processors/processor-1917/humanReviewConfig"; + client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. } } } diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java index 38c49f2d791..48dbb3e79fb 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java @@ -16,6 +16,11 @@ package com.google.cloud.documentai.v1; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.testing.LocalChannelProvider; @@ -24,12 +29,22 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -44,6 +59,7 @@ @Generated("by gapic-generator-java") public class DocumentProcessorServiceClientTest { private static MockDocumentProcessorService mockDocumentProcessorService; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private DocumentProcessorServiceClient client; @@ -51,10 +67,11 @@ public class DocumentProcessorServiceClientTest { @BeforeClass public static void startStaticServer() { mockDocumentProcessorService = new MockDocumentProcessorService(); + mockLocations = new MockLocations(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockDocumentProcessorService)); + Arrays.asList(mockDocumentProcessorService, mockLocations)); mockServiceHelper.start(); } @@ -89,7 +106,7 @@ public void processDocumentTest() throws Exception { .build(); mockDocumentProcessorService.addResponse(expectedResponse); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); ProcessResponse actualResponse = client.processDocument(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -111,7 +128,7 @@ public void processDocumentExceptionTest() throws Exception { mockDocumentProcessorService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); client.processDocument(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -169,7 +186,7 @@ public void batchProcessDocumentsTest() throws Exception { .build(); mockDocumentProcessorService.addResponse(resultOperation); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); @@ -191,7 +208,7 @@ public void batchProcessDocumentsExceptionTest() throws Exception { mockDocumentProcessorService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); client.batchProcessDocumentsAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { @@ -245,28 +262,23 @@ public void batchProcessDocumentsExceptionTest2() throws Exception { } @Test - public void reviewDocumentTest() throws Exception { - ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("reviewDocumentTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void fetchProcessorTypesTest() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) .build(); - mockDocumentProcessorService.addResponse(resultOperation); + mockDocumentProcessorService.addResponse(expectedResponse); - HumanReviewConfigName humanReviewConfig = - HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ReviewDocumentRequest actualRequest = ((ReviewDocumentRequest) actualRequests.get(0)); + FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); - Assert.assertEquals(humanReviewConfig.toString(), actualRequest.getHumanReviewConfig()); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -274,44 +286,37 @@ public void reviewDocumentTest() throws Exception { } @Test - public void reviewDocumentExceptionTest() throws Exception { + public void fetchProcessorTypesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - HumanReviewConfigName humanReviewConfig = - HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.reviewDocumentAsync(humanReviewConfig).get(); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.fetchProcessorTypes(parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception. } } @Test - public void reviewDocumentTest2() throws Exception { - ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("reviewDocumentTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void fetchProcessorTypesTest2() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) .build(); - mockDocumentProcessorService.addResponse(resultOperation); + mockDocumentProcessorService.addResponse(expectedResponse); - String humanReviewConfig = "humanReviewConfig-620962169"; + String parent = "parent-995424086"; - ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ReviewDocumentRequest actualRequest = ((ReviewDocumentRequest) actualRequests.get(0)); + FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); - Assert.assertEquals(humanReviewConfig, actualRequest.getHumanReviewConfig()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -319,18 +324,1287 @@ public void reviewDocumentTest2() throws Exception { } @Test - public void reviewDocumentExceptionTest2() throws Exception { + public void fetchProcessorTypesExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - String humanReviewConfig = "humanReviewConfig-620962169"; - client.reviewDocumentAsync(humanReviewConfig).get(); + String parent = "parent-995424086"; + client.fetchProcessorTypes(parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorTypesRequest actualRequest = ((ListProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest2() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorTypesRequest actualRequest = ((ListProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest2() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorRequest actualRequest = ((GetProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorRequest actualRequest = ((GetProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorVersionRequest actualRequest = ((GetProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest2() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorVersionRequest actualRequest = ((GetProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorVersionsRequest actualRequest = + ((ListProcessorVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.listProcessorVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest2() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorVersionsRequest actualRequest = + ((ListProcessorVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProcessorVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProcessorVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + client.deleteProcessorVersionAsync(name).get(); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProcessorVersionRequest actualRequest = + ((DeleteProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deleteProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteProcessorVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteProcessorVersionAsync(name).get(); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProcessorVersionRequest actualRequest = + ((DeleteProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.deleteProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deployProcessorVersionTest() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployProcessorVersionRequest actualRequest = + ((DeployProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deployProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deployProcessorVersionTest2() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String name = "name3373707"; + + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployProcessorVersionRequest actualRequest = + ((DeployProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deployProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.deployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeployProcessorVersionTest() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployProcessorVersionRequest actualRequest = + ((UndeployProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeployProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.undeployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeployProcessorVersionTest2() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String name = "name3373707"; + + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployProcessorVersionRequest actualRequest = + ((UndeployProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeployProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.undeployProcessorVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Processor processor = Processor.newBuilder().build(); + + Processor actualResponse = client.createProcessor(parent, processor); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProcessorRequest actualRequest = ((CreateProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(processor, actualRequest.getProcessor()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Processor processor = Processor.newBuilder().build(); + client.createProcessor(parent, processor); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Processor processor = Processor.newBuilder().build(); + + Processor actualResponse = client.createProcessor(parent, processor); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProcessorRequest actualRequest = ((CreateProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(processor, actualRequest.getProcessor()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProcessorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + Processor processor = Processor.newBuilder().build(); + client.createProcessor(parent, processor); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProcessorTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + client.deleteProcessorAsync(name).get(); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProcessorRequest actualRequest = ((DeleteProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.deleteProcessorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteProcessorTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteProcessorAsync(name).get(); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProcessorRequest actualRequest = ((DeleteProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProcessorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.deleteProcessorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void enableProcessorTest() throws Exception { + EnableProcessorResponse expectedResponse = EnableProcessorResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("enableProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + + EnableProcessorResponse actualResponse = client.enableProcessorAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnableProcessorRequest actualRequest = ((EnableProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void enableProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + client.enableProcessorAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void disableProcessorTest() throws Exception { + DisableProcessorResponse expectedResponse = DisableProcessorResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("disableProcessorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + + DisableProcessorResponse actualResponse = client.disableProcessorAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DisableProcessorRequest actualRequest = ((DisableProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void disableProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + client.disableProcessorAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void setDefaultProcessorVersionTest() throws Exception { + SetDefaultProcessorVersionResponse expectedResponse = + SetDefaultProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setDefaultProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + + SetDefaultProcessorVersionResponse actualResponse = + client.setDefaultProcessorVersionAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultProcessorVersionRequest actualRequest = + ((SetDefaultProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProcessor(), actualRequest.getProcessor()); + Assert.assertEquals( + request.getDefaultProcessorVersion(), actualRequest.getDefaultProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + client.setDefaultProcessorVersionAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reviewDocumentTest() throws Exception { + ReviewDocumentResponse expectedResponse = + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reviewDocumentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + HumanReviewConfigName humanReviewConfig = + HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReviewDocumentRequest actualRequest = ((ReviewDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(humanReviewConfig.toString(), actualRequest.getHumanReviewConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reviewDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + HumanReviewConfigName humanReviewConfig = + HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reviewDocumentTest2() throws Exception { + ReviewDocumentResponse expectedResponse = + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reviewDocumentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String humanReviewConfig = "humanReviewConfig-620962169"; + + ReviewDocumentResponse actualResponse = client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReviewDocumentRequest actualRequest = ((ReviewDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(humanReviewConfig, actualRequest.getHumanReviewConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reviewDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String humanReviewConfig = "humanReviewConfig-620962169"; + client.reviewDocumentAsync(humanReviewConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. } } } diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java index 68f1c034c99..2d9c11b27c2 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java @@ -101,6 +101,303 @@ public void batchProcessDocuments( } } + @Override + public void fetchProcessorTypes( + FetchProcessorTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FetchProcessorTypesResponse) { + requests.add(request); + responseObserver.onNext(((FetchProcessorTypesResponse) 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 FetchProcessorTypes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FetchProcessorTypesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProcessorTypes( + ListProcessorTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProcessorTypesResponse) { + requests.add(request); + responseObserver.onNext(((ListProcessorTypesResponse) 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 ListProcessorTypes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProcessorTypesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProcessors( + ListProcessorsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProcessorsResponse) { + requests.add(request); + responseObserver.onNext(((ListProcessorsResponse) 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 ListProcessors, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProcessorsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getProcessor( + GetProcessorRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Processor) { + requests.add(request); + responseObserver.onNext(((Processor) 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 GetProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Processor.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getProcessorVersion( + GetProcessorVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ProcessorVersion) { + requests.add(request); + responseObserver.onNext(((ProcessorVersion) 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 GetProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ProcessorVersion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProcessorVersions( + ListProcessorVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProcessorVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListProcessorVersionsResponse) 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 ListProcessorVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProcessorVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProcessorVersion( + DeleteProcessorVersionRequest 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 DeleteProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deployProcessorVersion( + DeployProcessorVersionRequest 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 DeployProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeployProcessorVersion( + UndeployProcessorVersionRequest 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 UndeployProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createProcessor( + CreateProcessorRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Processor) { + requests.add(request); + responseObserver.onNext(((Processor) 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 CreateProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Processor.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProcessor( + DeleteProcessorRequest 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 DeleteProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void enableProcessor( + EnableProcessorRequest 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 EnableProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void disableProcessor( + DisableProcessorRequest 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 DisableProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setDefaultProcessorVersion( + SetDefaultProcessorVersionRequest 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 SetDefaultProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void reviewDocument( ReviewDocumentRequest request, StreamObserver responseObserver) { diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java new file mode 100644 index 00000000000..1cb40dfe94d --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java new file mode 100644 index 00000000000..d0f3b93f6ed --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java index 68ff6c3462e..617076b54a8 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -27,7 +30,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1beta3.stub.HttpJsonDocumentProcessorServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.Any; @@ -36,6 +44,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.concurrent.ExecutionException; import javax.annotation.Generated; @@ -91,10 +100,702 @@ public void processDocumentTest() throws Exception { .build(); mockService.addResponse(expectedResponse); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ProcessResponse actualResponse = client.processDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void processDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.processDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void processDocumentTest2() throws Exception { + ProcessResponse expectedResponse = + ProcessResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setHumanReviewOperation("humanReviewOperation1807415298") + .setHumanReviewStatus(HumanReviewStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + + ProcessResponse actualResponse = client.processDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void processDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + client.processDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchProcessDocumentsTest() throws Exception { + BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchProcessDocumentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.batchProcessDocumentsAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchProcessDocumentsTest2() throws Exception { + BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + + BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchProcessDocumentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + client.batchProcessDocumentsAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void fetchProcessorTypesTest() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchProcessorTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.fetchProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchProcessorTypesTest2() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchProcessorTypesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.fetchProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest2() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorTypesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest2() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProcessorsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - ProcessResponse actualResponse = client.processDocument(name); - Assert.assertEquals(expectedResponse, actualResponse); + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest2() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -112,15 +813,15 @@ public void processDocumentTest() throws Exception { } @Test - public void processDocumentExceptionTest() throws Exception { + public void listProcessorVersionsExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.processDocument(name); + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.listProcessorVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -128,19 +829,23 @@ public void processDocumentExceptionTest() throws Exception { } @Test - public void processDocumentTest2() throws Exception { - ProcessResponse expectedResponse = - ProcessResponse.newBuilder() - .setDocument(Document.newBuilder().build()) - .setHumanReviewOperation("humanReviewOperation1807415298") - .setHumanReviewStatus(HumanReviewStatus.newBuilder().build()) + public void listProcessorVersionsTest2() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) .build(); mockService.addResponse(expectedResponse); - String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; - ProcessResponse actualResponse = client.processDocument(name); - Assert.assertEquals(expectedResponse, actualResponse); + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -158,15 +863,15 @@ public void processDocumentTest2() throws Exception { } @Test - public void processDocumentExceptionTest2() throws Exception { + public void listProcessorVersionsExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; - client.processDocument(name); + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; + client.listProcessorVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -174,20 +879,20 @@ public void processDocumentExceptionTest2() throws Exception { } @Test - public void batchProcessDocumentsTest() throws Exception { - BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + public void deleteProcessorVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("batchProcessDocumentsTest") + .setName("deleteProcessorVersionTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteProcessorVersionAsync(name).get(); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -205,35 +910,36 @@ public void batchProcessDocumentsTest() throws Exception { } @Test - public void batchProcessDocumentsExceptionTest() throws Exception { + public void deleteProcessorVersionExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.batchProcessDocumentsAsync(name).get(); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deleteProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void batchProcessDocumentsTest2() throws Exception { - BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + public void deleteProcessorVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("batchProcessDocumentsTest") + .setName("deleteProcessorVersionTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; - BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteProcessorVersionAsync(name).get(); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -251,31 +957,37 @@ public void batchProcessDocumentsTest2() throws Exception { } @Test - public void batchProcessDocumentsExceptionTest2() throws Exception { + public void deleteProcessorVersionExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String name = "projects/project-5167/locations/location-5167/processors/processor-5167"; - client.batchProcessDocumentsAsync(name).get(); + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.deleteProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void fetchProcessorTypesTest() throws Exception { - FetchProcessorTypesResponse expectedResponse = - FetchProcessorTypesResponse.newBuilder() - .addAllProcessorTypes(new ArrayList()) + public void deployProcessorVersionTest() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockService.addResponse(expectedResponse); + mockService.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -294,32 +1006,37 @@ public void fetchProcessorTypesTest() throws Exception { } @Test - public void fetchProcessorTypesExceptionTest() throws Exception { + public void deployProcessorVersionExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.fetchProcessorTypes(parent); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deployProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @Test - public void fetchProcessorTypesTest2() throws Exception { - FetchProcessorTypesResponse expectedResponse = - FetchProcessorTypesResponse.newBuilder() - .addAllProcessorTypes(new ArrayList()) + public void deployProcessorVersionTest2() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockService.addResponse(expectedResponse); + mockService.addResponse(resultOperation); - String parent = "projects/project-5833/locations/location-5833"; + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; - FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -338,39 +1055,39 @@ public void fetchProcessorTypesTest2() throws Exception { } @Test - public void fetchProcessorTypesExceptionTest2() throws Exception { + public void deployProcessorVersionExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String parent = "projects/project-5833/locations/location-5833"; - client.fetchProcessorTypes(parent); + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.deployProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @Test - public void listProcessorsTest() throws Exception { - Processor responsesElement = Processor.newBuilder().build(); - ListProcessorsResponse expectedResponse = - ListProcessorsResponse.newBuilder() - .setNextPageToken("") - .addAllProcessors(Arrays.asList(responsesElement)) + public void undeployProcessorVersionTest() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + mockService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -388,39 +1105,39 @@ public void listProcessorsTest() throws Exception { } @Test - public void listProcessorsExceptionTest() throws Exception { + public void undeployProcessorVersionExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listProcessors(parent); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.undeployProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @Test - public void listProcessorsTest2() throws Exception { - Processor responsesElement = Processor.newBuilder().build(); - ListProcessorsResponse expectedResponse = - ListProcessorsResponse.newBuilder() - .setNextPageToken("") - .addAllProcessors(Arrays.asList(responsesElement)) + public void undeployProcessorVersionTest2() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + mockService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -438,18 +1155,18 @@ public void listProcessorsTest2() throws Exception { } @Test - public void listProcessorsExceptionTest2() throws Exception { + public void undeployProcessorVersionExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String parent = "projects/project-5833/locations/location-5833"; - client.listProcessors(parent); + String name = + "projects/project-1178/locations/location-1178/processors/processor-1178/processorVersions/processorVersion-1178"; + client.undeployProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @@ -460,7 +1177,10 @@ public void createProcessorTest() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setType("type3575610") .setDisplayName("displayName1714148973") - .setDefaultProcessorVersion("defaultProcessorVersion-1428555705") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) .setProcessEndpoint("processEndpoint-891502300") .setCreateTime(Timestamp.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") @@ -512,7 +1232,10 @@ public void createProcessorTest2() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setType("type3575610") .setDisplayName("displayName1714148973") - .setDefaultProcessorVersion("defaultProcessorVersion-1428555705") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) .setProcessEndpoint("processEndpoint-891502300") .setCreateTime(Timestamp.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") @@ -751,10 +1474,75 @@ public void disableProcessorExceptionTest() throws Exception { } } + @Test + public void setDefaultProcessorVersionTest() throws Exception { + SetDefaultProcessorVersionResponse expectedResponse = + SetDefaultProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setDefaultProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + + SetDefaultProcessorVersionResponse actualResponse = + client.setDefaultProcessorVersionAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setDefaultProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + client.setDefaultProcessorVersionAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void reviewDocumentTest() throws Exception { ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); Operation resultOperation = Operation.newBuilder() .setName("reviewDocumentTest") @@ -803,7 +1591,10 @@ public void reviewDocumentExceptionTest() throws Exception { @Test public void reviewDocumentTest2() throws Exception { ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); Operation resultOperation = Operation.newBuilder() .setName("reviewDocumentTest") @@ -848,4 +1639,120 @@ public void reviewDocumentExceptionTest2() throws Exception { } catch (ExecutionException e) { } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java index 84cc7c5ac2f..bc43a4243d0 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java @@ -16,6 +16,9 @@ package com.google.cloud.documentai.v1beta3; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,6 +29,11 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; @@ -36,6 +44,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -50,6 +59,7 @@ @Generated("by gapic-generator-java") public class DocumentProcessorServiceClientTest { private static MockDocumentProcessorService mockDocumentProcessorService; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private DocumentProcessorServiceClient client; @@ -57,10 +67,11 @@ public class DocumentProcessorServiceClientTest { @BeforeClass public static void startStaticServer() { mockDocumentProcessorService = new MockDocumentProcessorService(); + mockLocations = new MockLocations(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockDocumentProcessorService)); + Arrays.asList(mockDocumentProcessorService, mockLocations)); mockServiceHelper.start(); } @@ -96,16 +107,629 @@ public void processDocumentTest() throws Exception { .build(); mockDocumentProcessorService.addResponse(expectedResponse); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ProcessResponse actualResponse = client.processDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ProcessRequest actualRequest = ((ProcessRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void processDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.processDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void processDocumentTest2() throws Exception { + ProcessResponse expectedResponse = + ProcessResponse.newBuilder() + .setDocument(Document.newBuilder().build()) + .setHumanReviewOperation("humanReviewOperation1807415298") + .setHumanReviewStatus(HumanReviewStatus.newBuilder().build()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + ProcessResponse actualResponse = client.processDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ProcessRequest actualRequest = ((ProcessRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void processDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.processDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchProcessDocumentsTest() throws Exception { + BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchProcessRequest actualRequest = ((BatchProcessRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchProcessDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.batchProcessDocumentsAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchProcessDocumentsTest2() throws Exception { + BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String name = "name3373707"; + + BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchProcessRequest actualRequest = ((BatchProcessRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchProcessDocumentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.batchProcessDocumentsAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void fetchProcessorTypesTest() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchProcessorTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.fetchProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchProcessorTypesTest2() throws Exception { + FetchProcessorTypesResponse expectedResponse = + FetchProcessorTypesResponse.newBuilder() + .addAllProcessorTypes(new ArrayList()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchProcessorTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.fetchProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorTypesRequest actualRequest = ((ListProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorTypesTest2() throws Exception { + ProcessorType responsesElement = ProcessorType.newBuilder().build(); + ListProcessorTypesResponse expectedResponse = + ListProcessorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorTypes(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProcessorTypesPagedResponse pagedListResponse = client.listProcessorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorTypesList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorTypesRequest actualRequest = ((ListProcessorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProcessorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorsTest2() throws Exception { + Processor responsesElement = Processor.newBuilder().build(); + ListProcessorsResponse expectedResponse = + ListProcessorsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessors(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProcessorsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProcessors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - ProcessResponse actualResponse = client.processDocument(name); + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorRequest actualRequest = ((GetProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorTest2() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setProcessEndpoint("processEndpoint-891502300") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + Processor actualResponse = client.getProcessor(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorRequest actualRequest = ((GetProcessorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.getProcessor(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ProcessorVersion actualResponse = client.getProcessorVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProcessorVersionRequest actualRequest = ((GetProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProcessorVersionTest2() throws Exception { + ProcessorVersion expectedResponse = + ProcessorVersion.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setGoogleManaged(true) + .setDeprecationInfo(ProcessorVersion.DeprecationInfo.newBuilder().build()) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + ProcessorVersion actualResponse = client.getProcessorVersion(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ProcessRequest actualRequest = ((ProcessRequest) actualRequests.get(0)); + GetProcessorVersionRequest actualRequest = ((GetProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.getProcessorVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProcessorVersionsTest() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProcessorVersionsRequest actualRequest = + ((ListProcessorVersionsRequest) actualRequests.get(0)); - Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -113,13 +737,13 @@ public void processDocumentTest() throws Exception { } @Test - public void processDocumentExceptionTest() throws Exception { + public void listProcessorVersionsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.processDocument(name); + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + client.listProcessorVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -127,25 +751,30 @@ public void processDocumentExceptionTest() throws Exception { } @Test - public void processDocumentTest2() throws Exception { - ProcessResponse expectedResponse = - ProcessResponse.newBuilder() - .setDocument(Document.newBuilder().build()) - .setHumanReviewOperation("humanReviewOperation1807415298") - .setHumanReviewStatus(HumanReviewStatus.newBuilder().build()) + public void listProcessorVersionsTest2() throws Exception { + ProcessorVersion responsesElement = ProcessorVersion.newBuilder().build(); + ListProcessorVersionsResponse expectedResponse = + ListProcessorVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllProcessorVersions(Arrays.asList(responsesElement)) .build(); mockDocumentProcessorService.addResponse(expectedResponse); - String name = "name3373707"; + String parent = "parent-995424086"; - ProcessResponse actualResponse = client.processDocument(name); - Assert.assertEquals(expectedResponse, actualResponse); + ListProcessorVersionsPagedResponse pagedListResponse = client.listProcessorVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProcessorVersionsList().get(0), resources.get(0)); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ProcessRequest actualRequest = ((ProcessRequest) actualRequests.get(0)); + ListProcessorVersionsRequest actualRequest = + ((ListProcessorVersionsRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -153,13 +782,13 @@ public void processDocumentTest2() throws Exception { } @Test - public void processDocumentExceptionTest2() throws Exception { + public void listProcessorVersionsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - String name = "name3373707"; - client.processDocument(name); + String parent = "parent-995424086"; + client.listProcessorVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -167,24 +796,25 @@ public void processDocumentExceptionTest2() throws Exception { } @Test - public void batchProcessDocumentsTest() throws Exception { - BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + public void deleteProcessorVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("batchProcessDocumentsTest") + .setName("deleteProcessorVersionTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockDocumentProcessorService.addResponse(resultOperation); - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteProcessorVersionAsync(name).get(); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - BatchProcessRequest actualRequest = ((BatchProcessRequest) actualRequests.get(0)); + DeleteProcessorVersionRequest actualRequest = + ((DeleteProcessorVersionRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -194,13 +824,14 @@ public void batchProcessDocumentsTest() throws Exception { } @Test - public void batchProcessDocumentsExceptionTest() throws Exception { + public void deleteProcessorVersionExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); - client.batchProcessDocumentsAsync(name).get(); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deleteProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -210,11 +841,11 @@ public void batchProcessDocumentsExceptionTest() throws Exception { } @Test - public void batchProcessDocumentsTest2() throws Exception { - BatchProcessResponse expectedResponse = BatchProcessResponse.newBuilder().build(); + public void deleteProcessorVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("batchProcessDocumentsTest") + .setName("deleteProcessorVersionTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); @@ -222,12 +853,12 @@ public void batchProcessDocumentsTest2() throws Exception { String name = "name3373707"; - BatchProcessResponse actualResponse = client.batchProcessDocumentsAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteProcessorVersionAsync(name).get(); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - BatchProcessRequest actualRequest = ((BatchProcessRequest) actualRequests.get(0)); + DeleteProcessorVersionRequest actualRequest = + ((DeleteProcessorVersionRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -237,13 +868,13 @@ public void batchProcessDocumentsTest2() throws Exception { } @Test - public void batchProcessDocumentsExceptionTest2() throws Exception { + public void deleteProcessorVersionExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { String name = "name3373707"; - client.batchProcessDocumentsAsync(name).get(); + client.deleteProcessorVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -253,23 +884,29 @@ public void batchProcessDocumentsExceptionTest2() throws Exception { } @Test - public void fetchProcessorTypesTest() throws Exception { - FetchProcessorTypesResponse expectedResponse = - FetchProcessorTypesResponse.newBuilder() - .addAllProcessorTypes(new ArrayList()) + public void deployProcessorVersionTest() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockDocumentProcessorService.addResponse(expectedResponse); + mockDocumentProcessorService.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); + DeployProcessorVersionRequest actualRequest = + ((DeployProcessorVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -277,37 +914,45 @@ public void fetchProcessorTypesTest() throws Exception { } @Test - public void fetchProcessorTypesExceptionTest() throws Exception { + public void deployProcessorVersionExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.fetchProcessorTypes(parent); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.deployProcessorVersionAsync(name).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 fetchProcessorTypesTest2() throws Exception { - FetchProcessorTypesResponse expectedResponse = - FetchProcessorTypesResponse.newBuilder() - .addAllProcessorTypes(new ArrayList()) + public void deployProcessorVersionTest2() throws Exception { + DeployProcessorVersionResponse expectedResponse = + DeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockDocumentProcessorService.addResponse(expectedResponse); + mockDocumentProcessorService.addResponse(resultOperation); - String parent = "parent-995424086"; + String name = "name3373707"; - FetchProcessorTypesResponse actualResponse = client.fetchProcessorTypes(parent); + DeployProcessorVersionResponse actualResponse = client.deployProcessorVersionAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FetchProcessorTypesRequest actualRequest = ((FetchProcessorTypesRequest) actualRequests.get(0)); + DeployProcessorVersionRequest actualRequest = + ((DeployProcessorVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -315,43 +960,46 @@ public void fetchProcessorTypesTest2() throws Exception { } @Test - public void fetchProcessorTypesExceptionTest2() throws Exception { + public void deployProcessorVersionExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - String parent = "parent-995424086"; - client.fetchProcessorTypes(parent); + String name = "name3373707"; + client.deployProcessorVersionAsync(name).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 listProcessorsTest() throws Exception { - Processor responsesElement = Processor.newBuilder().build(); - ListProcessorsResponse expectedResponse = - ListProcessorsResponse.newBuilder() - .setNextPageToken("") - .addAllProcessors(Arrays.asList(responsesElement)) + public void undeployProcessorVersionTest() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockDocumentProcessorService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + mockDocumentProcessorService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + UndeployProcessorVersionRequest actualRequest = + ((UndeployProcessorVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -359,43 +1007,46 @@ public void listProcessorsTest() throws Exception { } @Test - public void listProcessorsExceptionTest() throws Exception { + public void undeployProcessorVersionExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listProcessors(parent); + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.undeployProcessorVersionAsync(name).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 listProcessorsTest2() throws Exception { - Processor responsesElement = Processor.newBuilder().build(); - ListProcessorsResponse expectedResponse = - ListProcessorsResponse.newBuilder() - .setNextPageToken("") - .addAllProcessors(Arrays.asList(responsesElement)) + public void undeployProcessorVersionTest2() throws Exception { + UndeployProcessorVersionResponse expectedResponse = + UndeployProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockDocumentProcessorService.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListProcessorsPagedResponse pagedListResponse = client.listProcessors(parent); + mockDocumentProcessorService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + String name = "name3373707"; - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getProcessorsList().get(0), resources.get(0)); + UndeployProcessorVersionResponse actualResponse = + client.undeployProcessorVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockDocumentProcessorService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListProcessorsRequest actualRequest = ((ListProcessorsRequest) actualRequests.get(0)); + UndeployProcessorVersionRequest actualRequest = + ((UndeployProcessorVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -403,16 +1054,18 @@ public void listProcessorsTest2() throws Exception { } @Test - public void listProcessorsExceptionTest2() throws Exception { + public void undeployProcessorVersionExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockDocumentProcessorService.addException(exception); try { - String parent = "parent-995424086"; - client.listProcessors(parent); + String name = "name3373707"; + client.undeployProcessorVersionAsync(name).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()); } } @@ -423,7 +1076,10 @@ public void createProcessorTest() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setType("type3575610") .setDisplayName("displayName1714148973") - .setDefaultProcessorVersion("defaultProcessorVersion-1428555705") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) .setProcessEndpoint("processEndpoint-891502300") .setCreateTime(Timestamp.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") @@ -470,7 +1126,10 @@ public void createProcessorTest2() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setType("type3575610") .setDisplayName("displayName1714148973") - .setDefaultProcessorVersion("defaultProcessorVersion-1428555705") + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) .setProcessEndpoint("processEndpoint-891502300") .setCreateTime(Timestamp.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") @@ -692,10 +1351,75 @@ public void disableProcessorExceptionTest() throws Exception { } } + @Test + public void setDefaultProcessorVersionTest() throws Exception { + SetDefaultProcessorVersionResponse expectedResponse = + SetDefaultProcessorVersionResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setDefaultProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + + SetDefaultProcessorVersionResponse actualResponse = + client.setDefaultProcessorVersionAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultProcessorVersionRequest actualRequest = + ((SetDefaultProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProcessor(), actualRequest.getProcessor()); + Assert.assertEquals( + request.getDefaultProcessorVersion(), actualRequest.getDefaultProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + client.setDefaultProcessorVersionAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void reviewDocumentTest() throws Exception { ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); Operation resultOperation = Operation.newBuilder() .setName("reviewDocumentTest") @@ -741,7 +1465,10 @@ public void reviewDocumentExceptionTest() throws Exception { @Test public void reviewDocumentTest2() throws Exception { ReviewDocumentResponse expectedResponse = - ReviewDocumentResponse.newBuilder().setGcsDestination("gcsDestination-1612392329").build(); + ReviewDocumentResponse.newBuilder() + .setGcsDestination("gcsDestination-1612392329") + .setRejectionReason("rejectionReason1485905837") + .build(); Operation resultOperation = Operation.newBuilder() .setName("reviewDocumentTest") @@ -781,4 +1508,105 @@ public void reviewDocumentExceptionTest2() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java index ec085f2cc6c..2d348b26dd5 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java @@ -123,6 +123,28 @@ public void fetchProcessorTypes( } } + @Override + public void listProcessorTypes( + ListProcessorTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProcessorTypesResponse) { + requests.add(request); + responseObserver.onNext(((ListProcessorTypesResponse) 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 ListProcessorTypes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProcessorTypesResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void listProcessors( ListProcessorsRequest request, StreamObserver responseObserver) { @@ -144,6 +166,133 @@ public void listProcessors( } } + @Override + public void getProcessor( + GetProcessorRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Processor) { + requests.add(request); + responseObserver.onNext(((Processor) 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 GetProcessor, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Processor.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getProcessorVersion( + GetProcessorVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ProcessorVersion) { + requests.add(request); + responseObserver.onNext(((ProcessorVersion) 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 GetProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ProcessorVersion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProcessorVersions( + ListProcessorVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProcessorVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListProcessorVersionsResponse) 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 ListProcessorVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProcessorVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProcessorVersion( + DeleteProcessorVersionRequest 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 DeleteProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deployProcessorVersion( + DeployProcessorVersionRequest 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 DeployProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeployProcessorVersion( + UndeployProcessorVersionRequest 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 UndeployProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void createProcessor( CreateProcessorRequest request, StreamObserver responseObserver) { @@ -228,6 +377,27 @@ public void disableProcessor( } } + @Override + public void setDefaultProcessorVersion( + SetDefaultProcessorVersionRequest 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 SetDefaultProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void reviewDocument( ReviewDocumentRequest request, StreamObserver responseObserver) { diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java new file mode 100644 index 00000000000..654f980e015 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java new file mode 100644 index 00000000000..13806403469 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java index 8301f3f80de..0a13246edf2 100644 --- a/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java +++ b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java @@ -135,130 +135,1451 @@ private DocumentProcessorServiceGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> - getReviewDocumentMethod; + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ReviewDocument", - requestType = com.google.cloud.documentai.v1.ReviewDocumentRequest.class, + fullMethodName = SERVICE_NAME + '/' + "FetchProcessorTypes", + requestType = com.google.cloud.documentai.v1.FetchProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1.FetchProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod; + if ((getFetchProcessorTypesMethod = DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getFetchProcessorTypesMethod = + DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod = + getFetchProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FetchProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.FetchProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "FetchProcessorTypes")) + .build(); + } + } + } + return getFetchProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorTypes", + requestType = com.google.cloud.documentai.v1.ListProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod; + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorTypesMethod = + getListProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorTypes")) + .build(); + } + } + } + return getListProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessors", + requestType = com.google.cloud.documentai.v1.ListProcessorsRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod; + if ((getListProcessorsMethod = DocumentProcessorServiceGrpc.getListProcessorsMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorsMethod = DocumentProcessorServiceGrpc.getListProcessorsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorsMethod = + getListProcessorsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ListProcessors")) + .build(); + } + } + } + return getListProcessorsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessor", + requestType = com.google.cloud.documentai.v1.GetProcessorRequest.class, + responseType = com.google.cloud.documentai.v1.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod; + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + DocumentProcessorServiceGrpc.getGetProcessorMethod = + getGetProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessor")) + .build(); + } + } + } + return getGetProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorVersion", + requestType = com.google.cloud.documentai.v1.GetProcessorVersionRequest.class, + responseType = com.google.cloud.documentai.v1.ProcessorVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod; + if ((getGetProcessorVersionMethod = DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorVersionMethod = + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod = + getGetProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "GetProcessorVersion")) + .build(); + } + } + } + return getGetProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorVersions", + requestType = com.google.cloud.documentai.v1.ListProcessorVersionsRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod = + getListProcessorVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListProcessorVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorVersions")) + .build(); + } + } + } + return getListProcessorVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessorVersion", + requestType = com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, responseType = com.google.longrunning.Operation.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> - getReviewDocumentMethod() { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod() { io.grpc.MethodDescriptor< - com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> - getReviewDocumentMethod; - if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) == null) { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { synchronized (DocumentProcessorServiceGrpc.class) { - if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) == null) { - DocumentProcessorServiceGrpc.getReviewDocumentMethod = - getReviewDocumentMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod = + getDeleteProcessorVersionMethod = io.grpc.MethodDescriptor - . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReviewDocument")) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteProcessorVersion")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.documentai.v1.ReviewDocumentRequest + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.longrunning.Operation.getDefaultInstance())) .setSchemaDescriptor( - new DocumentProcessorServiceMethodDescriptorSupplier("ReviewDocument")) + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeleteProcessorVersion")) + .build(); + } + } + } + return getDeleteProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeployProcessorVersion", + requestType = com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod = + getDeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeployProcessorVersion")) + .build(); + } + } + } + return getDeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeployProcessorVersion", + requestType = com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod = + getUndeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UndeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "UndeployProcessorVersion")) .build(); } } } - return getReviewDocumentMethod; - } + return getUndeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProcessor", + requestType = com.google.cloud.documentai.v1.CreateProcessorRequest.class, + responseType = com.google.cloud.documentai.v1.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod; + if ((getCreateProcessorMethod = DocumentProcessorServiceGrpc.getCreateProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getCreateProcessorMethod = DocumentProcessorServiceGrpc.getCreateProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getCreateProcessorMethod = + getCreateProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.CreateProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("CreateProcessor")) + .build(); + } + } + } + return getCreateProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessor", + requestType = com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod; + if ((getDeleteProcessorMethod = DocumentProcessorServiceGrpc.getDeleteProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeleteProcessorMethod = DocumentProcessorServiceGrpc.getDeleteProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getDeleteProcessorMethod = + getDeleteProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DeleteProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("DeleteProcessor")) + .build(); + } + } + } + return getDeleteProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EnableProcessor", + requestType = com.google.cloud.documentai.v1.EnableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod; + if ((getEnableProcessorMethod = DocumentProcessorServiceGrpc.getEnableProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getEnableProcessorMethod = DocumentProcessorServiceGrpc.getEnableProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getEnableProcessorMethod = + getEnableProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EnableProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.EnableProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("EnableProcessor")) + .build(); + } + } + } + return getEnableProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, com.google.longrunning.Operation> + getDisableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DisableProcessor", + requestType = com.google.cloud.documentai.v1.DisableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, com.google.longrunning.Operation> + getDisableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, + com.google.longrunning.Operation> + getDisableProcessorMethod; + if ((getDisableProcessorMethod = DocumentProcessorServiceGrpc.getDisableProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDisableProcessorMethod = DocumentProcessorServiceGrpc.getDisableProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getDisableProcessorMethod = + getDisableProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DisableProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DisableProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("DisableProcessor")) + .build(); + } + } + } + return getDisableProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultProcessorVersion", + requestType = com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod = + getSetDefaultProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SetDefaultProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "SetDefaultProcessorVersion")) + .build(); + } + } + } + return getSetDefaultProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReviewDocument", + requestType = com.google.cloud.documentai.v1.ReviewDocumentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod; + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) + == null) { + DocumentProcessorServiceGrpc.getReviewDocumentMethod = + getReviewDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReviewDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ReviewDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ReviewDocument")) + .build(); + } + } + } + return getReviewDocumentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentProcessorServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + }; + return DocumentProcessorServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentProcessorServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + }; + return DocumentProcessorServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentProcessorServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceFutureStub(channel, callOptions); + } + }; + return DocumentProcessorServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to call Cloud DocumentAI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public abstract static class DocumentProcessorServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getProcessDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchProcessDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public void listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public void listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public void deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public void deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public void undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a processor from the type processor that the user chose.
+     * The processor will be at "ENABLED" state by default after its creation.
+     * 
+ */ + public void createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public void deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public void enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEnableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public void disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDisableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public void reviewDocument( + com.google.cloud.documentai.v1.ReviewDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReviewDocumentMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getProcessDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ProcessRequest, + com.google.cloud.documentai.v1.ProcessResponse>( + this, METHODID_PROCESS_DOCUMENT))) + .addMethod( + getBatchProcessDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.BatchProcessRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_PROCESS_DOCUMENTS))) + .addMethod( + getFetchProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse>( + this, METHODID_FETCH_PROCESSOR_TYPES))) + .addMethod( + getListProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse>( + this, METHODID_LIST_PROCESSOR_TYPES))) + .addMethod( + getListProcessorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse>( + this, METHODID_LIST_PROCESSORS))) + .addMethod( + getGetProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor>(this, METHODID_GET_PROCESSOR))) + .addMethod( + getGetProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion>( + this, METHODID_GET_PROCESSOR_VERSION))) + .addMethod( + getListProcessorVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse>( + this, METHODID_LIST_PROCESSOR_VERSIONS))) + .addMethod( + getDeleteProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_PROCESSOR_VERSION))) + .addMethod( + getDeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_DEPLOY_PROCESSOR_VERSION))) + .addMethod( + getUndeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_UNDEPLOY_PROCESSOR_VERSION))) + .addMethod( + getCreateProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor>(this, METHODID_CREATE_PROCESSOR))) + .addMethod( + getDeleteProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeleteProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_PROCESSOR))) + .addMethod( + getEnableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.EnableProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_ENABLE_PROCESSOR))) + .addMethod( + getDisableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DisableProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_DISABLE_PROCESSOR))) + .addMethod( + getSetDefaultProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation>( + this, METHODID_SET_DEFAULT_PROCESSOR_VERSION))) + .addMethod( + getReviewDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ReviewDocumentRequest, + com.google.longrunning.Operation>(this, METHODID_REVIEW_DOCUMENT))) + .build(); + } + } + + /** + * + * + *
+   * Service to call Cloud DocumentAI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public void listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public void listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public void deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } - /** Creates a new async stub that supports all call types for the service */ - public static DocumentProcessorServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public DocumentProcessorServiceStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceStub(channel, callOptions); - } - }; - return DocumentProcessorServiceStub.newStub(factory, channel); - } + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public void deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static DocumentProcessorServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public DocumentProcessorServiceBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceBlockingStub(channel, callOptions); - } - }; - return DocumentProcessorServiceBlockingStub.newStub(factory, channel); - } + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public void undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static DocumentProcessorServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public DocumentProcessorServiceFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceFutureStub(channel, callOptions); - } - }; - return DocumentProcessorServiceFutureStub.newStub(factory, channel); - } + /** + * + * + *
+     * Creates a processor from the type processor that the user chose.
+     * The processor will be at "ENABLED" state by default after its creation.
+     * 
+ */ + public void createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProcessorMethod(), getCallOptions()), + request, + responseObserver); + } - /** - * - * - *
-   * Service to call Cloud DocumentAI to process documents according to the
-   * processor's definition. Processors are built using state-of-the-art Google
-   * AI such as natural language, computer vision, and translation to extract
-   * structured information from unstructured or semi-structured documents.
-   * 
- */ - public abstract static class DocumentProcessorServiceImplBase implements io.grpc.BindableService { + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public void deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorMethod(), getCallOptions()), + request, + responseObserver); + } /** * * *
-     * Processes a single document.
+     * Enables a processor
      * 
*/ - public void processDocument( - com.google.cloud.documentai.v1.ProcessRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getProcessDocumentMethod(), responseObserver); + public void enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnableProcessorMethod(), getCallOptions()), + request, + responseObserver); } /** * * *
-     * LRO endpoint to batch process many documents. The output is written
-     * to Cloud Storage as JSON in the [Document] format.
+     * Disables a processor
      * 
*/ - public void batchProcessDocuments( - com.google.cloud.documentai.v1.BatchProcessRequest request, + public void disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getBatchProcessDocumentsMethod(), responseObserver); + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); } /** @@ -272,33 +1593,10 @@ public void batchProcessDocuments( public void reviewDocument( com.google.cloud.documentai.v1.ReviewDocumentRequest request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getReviewDocumentMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getProcessDocumentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.documentai.v1.ProcessRequest, - com.google.cloud.documentai.v1.ProcessResponse>( - this, METHODID_PROCESS_DOCUMENT))) - .addMethod( - getBatchProcessDocumentsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.documentai.v1.BatchProcessRequest, - com.google.longrunning.Operation>(this, METHODID_BATCH_PROCESS_DOCUMENTS))) - .addMethod( - getReviewDocumentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.documentai.v1.ReviewDocumentRequest, - com.google.longrunning.Operation>(this, METHODID_REVIEW_DOCUMENT))) - .build(); + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), + request, + responseObserver); } } @@ -312,118 +1610,232 @@ public final io.grpc.ServerServiceDefinition bindService() { * structured information from unstructured or semi-structured documents. * */ - public static final class DocumentProcessorServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + public static final class DocumentProcessorServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentProcessorServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } - @java.lang.Override - protected DocumentProcessorServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceStub(channel, callOptions); + @java.lang.Override + protected DocumentProcessorServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.cloud.documentai.v1.ProcessResponse processDocument( + com.google.cloud.documentai.v1.ProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
+     * 
+ */ + public com.google.cloud.documentai.v1.FetchProcessorTypesResponse fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorTypesResponse listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorsResponse listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.cloud.documentai.v1.Processor getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorVersionsResponse listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorVersionMethod(), getCallOptions(), request); } /** * * *
-     * Processes a single document.
+     * Deploys the processor version.
      * 
*/ - public void processDocument( - com.google.cloud.documentai.v1.ProcessRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), - request, - responseObserver); + public com.google.longrunning.Operation deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeployProcessorVersionMethod(), getCallOptions(), request); } /** * * *
-     * LRO endpoint to batch process many documents. The output is written
-     * to Cloud Storage as JSON in the [Document] format.
+     * Undeploys the processor version.
      * 
*/ - public void batchProcessDocuments( - com.google.cloud.documentai.v1.BatchProcessRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), - request, - responseObserver); + public com.google.longrunning.Operation undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeployProcessorVersionMethod(), getCallOptions(), request); } /** * * *
-     * Send a document for Human Review. The input document should be processed by
-     * the specified processor.
+     * Creates a processor from the type processor that the user chose.
+     * The processor will be at "ENABLED" state by default after its creation.
      * 
*/ - public void reviewDocument( - com.google.cloud.documentai.v1.ReviewDocumentRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), - request, - responseObserver); + public com.google.cloud.documentai.v1.Processor createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateProcessorMethod(), getCallOptions(), request); } - } - /** - * - * - *
-   * Service to call Cloud DocumentAI to process documents according to the
-   * processor's definition. Processors are built using state-of-the-art Google
-   * AI such as natural language, computer vision, and translation to extract
-   * structured information from unstructured or semi-structured documents.
-   * 
- */ - public static final class DocumentProcessorServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private DocumentProcessorServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorMethod(), getCallOptions(), request); } - @java.lang.Override - protected DocumentProcessorServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceBlockingStub(channel, callOptions); + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public com.google.longrunning.Operation enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnableProcessorMethod(), getCallOptions(), request); } /** * * *
-     * Processes a single document.
+     * Disables a processor
      * 
*/ - public com.google.cloud.documentai.v1.ProcessResponse processDocument( - com.google.cloud.documentai.v1.ProcessRequest request) { + public com.google.longrunning.Operation disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + getChannel(), getDisableProcessorMethod(), getCallOptions(), request); } /** * * *
-     * LRO endpoint to batch process many documents. The output is written
-     * to Cloud Storage as JSON in the [Document] format.
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
      * 
*/ - public com.google.longrunning.Operation batchProcessDocuments( - com.google.cloud.documentai.v1.BatchProcessRequest request) { + public com.google.longrunning.Operation setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + getChannel(), getSetDefaultProcessorVersionMethod(), getCallOptions(), request); } /** @@ -492,6 +1904,205 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + fetchProcessorTypes(com.google.cloud.documentai.v1.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + listProcessorTypes(com.google.cloud.documentai.v1.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorsResponse> + listProcessors(com.google.cloud.documentai.v1.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.Processor> + getProcessor(com.google.cloud.documentai.v1.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ProcessorVersion> + getProcessorVersion(com.google.cloud.documentai.v1.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + listProcessorVersions(com.google.cloud.documentai.v1.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a processor from the type processor that the user chose.
+     * The processor will be at "ENABLED" state by default after its creation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.Processor> + createProcessor(com.google.cloud.documentai.v1.CreateProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessor(com.google.cloud.documentai.v1.DeleteProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + enableProcessor(com.google.cloud.documentai.v1.EnableProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEnableProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + disableProcessor(com.google.cloud.documentai.v1.DisableProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), request); + } + /** * * @@ -509,7 +2120,21 @@ protected DocumentProcessorServiceFutureStub build( private static final int METHODID_PROCESS_DOCUMENT = 0; private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 1; - private static final int METHODID_REVIEW_DOCUMENT = 2; + private static final int METHODID_FETCH_PROCESSOR_TYPES = 2; + private static final int METHODID_LIST_PROCESSOR_TYPES = 3; + private static final int METHODID_LIST_PROCESSORS = 4; + private static final int METHODID_GET_PROCESSOR = 5; + private static final int METHODID_GET_PROCESSOR_VERSION = 6; + private static final int METHODID_LIST_PROCESSOR_VERSIONS = 7; + private static final int METHODID_DELETE_PROCESSOR_VERSION = 8; + private static final int METHODID_DEPLOY_PROCESSOR_VERSION = 9; + private static final int METHODID_UNDEPLOY_PROCESSOR_VERSION = 10; + private static final int METHODID_CREATE_PROCESSOR = 11; + private static final int METHODID_DELETE_PROCESSOR = 12; + private static final int METHODID_ENABLE_PROCESSOR = 13; + private static final int METHODID_DISABLE_PROCESSOR = 14; + private static final int METHODID_SET_DEFAULT_PROCESSOR_VERSION = 15; + private static final int METHODID_REVIEW_DOCUMENT = 16; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -539,6 +2164,86 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.documentai.v1.BatchProcessRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_FETCH_PROCESSOR_TYPES: + serviceImpl.fetchProcessorTypes( + (com.google.cloud.documentai.v1.FetchProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.FetchProcessorTypesResponse>) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_TYPES: + serviceImpl.listProcessorTypes( + (com.google.cloud.documentai.v1.ListProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.ListProcessorTypesResponse>) + responseObserver); + break; + case METHODID_LIST_PROCESSORS: + serviceImpl.listProcessors( + (com.google.cloud.documentai.v1.ListProcessorsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PROCESSOR: + serviceImpl.getProcessor( + (com.google.cloud.documentai.v1.GetProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PROCESSOR_VERSION: + serviceImpl.getProcessorVersion( + (com.google.cloud.documentai.v1.GetProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_VERSIONS: + serviceImpl.listProcessorVersions( + (com.google.cloud.documentai.v1.ListProcessorVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.ListProcessorVersionsResponse>) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR_VERSION: + serviceImpl.deleteProcessorVersion( + (com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_PROCESSOR_VERSION: + serviceImpl.deployProcessorVersion( + (com.google.cloud.documentai.v1.DeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_PROCESSOR_VERSION: + serviceImpl.undeployProcessorVersion( + (com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PROCESSOR: + serviceImpl.createProcessor( + (com.google.cloud.documentai.v1.CreateProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR: + serviceImpl.deleteProcessor( + (com.google.cloud.documentai.v1.DeleteProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ENABLE_PROCESSOR: + serviceImpl.enableProcessor( + (com.google.cloud.documentai.v1.EnableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_PROCESSOR: + serviceImpl.disableProcessor( + (com.google.cloud.documentai.v1.DisableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_DEFAULT_PROCESSOR_VERSION: + serviceImpl.setDefaultProcessorVersion( + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_REVIEW_DOCUMENT: serviceImpl.reviewDocument( (com.google.cloud.documentai.v1.ReviewDocumentRequest) request, @@ -610,6 +2315,20 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new DocumentProcessorServiceFileDescriptorSupplier()) .addMethod(getProcessDocumentMethod()) .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getFetchProcessorTypesMethod()) + .addMethod(getListProcessorTypesMethod()) + .addMethod(getListProcessorsMethod()) + .addMethod(getGetProcessorMethod()) + .addMethod(getGetProcessorVersionMethod()) + .addMethod(getListProcessorVersionsMethod()) + .addMethod(getDeleteProcessorVersionMethod()) + .addMethod(getDeployProcessorVersionMethod()) + .addMethod(getUndeployProcessorVersionMethod()) + .addMethod(getCreateProcessorMethod()) + .addMethod(getDeleteProcessorMethod()) + .addMethod(getEnableProcessorMethod()) + .addMethod(getDisableProcessorMethod()) + .addMethod(getSetDefaultProcessorVersionMethod()) .addMethod(getReviewDocumentMethod()) .build(); } diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java index 4c967e9f8c8..6cd9101920e 100644 --- a/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java +++ b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java @@ -190,6 +190,56 @@ private DocumentProcessorServiceGrpc() {} return getFetchProcessorTypesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorTypes", + requestType = com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod; + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorTypesMethod = + getListProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorTypes")) + .build(); + } + } + } + return getListProcessorTypesMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta3.ListProcessorsRequest, com.google.cloud.documentai.v1beta3.ListProcessorsResponse> @@ -238,6 +288,313 @@ private DocumentProcessorServiceGrpc() {} return getListProcessorsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessor", + requestType = com.google.cloud.documentai.v1beta3.GetProcessorRequest.class, + responseType = com.google.cloud.documentai.v1beta3.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod; + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + DocumentProcessorServiceGrpc.getGetProcessorMethod = + getGetProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessor")) + .build(); + } + } + } + return getGetProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ProcessorVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod; + if ((getGetProcessorVersionMethod = DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorVersionMethod = + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod = + getGetProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ProcessorVersion + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "GetProcessorVersion")) + .build(); + } + } + } + return getGetProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorVersions", + requestType = com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod = + getListProcessorVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListProcessorVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorVersions")) + .build(); + } + } + } + return getListProcessorVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod = + getDeleteProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeleteProcessorVersion")) + .build(); + } + } + } + return getDeleteProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeployProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod = + getDeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeployProcessorVersion")) + .build(); + } + } + } + return getDeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeployProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod = + getUndeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UndeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "UndeployProcessorVersion")) + .build(); + } + } + } + return getUndeployProcessorVersionMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta3.CreateProcessorRequest, com.google.cloud.documentai.v1beta3.Processor> @@ -430,6 +787,58 @@ private DocumentProcessorServiceGrpc() {} return getDisableProcessorMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod = + getSetDefaultProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SetDefaultProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "SetDefaultProcessorVersion")) + .build(); + } + } + } + return getSetDefaultProcessorVersionMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta3.ReviewDocumentRequest, com.google.longrunning.Operation> @@ -564,7 +973,8 @@ public void batchProcessDocuments( * * *
-     * Fetches processor types.
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
      * 
*/ public void fetchProcessorTypes( @@ -575,6 +985,21 @@ public void fetchProcessorTypes( getFetchProcessorTypesMethod(), responseObserver); } + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorTypesMethod(), responseObserver); + } + /** * * @@ -590,6 +1015,95 @@ public void listProcessors( getListProcessorsMethod(), responseObserver); } + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public void listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public void deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public void deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public void undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeployProcessorVersionMethod(), responseObserver); + } + /** * * @@ -649,6 +1163,22 @@ public void disableProcessor( getDisableProcessorMethod(), responseObserver); } + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultProcessorVersionMethod(), responseObserver); + } + /** * * @@ -687,6 +1217,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse>( this, METHODID_FETCH_PROCESSOR_TYPES))) + .addMethod( + getListProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse>( + this, METHODID_LIST_PROCESSOR_TYPES))) .addMethod( getListProcessorsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -694,6 +1231,44 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.documentai.v1beta3.ListProcessorsRequest, com.google.cloud.documentai.v1beta3.ListProcessorsResponse>( this, METHODID_LIST_PROCESSORS))) + .addMethod( + getGetProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor>(this, METHODID_GET_PROCESSOR))) + .addMethod( + getGetProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion>( + this, METHODID_GET_PROCESSOR_VERSION))) + .addMethod( + getListProcessorVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse>( + this, METHODID_LIST_PROCESSOR_VERSIONS))) + .addMethod( + getDeleteProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_PROCESSOR_VERSION))) + .addMethod( + getDeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_DEPLOY_PROCESSOR_VERSION))) + .addMethod( + getUndeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_UNDEPLOY_PROCESSOR_VERSION))) .addMethod( getCreateProcessorMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -719,6 +1294,13 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.documentai.v1beta3.DisableProcessorRequest, com.google.longrunning.Operation>(this, METHODID_DISABLE_PROCESSOR))) + .addMethod( + getSetDefaultProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation>( + this, METHODID_SET_DEFAULT_PROCESSOR_VERSION))) .addMethod( getReviewDocumentMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -727,43 +1309,164 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.longrunning.Operation>(this, METHODID_REVIEW_DOCUMENT))) .build(); } - } + } + + /** + * + * + *
+   * Service to call Cloud DocumentAI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1beta3.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta3.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public void listProcessors( + com.google.cloud.documentai.v1beta3.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorsMethod(), getCallOptions()), + request, + responseObserver); + } - /** - * - * - *
-   * Service to call Cloud DocumentAI to process documents according to the
-   * processor's definition. Processors are built using state-of-the-art Google
-   * AI such as natural language, computer vision, and translation to extract
-   * structured information from unstructured or semi-structured documents.
-   * 
- */ - public static final class DocumentProcessorServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), + request, + responseObserver); } - @java.lang.Override - protected DocumentProcessorServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new DocumentProcessorServiceStub(channel, callOptions); + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); } /** * * *
-     * Processes a single document.
+     * Lists all versions of a processor.
      * 
*/ - public void processDocument( - com.google.cloud.documentai.v1beta3.ProcessRequest request, - io.grpc.stub.StreamObserver + public void listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), request, responseObserver); } @@ -772,15 +1475,15 @@ public void processDocument( * * *
-     * LRO endpoint to batch process many documents. The output is written
-     * to Cloud Storage as JSON in the [Document] format.
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
      * 
*/ - public void batchProcessDocuments( - com.google.cloud.documentai.v1beta3.BatchProcessRequest request, + public void deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), request, responseObserver); } @@ -789,15 +1492,14 @@ public void batchProcessDocuments( * * *
-     * Fetches processor types.
+     * Deploys the processor version.
      * 
*/ - public void fetchProcessorTypes( - com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { + public void deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), request, responseObserver); } @@ -806,15 +1508,14 @@ public void fetchProcessorTypes( * * *
-     * Lists all processors which belong to this project.
+     * Undeploys the processor version.
      * 
*/ - public void listProcessors( - com.google.cloud.documentai.v1beta3.ListProcessorsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { + public void undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListProcessorsMethod(), getCallOptions()), + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), request, responseObserver); } @@ -886,6 +1587,24 @@ public void disableProcessor( responseObserver); } + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -958,7 +1677,8 @@ public com.google.longrunning.Operation batchProcessDocuments( * * *
-     * Fetches processor types.
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
      * 
*/ public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse fetchProcessorTypes( @@ -967,6 +1687,19 @@ public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse fetchProc getChannel(), getFetchProcessorTypesMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorTypesMethod(), getCallOptions(), request); + } + /** * * @@ -980,6 +1713,85 @@ public com.google.cloud.documentai.v1beta3.ListProcessorsResponse listProcessors getChannel(), getListProcessorsMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.Processor getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeployProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeployProcessorVersionMethod(), getCallOptions(), request); + } + /** * * @@ -1034,6 +1846,21 @@ public com.google.longrunning.Operation disableProcessor( getChannel(), getDisableProcessorMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.longrunning.Operation setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultProcessorVersionMethod(), getCallOptions(), request); + } + /** * * @@ -1104,7 +1931,8 @@ protected DocumentProcessorServiceFutureStub build( * * *
-     * Fetches processor types.
+     * Fetches processor types. Note that we do not use ListProcessorTypes here
+     * because it is not paginated.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -1115,6 +1943,20 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + listProcessorTypes(com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), request); + } + /** * * @@ -1129,6 +1971,93 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getListProcessorsMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.Processor> + getProcessor(com.google.cloud.documentai.v1beta3.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), request); + } + /** * * @@ -1184,6 +2113,22 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), request); + } + /** * * @@ -1202,12 +2147,20 @@ protected DocumentProcessorServiceFutureStub build( private static final int METHODID_PROCESS_DOCUMENT = 0; private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 1; private static final int METHODID_FETCH_PROCESSOR_TYPES = 2; - private static final int METHODID_LIST_PROCESSORS = 3; - private static final int METHODID_CREATE_PROCESSOR = 4; - private static final int METHODID_DELETE_PROCESSOR = 5; - private static final int METHODID_ENABLE_PROCESSOR = 6; - private static final int METHODID_DISABLE_PROCESSOR = 7; - private static final int METHODID_REVIEW_DOCUMENT = 8; + private static final int METHODID_LIST_PROCESSOR_TYPES = 3; + private static final int METHODID_LIST_PROCESSORS = 4; + private static final int METHODID_GET_PROCESSOR = 5; + private static final int METHODID_GET_PROCESSOR_VERSION = 6; + private static final int METHODID_LIST_PROCESSOR_VERSIONS = 7; + private static final int METHODID_DELETE_PROCESSOR_VERSION = 8; + private static final int METHODID_DEPLOY_PROCESSOR_VERSION = 9; + private static final int METHODID_UNDEPLOY_PROCESSOR_VERSION = 10; + private static final int METHODID_CREATE_PROCESSOR = 11; + private static final int METHODID_DELETE_PROCESSOR = 12; + private static final int METHODID_ENABLE_PROCESSOR = 13; + private static final int METHODID_DISABLE_PROCESSOR = 14; + private static final int METHODID_SET_DEFAULT_PROCESSOR_VERSION = 15; + private static final int METHODID_REVIEW_DOCUMENT = 16; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1244,6 +2197,13 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse>) responseObserver); break; + case METHODID_LIST_PROCESSOR_TYPES: + serviceImpl.listProcessorTypes( + (com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse>) + responseObserver); + break; case METHODID_LIST_PROCESSORS: serviceImpl.listProcessors( (com.google.cloud.documentai.v1beta3.ListProcessorsRequest) request, @@ -1251,6 +2211,40 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.documentai.v1beta3.ListProcessorsResponse>) responseObserver); break; + case METHODID_GET_PROCESSOR: + serviceImpl.getProcessor( + (com.google.cloud.documentai.v1beta3.GetProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PROCESSOR_VERSION: + serviceImpl.getProcessorVersion( + (com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_VERSIONS: + serviceImpl.listProcessorVersions( + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse>) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR_VERSION: + serviceImpl.deleteProcessorVersion( + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_PROCESSOR_VERSION: + serviceImpl.deployProcessorVersion( + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_PROCESSOR_VERSION: + serviceImpl.undeployProcessorVersion( + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_CREATE_PROCESSOR: serviceImpl.createProcessor( (com.google.cloud.documentai.v1beta3.CreateProcessorRequest) request, @@ -1272,6 +2266,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.documentai.v1beta3.DisableProcessorRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_SET_DEFAULT_PROCESSOR_VERSION: + serviceImpl.setDefaultProcessorVersion( + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_REVIEW_DOCUMENT: serviceImpl.reviewDocument( (com.google.cloud.documentai.v1beta3.ReviewDocumentRequest) request, @@ -1344,11 +2343,19 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getProcessDocumentMethod()) .addMethod(getBatchProcessDocumentsMethod()) .addMethod(getFetchProcessorTypesMethod()) + .addMethod(getListProcessorTypesMethod()) .addMethod(getListProcessorsMethod()) + .addMethod(getGetProcessorMethod()) + .addMethod(getGetProcessorVersionMethod()) + .addMethod(getListProcessorVersionsMethod()) + .addMethod(getDeleteProcessorVersionMethod()) + .addMethod(getDeployProcessorVersionMethod()) + .addMethod(getUndeployProcessorVersionMethod()) .addMethod(getCreateProcessorMethod()) .addMethod(getDeleteProcessorMethod()) .addMethod(getEnableProcessorMethod()) .addMethod(getDisableProcessorMethod()) + .addMethod(getSetDefaultProcessorVersionMethod()) .addMethod(getReviewDocumentMethod()) .build(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java new file mode 100644 index 00000000000..3add7f82a87 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java @@ -0,0 +1,1203 @@ +/* + * 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/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Encodes the detailed information of a barcode.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Barcode} + */ +public final class Barcode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Barcode) + BarcodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Barcode.newBuilder() to construct. + private Barcode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Barcode() { + format_ = ""; + valueFormat_ = ""; + rawValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Barcode(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Barcode( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + valueFormat_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + rawValue_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Barcode.class, + com.google.cloud.documentai.v1.Barcode.Builder.class); + } + + public static final int FORMAT_FIELD_NUMBER = 1; + private volatile java.lang.Object format_; + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + @java.lang.Override + public java.lang.String getFormat() { + java.lang.Object ref = format_; + 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(); + format_ = s; + return s; + } + } + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FORMAT_FIELD_NUMBER = 2; + private volatile java.lang.Object valueFormat_; + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + @java.lang.Override + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + 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(); + valueFormat_ = s; + return s; + } + } + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAW_VALUE_FIELD_NUMBER = 3; + private volatile java.lang.Object rawValue_; + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + @java.lang.Override + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + 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(); + rawValue_ = s; + return s; + } + } + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rawValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rawValue_); + } + 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.documentai.v1.Barcode)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Barcode other = (com.google.cloud.documentai.v1.Barcode) obj; + + if (!getFormat().equals(other.getFormat())) return false; + if (!getValueFormat().equals(other.getValueFormat())) return false; + if (!getRawValue().equals(other.getRawValue())) 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) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + VALUE_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getValueFormat().hashCode(); + hash = (37 * hash) + RAW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRawValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode 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.documentai.v1.Barcode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode 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.documentai.v1.Barcode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode 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.documentai.v1.Barcode parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode 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.documentai.v1.Barcode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode 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.documentai.v1.Barcode 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; + } + /** + * + * + *
+   * Encodes the detailed information of a barcode.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Barcode} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Barcode) + com.google.cloud.documentai.v1.BarcodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Barcode.class, + com.google.cloud.documentai.v1.Barcode.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Barcode.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(); + format_ = ""; + + valueFormat_ = ""; + + rawValue_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Barcode.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode build() { + com.google.cloud.documentai.v1.Barcode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode buildPartial() { + com.google.cloud.documentai.v1.Barcode result = + new com.google.cloud.documentai.v1.Barcode(this); + result.format_ = format_; + result.valueFormat_ = valueFormat_; + result.rawValue_ = rawValue_; + 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.documentai.v1.Barcode) { + return mergeFrom((com.google.cloud.documentai.v1.Barcode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Barcode other) { + if (other == com.google.cloud.documentai.v1.Barcode.getDefaultInstance()) return this; + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (!other.getValueFormat().isEmpty()) { + valueFormat_ = other.valueFormat_; + onChanged(); + } + if (!other.getRawValue().isEmpty()) { + rawValue_ = other.rawValue_; + 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.documentai.v1.Barcode parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1.Barcode) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object format_ = ""; + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The format. + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The bytes for format to set. + * @return This builder for chaining. + */ + public Builder setFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private java.lang.Object valueFormat_ = ""; + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueFormat_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueFormat_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return This builder for chaining. + */ + public Builder clearValueFormat() { + + valueFormat_ = getDefaultInstance().getValueFormat(); + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The bytes for valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueFormat_ = value; + onChanged(); + return this; + } + + private java.lang.Object rawValue_ = ""; + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @param value The rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rawValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearRawValue() { + + rawValue_ = getDefaultInstance().getRawValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @param value The bytes for rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rawValue_ = 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.documentai.v1.Barcode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Barcode) + private static final com.google.cloud.documentai.v1.Barcode DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Barcode(); + } + + public static com.google.cloud.documentai.v1.Barcode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Barcode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Barcode(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.documentai.v1.Barcode getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java new file mode 100644 index 00000000000..d7876071750 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java @@ -0,0 +1,160 @@ +/* + * 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/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +public interface BarcodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Barcode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + java.lang.String getFormat(); + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + com.google.protobuf.ByteString getFormatBytes(); + + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + java.lang.String getValueFormat(); + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + com.google.protobuf.ByteString getValueFormatBytes(); + + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + java.lang.String getRawValue(); + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + com.google.protobuf.ByteString getRawValueBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java new file mode 100644 index 00000000000..9fcd7e6dc0e --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java @@ -0,0 +1,67 @@ +/* + * 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/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +public final class BarcodeProto { + private BarcodeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Barcode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/documentai/v1/barcode.pro" + + "to\022\032google.cloud.documentai.v1\"B\n\007Barcod" + + "e\022\016\n\006format\030\001 \001(\t\022\024\n\014value_format\030\002 \001(\t\022" + + "\021\n\traw_value\030\003 \001(\tB\320\001\n\036com.google.cloud." + + "documentai.v1B\014BarcodeProtoP\001ZDgoogle.go" + + "lang.org/genproto/googleapis/cloud/docum" + + "entai/v1;documentai\252\002\032Google.Cloud.Docum" + + "entAI.V1\312\002\032Google\\Cloud\\DocumentAI\\V1\352\002\035" + + "Google::Cloud::DocumentAI::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_documentai_v1_Barcode_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Barcode_descriptor, + new java.lang.String[] { + "Format", "ValueFormat", "RawValue", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java index d1060ac94d2..6864f473516 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java @@ -460,7 +460,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -472,7 +472,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -484,7 +484,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -495,7 +495,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -508,7 +508,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -749,7 +749,7 @@ public com.google.protobuf.ByteString getInputGcsSourceBytes() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -764,7 +764,7 @@ public boolean hasStatus() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -779,7 +779,7 @@ public com.google.rpc.Status getStatus() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -795,7 +795,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -819,7 +819,7 @@ public java.lang.String getOutputGcsDestination() { * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -1433,7 +1433,7 @@ public Builder setInputGcsSourceBytes(com.google.protobuf.ByteString value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1447,7 +1447,7 @@ public boolean hasStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1465,7 +1465,7 @@ public com.google.rpc.Status getStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1487,7 +1487,7 @@ public Builder setStatus(com.google.rpc.Status value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1506,7 +1506,7 @@ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1529,7 +1529,7 @@ public Builder mergeStatus(com.google.rpc.Status value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1549,7 +1549,7 @@ public Builder clearStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1563,7 +1563,7 @@ public com.google.rpc.Status.Builder getStatusBuilder() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1579,7 +1579,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1603,7 +1603,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1626,7 +1626,7 @@ public java.lang.String getOutputGcsDestination() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1649,7 +1649,7 @@ public com.google.protobuf.ByteString getOutputGcsDestinationBytes() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1671,7 +1671,7 @@ public Builder setOutputGcsDestination(java.lang.String value) { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1689,7 +1689,7 @@ public Builder clearOutputGcsDestination() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java index 775eb6cf695..588372bd513 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java @@ -158,7 +158,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -183,7 +187,11 @@ public java.lang.String getName() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -717,7 +725,11 @@ public Builder mergeFrom( * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -741,7 +753,11 @@ public java.lang.String getName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -765,7 +781,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -788,7 +808,11 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -807,7 +831,11 @@ public Builder clearName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java index a108c9af221..b4be9056f53 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java @@ -27,7 +27,11 @@ public interface BatchProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -41,7 +45,11 @@ public interface BatchProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java index b28a63f667c..ec2b53a9c83 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java @@ -40,6 +40,7 @@ private CommonOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder + * A related resource to this operation. + * + * + * string resource = 5; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + 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(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int CREATE_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp createTime_; /** @@ -583,6 +640,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateTime_ != null) { output.writeMessage(4, getUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resource_); + } unknownFields.writeTo(output); } @@ -606,6 +666,9 @@ public int getSerializedSize() { if (updateTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resource_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -624,6 +687,7 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (!getStateMessage().equals(other.getStateMessage())) return false; + if (!getResource().equals(other.getResource())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -647,6 +711,8 @@ public int hashCode() { hash = (53 * hash) + state_; hash = (37 * hash) + STATE_MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getStateMessage().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -805,6 +871,8 @@ public Builder clear() { stateMessage_ = ""; + resource_ = ""; + if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -846,6 +914,7 @@ public com.google.cloud.documentai.v1.CommonOperationMetadata buildPartial() { new com.google.cloud.documentai.v1.CommonOperationMetadata(this); result.state_ = state_; result.stateMessage_ = stateMessage_; + result.resource_ = resource_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -913,6 +982,10 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.CommonOperationMetadata stateMessage_ = other.stateMessage_; onChanged(); } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -1148,6 +1221,112 @@ public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java index efb39be14b4..1cafa1a53b8 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java @@ -73,6 +73,31 @@ public interface CommonOperationMetadataOrBuilder */ com.google.protobuf.ByteString getStateMessageBytes(); + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + /** * * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java new file mode 100644 index 00000000000..9a81f0b2b09 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java @@ -0,0 +1,977 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for create a processor. Notice this request is sent to
+ * a regionalized backend service, and if the processor type is not available
+ * on that region, the creation will fail.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CreateProcessorRequest} + */ +public final class CreateProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.CreateProcessorRequest) + CreateProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProcessorRequest.newBuilder() to construct. + private CreateProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProcessorRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.documentai.v1.Processor.Builder subBuilder = null; + if (processor_ != null) { + subBuilder = processor_.toBuilder(); + } + processor_ = + input.readMessage( + com.google.cloud.documentai.v1.Processor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(processor_); + processor_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CreateProcessorRequest.class, + com.google.cloud.documentai.v1.CreateProcessorRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent (project and location) under which to create the processor.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project and location) under which to create the processor.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROCESSOR_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.Processor processor_; + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + @java.lang.Override + public boolean hasProcessor() { + return processor_ != null; + } + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Processor getProcessor() { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder() { + return getProcessor(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (processor_ != null) { + output.writeMessage(2, getProcessor()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (processor_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProcessor()); + } + 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.documentai.v1.CreateProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.CreateProcessorRequest other = + (com.google.cloud.documentai.v1.CreateProcessorRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasProcessor() != other.hasProcessor()) return false; + if (hasProcessor()) { + if (!getProcessor().equals(other.getProcessor())) 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(); + if (hasProcessor()) { + hash = (37 * hash) + PROCESSOR_FIELD_NUMBER; + hash = (53 * hash) + getProcessor().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest 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.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest 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.documentai.v1.CreateProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest 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.documentai.v1.CreateProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest 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.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest 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.documentai.v1.CreateProcessorRequest 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; + } + /** + * + * + *
+   * Request message for create a processor. Notice this request is sent to
+   * a regionalized backend service, and if the processor type is not available
+   * on that region, the creation will fail.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CreateProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.CreateProcessorRequest) + com.google.cloud.documentai.v1.CreateProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CreateProcessorRequest.class, + com.google.cloud.documentai.v1.CreateProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.CreateProcessorRequest.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_ = ""; + + if (processorBuilder_ == null) { + processor_ = null; + } else { + processor_ = null; + processorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.CreateProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest build() { + com.google.cloud.documentai.v1.CreateProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.CreateProcessorRequest result = + new com.google.cloud.documentai.v1.CreateProcessorRequest(this); + result.parent_ = parent_; + if (processorBuilder_ == null) { + result.processor_ = processor_; + } else { + result.processor_ = processorBuilder_.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.documentai.v1.CreateProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.CreateProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.CreateProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.CreateProcessorRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasProcessor()) { + mergeProcessor(other.getProcessor()); + } + 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.documentai.v1.CreateProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.CreateProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent (project and location) under which to create the processor.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent (project and location) under which to create the processor.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent (project and location) under which to create the processor.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project and location) under which to create the processor.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project and location) under which to create the processor.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.Processor processor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + processorBuilder_; + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + public boolean hasProcessor() { + return processorBuilder_ != null || processor_ != null; + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + public com.google.cloud.documentai.v1.Processor getProcessor() { + if (processorBuilder_ == null) { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } else { + return processorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor(com.google.cloud.documentai.v1.Processor value) { + if (processorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + processor_ = value; + onChanged(); + } else { + processorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor(com.google.cloud.documentai.v1.Processor.Builder builderForValue) { + if (processorBuilder_ == null) { + processor_ = builderForValue.build(); + onChanged(); + } else { + processorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProcessor(com.google.cloud.documentai.v1.Processor value) { + if (processorBuilder_ == null) { + if (processor_ != null) { + processor_ = + com.google.cloud.documentai.v1.Processor.newBuilder(processor_) + .mergeFrom(value) + .buildPartial(); + } else { + processor_ = value; + } + onChanged(); + } else { + processorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProcessor() { + if (processorBuilder_ == null) { + processor_ = null; + onChanged(); + } else { + processor_ = null; + processorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.Processor.Builder getProcessorBuilder() { + + onChanged(); + return getProcessorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder() { + if (processorBuilder_ != null) { + return processorBuilder_.getMessageOrBuilder(); + } else { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } + } + /** + * + * + *
+     * Required. The processor to be created, requires [processor_type] and [display_name]
+     * to be set. Also, the processor is under CMEK if CMEK fields are set.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + getProcessorFieldBuilder() { + if (processorBuilder_ == null) { + processorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder>( + getProcessor(), getParentForChildren(), isClean()); + processor_ = null; + } + return processorBuilder_; + } + + @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.documentai.v1.CreateProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.CreateProcessorRequest) + private static final com.google.cloud.documentai.v1.CreateProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.CreateProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProcessorRequest(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.documentai.v1.CreateProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..969db329c90 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface CreateProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.CreateProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project and location) under which to create the processor.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project and location) under which to create the processor.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + boolean hasProcessor(); + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + com.google.cloud.documentai.v1.Processor getProcessor(); + /** + * + * + *
+   * Required. The processor to be created, requires [processor_type] and [display_name]
+   * to be set. Also, the processor is under CMEK if CMEK fields are set.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java new file mode 100644 index 00000000000..383c76d5c90 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java @@ -0,0 +1,742 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for delete processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorMetadata} + */ +public final class DeleteProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorMetadata) + DeleteProcessorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorMetadata.newBuilder() to construct. + private DeleteProcessorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorMetadata( + 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 42: + { + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(5, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCommonMetadata()); + } + 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.documentai.v1.DeleteProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorMetadata other = + (com.google.cloud.documentai.v1.DeleteProcessorMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata 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.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata 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.documentai.v1.DeleteProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata 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.documentai.v1.DeleteProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata 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.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata 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.documentai.v1.DeleteProcessorMetadata 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 long running operation metadata for delete processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorMetadata) + com.google.cloud.documentai.v1.DeleteProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata build() { + com.google.cloud.documentai.v1.DeleteProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorMetadata result = + new com.google.cloud.documentai.v1.DeleteProcessorMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.DeleteProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1.DeleteProcessorMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.DeleteProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeleteProcessorMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.DeleteProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorMetadata) + private static final com.google.cloud.documentai.v1.DeleteProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorMetadata(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.documentai.v1.DeleteProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java new file mode 100644 index 00000000000..887e96bef4c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java new file mode 100644 index 00000000000..a8d50488fed --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java @@ -0,0 +1,653 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the delete processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorRequest} + */ +public final class DeleteProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorRequest) + DeleteProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorRequest.newBuilder() to construct. + private DeleteProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorRequest other = + (com.google.cloud.documentai.v1.DeleteProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest 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.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest 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.documentai.v1.DeleteProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest 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.documentai.v1.DeleteProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest 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.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest 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.documentai.v1.DeleteProcessorRequest 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; + } + /** + * + * + *
+   * Request message for the delete processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorRequest) + com.google.cloud.documentai.v1.DeleteProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest build() { + com.google.cloud.documentai.v1.DeleteProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorRequest result = + new com.google.cloud.documentai.v1.DeleteProcessorRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.DeleteProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.DeleteProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeleteProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorRequest) + private static final com.google.cloud.documentai.v1.DeleteProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorRequest(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.documentai.v1.DeleteProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..fea88a7e975 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java new file mode 100644 index 00000000000..48bd431abde --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java @@ -0,0 +1,747 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for delete processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionMetadata} + */ +public final class DeleteProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + DeleteProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionMetadata.newBuilder() to construct. + private DeleteProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorVersionMetadata( + 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.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1.DeleteProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata 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.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata 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.documentai.v1.DeleteProcessorVersionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata 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.documentai.v1.DeleteProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata 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.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata 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.documentai.v1.DeleteProcessorVersionMetadata 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 long running operation metadata for delete processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.DeleteProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.DeleteProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.DeleteProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorVersionMetadata(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.documentai.v1.DeleteProcessorVersionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..7b5e63b56e8 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java new file mode 100644 index 00000000000..0ed7c31cab5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java @@ -0,0 +1,656 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the delete processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionRequest} + */ +public final class DeleteProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + DeleteProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionRequest.newBuilder() to construct. + private DeleteProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest other = + (com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest 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.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest 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.documentai.v1.DeleteProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest 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.documentai.v1.DeleteProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest 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.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest 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.documentai.v1.DeleteProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the delete processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + com.google.cloud.documentai.v1.DeleteProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest build() { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest result = + new com.google.cloud.documentai.v1.DeleteProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.DeleteProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorVersionRequest(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.documentai.v1.DeleteProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..d47142a9f0c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java new file mode 100644 index 00000000000..09ddf025271 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java @@ -0,0 +1,747 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionMetadata} + */ +public final class DeployProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + DeployProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionMetadata.newBuilder() to construct. + private DeployProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionMetadata( + 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.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1.DeployProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata 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.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata 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.documentai.v1.DeployProcessorVersionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata 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.documentai.v1.DeployProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata 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.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata 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.documentai.v1.DeployProcessorVersionMetadata 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 long running operation metadata for deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + com.google.cloud.documentai.v1.DeployProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.DeployProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.DeployProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.DeployProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.DeployProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionMetadata(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.documentai.v1.DeployProcessorVersionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..53440162eef --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java new file mode 100644 index 00000000000..f1697e8e6d1 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java @@ -0,0 +1,656 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionRequest} + */ +public final class DeployProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionRequest) + DeployProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionRequest.newBuilder() to construct. + private DeployProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeployProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionRequest other = + (com.google.cloud.documentai.v1.DeployProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest 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.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest 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.documentai.v1.DeployProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest 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.documentai.v1.DeployProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest 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.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest 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.documentai.v1.DeployProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionRequest) + com.google.cloud.documentai.v1.DeployProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest build() { + com.google.cloud.documentai.v1.DeployProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionRequest result = + new com.google.cloud.documentai.v1.DeployProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeployProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.DeployProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeployProcessorVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeployProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionRequest(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.documentai.v1.DeployProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..7a9f374535f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java new file mode 100644 index 00000000000..98d0a032418 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java @@ -0,0 +1,464 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionResponse} + */ +public final class DeployProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionResponse) + DeployProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionResponse.newBuilder() to construct. + private DeployProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1.DeployProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionResponse other = + (com.google.cloud.documentai.v1.DeployProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse 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.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse 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.documentai.v1.DeployProcessorVersionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse 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.documentai.v1.DeployProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse 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.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse 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.documentai.v1.DeployProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for the deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionResponse) + com.google.cloud.documentai.v1.DeployProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse build() { + com.google.cloud.documentai.v1.DeployProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionResponse result = + new com.google.cloud.documentai.v1.DeployProcessorVersionResponse(this); + 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.documentai.v1.DeployProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionResponse.getDefaultInstance()) + return this; + 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.documentai.v1.DeployProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DeployProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1.DeployProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionResponse(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.documentai.v1.DeployProcessorVersionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..2a1f42dbe03 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java new file mode 100644 index 00000000000..67e843c1638 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java @@ -0,0 +1,742 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for disable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorMetadata} + */ +public final class DisableProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorMetadata) + DisableProcessorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorMetadata.newBuilder() to construct. + private DisableProcessorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DisableProcessorMetadata( + 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 42: + { + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1.DisableProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(5, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCommonMetadata()); + } + 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.documentai.v1.DisableProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorMetadata other = + (com.google.cloud.documentai.v1.DisableProcessorMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata 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.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata 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.documentai.v1.DisableProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata 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.documentai.v1.DisableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata 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.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata 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.documentai.v1.DisableProcessorMetadata 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 long running operation metadata for disable processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorMetadata) + com.google.cloud.documentai.v1.DisableProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1.DisableProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata build() { + com.google.cloud.documentai.v1.DisableProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorMetadata result = + new com.google.cloud.documentai.v1.DisableProcessorMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.DisableProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.DisableProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DisableProcessorMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.DisableProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorMetadata) + private static final com.google.cloud.documentai.v1.DisableProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DisableProcessorMetadata(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.documentai.v1.DisableProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java new file mode 100644 index 00000000000..bad9c544a87 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java new file mode 100644 index 00000000000..09b04cf9b97 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java @@ -0,0 +1,653 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the disable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorRequest} + */ +public final class DisableProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorRequest) + DisableProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorRequest.newBuilder() to construct. + private DisableProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DisableProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorRequest.class, + com.google.cloud.documentai.v1.DisableProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DisableProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorRequest other = + (com.google.cloud.documentai.v1.DisableProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest 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.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest 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.documentai.v1.DisableProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest 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.documentai.v1.DisableProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest 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.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest 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.documentai.v1.DisableProcessorRequest 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; + } + /** + * + * + *
+   * Request message for the disable processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorRequest) + com.google.cloud.documentai.v1.DisableProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorRequest.class, + com.google.cloud.documentai.v1.DisableProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest build() { + com.google.cloud.documentai.v1.DisableProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorRequest result = + new com.google.cloud.documentai.v1.DisableProcessorRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DisableProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.DisableProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DisableProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name to be disabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be disabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be disabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be disabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be disabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DisableProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorRequest) + private static final com.google.cloud.documentai.v1.DisableProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DisableProcessorRequest(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.documentai.v1.DisableProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..11fcfc1c743 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java new file mode 100644 index 00000000000..aea6bde0120 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java @@ -0,0 +1,461 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the disable processor method.
+ * Intentionally empty proto for adding fields in future.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorResponse} + */ +public final class DisableProcessorResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorResponse) + DisableProcessorResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorResponse.newBuilder() to construct. + private DisableProcessorResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DisableProcessorResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorResponse.class, + com.google.cloud.documentai.v1.DisableProcessorResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1.DisableProcessorResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorResponse other = + (com.google.cloud.documentai.v1.DisableProcessorResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse 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.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse 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.documentai.v1.DisableProcessorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse 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.documentai.v1.DisableProcessorResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse 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.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse 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.documentai.v1.DisableProcessorResponse 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; + } + /** + * + * + *
+   * Response message for the disable processor method.
+   * Intentionally empty proto for adding fields in future.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorResponse) + com.google.cloud.documentai.v1.DisableProcessorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorResponse.class, + com.google.cloud.documentai.v1.DisableProcessorResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse build() { + com.google.cloud.documentai.v1.DisableProcessorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorResponse result = + new com.google.cloud.documentai.v1.DisableProcessorResponse(this); + 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.documentai.v1.DisableProcessorResponse) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorResponse other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorResponse.getDefaultInstance()) + return this; + 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.documentai.v1.DisableProcessorResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DisableProcessorResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1.DisableProcessorResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorResponse) + private static final com.google.cloud.documentai.v1.DisableProcessorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorResponse(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DisableProcessorResponse(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.documentai.v1.DisableProcessorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java new file mode 100644 index 00000000000..b7bee03b644 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java index 31f5ed593cc..775f75534c8 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java @@ -22,11 +22,10 @@ * * *
- * Document represents the canonical document resource in Document Understanding
- * AI.
- * It is an interchange format that provides insights into documents and allows
- * for collaboration between users and Document Understanding AI to iterate and
- * optimize for quality.
+ * Document represents the canonical document resource in Document AI. It is an
+ * interchange format that provides insights into documents and allows for
+ * collaboration between users and Document AI to iterate and optimize for
+ * quality.
  * 
* * Protobuf type {@code google.cloud.documentai.v1.Document} @@ -304,8 +303,7 @@ public interface ShardInfoOrBuilder * * *
-     * The index of the first character in
-     * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+     * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall
      * document global text.
      * 
* @@ -460,8 +458,7 @@ public long getShardCount() { * * *
-     * The index of the first character in
-     * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+     * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall
      * document global text.
      * 
* @@ -936,8 +933,7 @@ public Builder clearShardCount() { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall
        * document global text.
        * 
* @@ -953,8 +949,7 @@ public long getTextOffset() { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall
        * document global text.
        * 
* @@ -973,8 +968,7 @@ public Builder setTextOffset(long value) { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall
        * document global text.
        * 
* @@ -1050,8 +1044,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -1063,8 +1056,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -1076,8 +1068,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -2213,8 +2204,7 @@ public com.google.cloud.documentai.v1.Document.Style.FontSize getDefaultInstance * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -2229,8 +2219,7 @@ public boolean hasTextAnchor() { * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -2247,8 +2236,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3031,8 +3019,7 @@ public Builder mergeFrom( * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3046,8 +3033,7 @@ public boolean hasTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3067,8 +3053,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3090,8 +3075,7 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3111,8 +3095,7 @@ public Builder setTextAnchor( * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3138,8 +3121,7 @@ public Builder mergeTextAnchor(com.google.cloud.documentai.v1.Document.TextAncho * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3159,8 +3141,7 @@ public Builder clearTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3174,8 +3155,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -3193,8 +3173,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchor * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -4154,11 +4133,9 @@ public interface PageOrBuilder * * *
-     * 1-based index for current
-     * [Page][google.cloud.documentai.v1.Document.Page] in a parent
-     * [Document][google.cloud.documentai.v1.Document]. Useful when a page is
-     * taken out of a [Document][google.cloud.documentai.v1.Document] for
-     * individual processing.
+     * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document].
+     * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual
+     * processing.
      * 
* * int32 page_number = 1; @@ -4849,6 +4826,70 @@ com.google.cloud.documentai.v1.Document.Page.FormFieldOrBuilder getFormFieldsOrB */ com.google.cloud.documentai.v1.Document.Page.SymbolOrBuilder getSymbolsOrBuilder(int index); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + java.util.List + getDetectedBarcodesList(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode getDetectedBarcodes(int index); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + int getDetectedBarcodesCount(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + java.util.List + getDetectedBarcodesOrBuilderList(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index); + /** * * @@ -4914,6 +4955,7 @@ private Page() { tables_ = java.util.Collections.emptyList(); formFields_ = java.util.Collections.emptyList(); symbols_ = java.util.Collections.emptyList(); + detectedBarcodes_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -5138,6 +5180,20 @@ private Page( extensionRegistry)); break; } + case 122: + { + if (!((mutable_bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode>(); + mutable_bitField0_ |= 0x00000400; + } + detectedBarcodes_.add( + input.readMessage( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.parser(), + extensionRegistry)); + break; + } case 130: { com.google.cloud.documentai.v1.Document.Provenance.Builder subBuilder = null; @@ -5201,6 +5257,9 @@ private Page( if (((mutable_bitField0_ & 0x00000001) != 0)) { transforms_ = java.util.Collections.unmodifiableList(transforms_); } + if (((mutable_bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = java.util.Collections.unmodifiableList(detectedBarcodes_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -7948,8 +8007,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -7961,8 +8019,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -7974,8 +8031,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -7986,11 +8042,9 @@ public interface LayoutOrBuilder * * *
-       * Confidence of the current
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
-       * context of the object this layout is for. e.g. confidence can be for a
-       * single token, a table, a visual element, etc. depending on context.
-       * Range [0, 1].
+       * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this
+       * layout is for. e.g. confidence can be for a single token, a table,
+       * a visual element, etc. depending on context. Range [0, 1].
        * 
* * float confidence = 2; @@ -8003,8 +8057,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8016,8 +8069,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8029,8 +8081,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8041,8 +8092,7 @@ public interface LayoutOrBuilder * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -8054,8 +8104,7 @@ public interface LayoutOrBuilder * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -8416,8 +8465,7 @@ private Orientation(int value) { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -8432,8 +8480,7 @@ public boolean hasTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -8450,8 +8497,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -8467,11 +8513,9 @@ public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchor * * *
-       * Confidence of the current
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
-       * context of the object this layout is for. e.g. confidence can be for a
-       * single token, a table, a visual element, etc. depending on context.
-       * Range [0, 1].
+       * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this
+       * layout is for. e.g. confidence can be for a single token, a table,
+       * a visual element, etc. depending on context. Range [0, 1].
        * 
* * float confidence = 2; @@ -8489,8 +8533,7 @@ public float getConfidence() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8505,8 +8548,7 @@ public boolean hasBoundingPoly() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8523,8 +8565,7 @@ public com.google.cloud.documentai.v1.BoundingPoly getBoundingPoly() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -8540,8 +8581,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -8556,8 +8596,7 @@ public int getOrientationValue() { * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -8984,8 +9023,7 @@ public Builder mergeFrom( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -8999,8 +9037,7 @@ public boolean hasTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9020,8 +9057,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9043,8 +9079,7 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9064,8 +9099,7 @@ public Builder setTextAnchor( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9091,8 +9125,7 @@ public Builder mergeTextAnchor(com.google.cloud.documentai.v1.Document.TextAncho * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9112,8 +9145,7 @@ public Builder clearTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9127,8 +9159,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9147,8 +9178,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; @@ -9175,11 +9205,9 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9194,11 +9222,9 @@ public float getConfidence() { * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9216,11 +9242,9 @@ public Builder setConfidence(float value) { * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9244,8 +9268,7 @@ public Builder clearConfidence() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9259,8 +9282,7 @@ public boolean hasBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9280,8 +9302,7 @@ public com.google.cloud.documentai.v1.BoundingPoly getBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9303,8 +9324,7 @@ public Builder setBoundingPoly(com.google.cloud.documentai.v1.BoundingPoly value * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9324,8 +9344,7 @@ public Builder setBoundingPoly( * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9351,8 +9370,7 @@ public Builder mergeBoundingPoly(com.google.cloud.documentai.v1.BoundingPoly val * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9372,8 +9390,7 @@ public Builder clearBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9387,8 +9404,7 @@ public com.google.cloud.documentai.v1.BoundingPoly.Builder getBoundingPolyBuilde * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9406,8 +9422,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; @@ -9434,8 +9449,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -9451,8 +9465,7 @@ public int getOrientationValue() { * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -9471,8 +9484,7 @@ public Builder setOrientationValue(int value) { * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -9493,8 +9505,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Orientation getOrient * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -9517,8 +9528,7 @@ public Builder setOrientation( * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; @@ -9594,8 +9604,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -9607,8 +9616,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -9620,8 +9628,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -9876,8 +9883,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -9892,8 +9898,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -9910,8 +9915,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10487,8 +10491,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10502,8 +10505,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10523,8 +10525,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10546,8 +10547,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10567,8 +10567,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10594,8 +10593,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10615,8 +10613,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10630,8 +10627,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -10649,8 +10645,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11331,8 +11326,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11344,8 +11338,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11357,8 +11350,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11612,8 +11604,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11628,8 +11619,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -11646,8 +11636,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12222,8 +12211,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12237,8 +12225,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12258,8 +12245,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12281,8 +12267,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12302,8 +12287,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12329,8 +12313,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12350,8 +12333,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12365,8 +12347,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -12384,8 +12365,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13066,8 +13046,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13079,8 +13058,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13092,8 +13070,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13348,8 +13325,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13364,8 +13340,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13382,8 +13357,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13959,8 +13933,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13974,8 +13947,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -13995,8 +13967,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14018,8 +13989,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14039,8 +14009,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14066,8 +14035,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14087,8 +14055,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14102,8 +14069,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14121,8 +14087,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14803,8 +14768,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14816,8 +14780,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14829,8 +14792,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -14841,8 +14803,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -14855,8 +14816,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -14869,8 +14829,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -15172,8 +15131,7 @@ public interface DetectedBreakOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} @@ -15660,8 +15618,7 @@ protected Builder newBuilderForType( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} @@ -15987,8 +15944,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16003,8 +15959,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16021,8 +15976,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16038,8 +15992,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16055,8 +16008,7 @@ public boolean hasDetectedBreak() { * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16074,8 +16026,7 @@ public com.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak getDetec * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16680,8 +16631,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16695,8 +16645,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16716,8 +16665,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16739,8 +16687,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16760,8 +16707,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16787,8 +16733,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16808,8 +16753,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16823,8 +16767,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16842,8 +16785,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -16875,8 +16817,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16891,8 +16832,7 @@ public boolean hasDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16914,8 +16854,7 @@ public com.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak getDetec * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16939,8 +16878,7 @@ public Builder setDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16962,8 +16900,7 @@ public Builder setDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -16992,8 +16929,7 @@ public Builder mergeDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -17014,8 +16950,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -17031,8 +16966,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -17053,8 +16987,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; @@ -17736,8 +17669,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -17749,8 +17681,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -17762,8 +17693,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -17965,8 +17895,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -17981,8 +17910,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -17999,8 +17927,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18499,8 +18426,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18514,8 +18440,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18535,8 +18460,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18558,8 +18482,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18579,8 +18502,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18606,8 +18528,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18627,8 +18548,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18642,8 +18562,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -18661,8 +18580,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19156,8 +19074,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19169,8 +19086,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19182,8 +19098,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19194,8 +19109,7 @@ public interface VisualElementOrBuilder * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19207,8 +19121,7 @@ public interface VisualElementOrBuilder * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19421,8 +19334,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19437,8 +19349,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19455,8 +19366,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -19472,8 +19382,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19496,8 +19405,7 @@ public java.lang.String getType() { * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -20026,8 +19934,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20041,8 +19948,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20062,8 +19968,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20085,8 +19990,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20106,8 +20010,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20133,8 +20036,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20154,8 +20056,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20169,8 +20070,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20188,8 +20088,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20216,8 +20115,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20239,8 +20137,7 @@ public java.lang.String getType() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20262,8 +20159,7 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20284,8 +20180,7 @@ public Builder setType(java.lang.String value) { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20302,8 +20197,7 @@ public Builder clearType() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20797,8 +20691,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20810,8 +20703,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -20823,8 +20715,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22251,8 +22142,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22264,8 +22154,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22277,8 +22166,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22517,8 +22405,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22533,8 +22420,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -22551,8 +22437,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23128,8 +23013,7 @@ public Builder mergeFrom( * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23143,8 +23027,7 @@ public boolean hasLayout() { * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23164,8 +23047,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23187,8 +23069,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23208,8 +23089,7 @@ public Builder setLayout( * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23235,8 +23115,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23256,8 +23135,7 @@ public Builder clearLayout() { * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23271,8 +23149,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23290,8 +23167,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23893,8 +23769,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23909,8 +23784,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -23927,8 +23801,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24690,8 +24563,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24705,8 +24577,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24726,8 +24597,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24749,8 +24619,7 @@ public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout val * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24770,8 +24639,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24797,8 +24665,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout v * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24818,8 +24685,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24833,8 +24699,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuil * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -24852,8 +24717,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; @@ -26123,9 +25987,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26137,9 +26000,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26151,9 +26013,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26164,8 +26025,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26177,8 +26037,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26190,8 +26049,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26363,6 +26221,64 @@ com.google.cloud.documentai.v1.Document.Page.DetectedLanguage getValueDetectedLa */ com.google.protobuf.ByteString getValueTypeBytes(); + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + java.lang.String getCorrectedKeyText(); + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + com.google.protobuf.ByteString getCorrectedKeyTextBytes(); + + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + java.lang.String getCorrectedValueText(); + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + com.google.protobuf.ByteString getCorrectedValueTextBytes(); + /** * * @@ -26421,6 +26337,8 @@ private FormField() { nameDetectedLanguages_ = java.util.Collections.emptyList(); valueDetectedLanguages_ = java.util.Collections.emptyList(); valueType_ = ""; + correctedKeyText_ = ""; + correctedValueText_ = ""; } @java.lang.Override @@ -26522,6 +26440,20 @@ private FormField( valueType_ = s; break; } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedKeyText_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedValueText_ = s; + break; + } case 66: { com.google.cloud.documentai.v1.Document.Provenance.Builder subBuilder = null; @@ -26589,9 +26521,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26606,9 +26537,8 @@ public boolean hasFieldName() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26625,9 +26555,8 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getFieldName() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-       * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -26643,8 +26572,7 @@ public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getFieldName * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26659,8 +26587,7 @@ public boolean hasFieldValue() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26677,8 +26604,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getFieldValue() { * * *
-       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -26913,6 +26839,112 @@ public com.google.protobuf.ByteString getValueTypeBytes() { } } + public static final int CORRECTED_KEY_TEXT_FIELD_NUMBER = 6; + private volatile java.lang.Object correctedKeyText_; + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + @java.lang.Override + public java.lang.String getCorrectedKeyText() { + java.lang.Object ref = correctedKeyText_; + 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(); + correctedKeyText_ = s; + return s; + } + } + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedKeyTextBytes() { + java.lang.Object ref = correctedKeyText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedKeyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CORRECTED_VALUE_TEXT_FIELD_NUMBER = 7; + private volatile java.lang.Object correctedValueText_; + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + @java.lang.Override + public java.lang.String getCorrectedValueText() { + java.lang.Object ref = correctedValueText_; + 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(); + correctedValueText_ = s; + return s; + } + } + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedValueTextBytes() { + java.lang.Object ref = correctedValueText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedValueText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int PROVENANCE_FIELD_NUMBER = 8; private com.google.cloud.documentai.v1.Document.Provenance provenance_; /** @@ -26990,6 +27022,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedKeyText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, correctedKeyText_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedValueText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, correctedValueText_); + } if (provenance_ != null) { output.writeMessage(8, getProvenance()); } @@ -27021,6 +27059,12 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedKeyText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, correctedKeyText_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedValueText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, correctedValueText_); + } if (provenance_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getProvenance()); } @@ -27053,6 +27097,8 @@ public boolean equals(final java.lang.Object obj) { if (!getValueDetectedLanguagesList().equals(other.getValueDetectedLanguagesList())) return false; if (!getValueType().equals(other.getValueType())) return false; + if (!getCorrectedKeyText().equals(other.getCorrectedKeyText())) return false; + if (!getCorrectedValueText().equals(other.getCorrectedValueText())) return false; if (hasProvenance() != other.hasProvenance()) return false; if (hasProvenance()) { if (!getProvenance().equals(other.getProvenance())) return false; @@ -27086,6 +27132,10 @@ public int hashCode() { } hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + getValueType().hashCode(); + hash = (37 * hash) + CORRECTED_KEY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedKeyText().hashCode(); + hash = (37 * hash) + CORRECTED_VALUE_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedValueText().hashCode(); if (hasProvenance()) { hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; hash = (53 * hash) + getProvenance().hashCode(); @@ -27267,6 +27317,10 @@ public Builder clear() { } valueType_ = ""; + correctedKeyText_ = ""; + + correctedValueText_ = ""; + if (provenanceBuilder_ == null) { provenance_ = null; } else { @@ -27332,6 +27386,8 @@ public com.google.cloud.documentai.v1.Document.Page.FormField buildPartial() { result.valueDetectedLanguages_ = valueDetectedLanguagesBuilder_.build(); } result.valueType_ = valueType_; + result.correctedKeyText_ = correctedKeyText_; + result.correctedValueText_ = correctedValueText_; if (provenanceBuilder_ == null) { result.provenance_ = provenance_; } else { @@ -27453,6 +27509,14 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Document.Page.FormField valueType_ = other.valueType_; onChanged(); } + if (!other.getCorrectedKeyText().isEmpty()) { + correctedKeyText_ = other.correctedKeyText_; + onChanged(); + } + if (!other.getCorrectedValueText().isEmpty()) { + correctedValueText_ = other.correctedValueText_; + onChanged(); + } if (other.hasProvenance()) { mergeProvenance(other.getProvenance()); } @@ -27498,9 +27562,8 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27514,9 +27577,8 @@ public boolean hasFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27536,9 +27598,8 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27560,9 +27621,8 @@ public Builder setFieldName(com.google.cloud.documentai.v1.Document.Page.Layout * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27582,9 +27642,8 @@ public Builder setFieldName( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27610,9 +27669,8 @@ public Builder mergeFieldName(com.google.cloud.documentai.v1.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27632,9 +27690,8 @@ public Builder clearFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27648,9 +27705,8 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getFieldNameB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27669,9 +27725,8 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getFieldNameB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
-         * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; @@ -27703,8 +27758,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getFieldNameB * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27718,8 +27772,7 @@ public boolean hasFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27739,8 +27792,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout getFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27762,8 +27814,7 @@ public Builder setFieldValue(com.google.cloud.documentai.v1.Document.Page.Layout * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27783,8 +27834,7 @@ public Builder setFieldValue( * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27810,8 +27860,7 @@ public Builder mergeFieldValue(com.google.cloud.documentai.v1.Document.Page.Layo * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27831,8 +27880,7 @@ public Builder clearFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27846,8 +27894,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getFieldValue * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -27866,8 +27913,7 @@ public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getFieldValue * * *
-         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; @@ -28837,6 +28883,238 @@ public Builder setValueTypeBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object correctedKeyText_ = ""; + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + public java.lang.String getCorrectedKeyText() { + java.lang.Object ref = correctedKeyText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedKeyText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + public com.google.protobuf.ByteString getCorrectedKeyTextBytes() { + java.lang.Object ref = correctedKeyText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedKeyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @param value The correctedKeyText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedKeyText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedKeyText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedKeyText() { + + correctedKeyText_ = getDefaultInstance().getCorrectedKeyText(); + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @param value The bytes for correctedKeyText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedKeyTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedKeyText_ = value; + onChanged(); + return this; + } + + private java.lang.Object correctedValueText_ = ""; + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + public java.lang.String getCorrectedValueText() { + java.lang.Object ref = correctedValueText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedValueText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + public com.google.protobuf.ByteString getCorrectedValueTextBytes() { + java.lang.Object ref = correctedValueText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedValueText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @param value The correctedValueText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedValueText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedValueText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedValueText() { + + correctedValueText_ = getDefaultInstance().getCorrectedValueText(); + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @param value The bytes for correctedValueText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedValueTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedValueText_ = value; + onChanged(); + return this; + } + private com.google.cloud.documentai.v1.Document.Provenance provenance_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.documentai.v1.Document.Provenance, @@ -29076,6 +29354,1090 @@ public com.google.cloud.documentai.v1.Document.Page.FormField getDefaultInstance } } + public interface DetectedBarcodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Document.Page.DetectedBarcode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + boolean hasLayout(); + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + com.google.cloud.documentai.v1.Document.Page.Layout getLayout(); + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrBuilder(); + + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + boolean hasBarcode(); + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return The barcode. + */ + com.google.cloud.documentai.v1.Barcode getBarcode(); + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + com.google.cloud.documentai.v1.BarcodeOrBuilder getBarcodeOrBuilder(); + } + /** + * + * + *
+     * A detected barcode.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Page.DetectedBarcode} + */ + public static final class DetectedBarcode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Document.Page.DetectedBarcode) + DetectedBarcodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectedBarcode.newBuilder() to construct. + private DetectedBarcode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DetectedBarcode() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectedBarcode(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DetectedBarcode( + 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.documentai.v1.Document.Page.Layout.Builder subBuilder = null; + if (layout_ != null) { + subBuilder = layout_.toBuilder(); + } + layout_ = + input.readMessage( + com.google.cloud.documentai.v1.Document.Page.Layout.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(layout_); + layout_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.documentai.v1.Barcode.Builder subBuilder = null; + if (barcode_ != null) { + subBuilder = barcode_.toBuilder(); + } + barcode_ = + input.readMessage( + com.google.cloud.documentai.v1.Barcode.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(barcode_); + barcode_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.class, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder.class); + } + + public static final int LAYOUT_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.Document.Page.Layout layout_; + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + @java.lang.Override + public boolean hasLayout() { + return layout_ != null; + } + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { + return layout_ == null + ? com.google.cloud.documentai.v1.Document.Page.Layout.getDefaultInstance() + : layout_; + } + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrBuilder() { + return getLayout(); + } + + public static final int BARCODE_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.Barcode barcode_; + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + @java.lang.Override + public boolean hasBarcode() { + return barcode_ != null; + } + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return The barcode. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode getBarcode() { + return barcode_ == null + ? com.google.cloud.documentai.v1.Barcode.getDefaultInstance() + : barcode_; + } + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BarcodeOrBuilder getBarcodeOrBuilder() { + return getBarcode(); + } + + 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 (layout_ != null) { + output.writeMessage(1, getLayout()); + } + if (barcode_ != null) { + output.writeMessage(2, getBarcode()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (layout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLayout()); + } + if (barcode_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBarcode()); + } + 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.documentai.v1.Document.Page.DetectedBarcode)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode other = + (com.google.cloud.documentai.v1.Document.Page.DetectedBarcode) obj; + + if (hasLayout() != other.hasLayout()) return false; + if (hasLayout()) { + if (!getLayout().equals(other.getLayout())) return false; + } + if (hasBarcode() != other.hasBarcode()) return false; + if (hasBarcode()) { + if (!getBarcode().equals(other.getBarcode())) 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 (hasLayout()) { + hash = (37 * hash) + LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getLayout().hashCode(); + } + if (hasBarcode()) { + hash = (37 * hash) + BARCODE_FIELD_NUMBER; + hash = (53 * hash) + getBarcode().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode 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.documentai.v1.Document.Page.DetectedBarcode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode 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.documentai.v1.Document.Page.DetectedBarcode parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode 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.documentai.v1.Document.Page.DetectedBarcode parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode 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.documentai.v1.Document.Page.DetectedBarcode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode 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.documentai.v1.Document.Page.DetectedBarcode 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 detected barcode.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Page.DetectedBarcode} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Document.Page.DetectedBarcode) + com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.class, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.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 (layoutBuilder_ == null) { + layout_ = null; + } else { + layout_ = null; + layoutBuilder_ = null; + } + if (barcodeBuilder_ == null) { + barcode_ = null; + } else { + barcode_ = null; + barcodeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode build() { + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode buildPartial() { + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode result = + new com.google.cloud.documentai.v1.Document.Page.DetectedBarcode(this); + if (layoutBuilder_ == null) { + result.layout_ = layout_; + } else { + result.layout_ = layoutBuilder_.build(); + } + if (barcodeBuilder_ == null) { + result.barcode_ = barcode_; + } else { + result.barcode_ = barcodeBuilder_.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.documentai.v1.Document.Page.DetectedBarcode) { + return mergeFrom((com.google.cloud.documentai.v1.Document.Page.DetectedBarcode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode other) { + if (other + == com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.getDefaultInstance()) + return this; + if (other.hasLayout()) { + mergeLayout(other.getLayout()); + } + if (other.hasBarcode()) { + mergeBarcode(other.getBarcode()); + } + 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.documentai.v1.Document.Page.DetectedBarcode parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.Document.Page.DetectedBarcode) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.Document.Page.Layout layout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.Layout, + com.google.cloud.documentai.v1.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder> + layoutBuilder_; + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + public boolean hasLayout() { + return layoutBuilder_ != null || layout_ != null; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + public com.google.cloud.documentai.v1.Document.Page.Layout getLayout() { + if (layoutBuilder_ == null) { + return layout_ == null + ? com.google.cloud.documentai.v1.Document.Page.Layout.getDefaultInstance() + : layout_; + } else { + return layoutBuilder_.getMessage(); + } + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public Builder setLayout(com.google.cloud.documentai.v1.Document.Page.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + layout_ = value; + onChanged(); + } else { + layoutBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public Builder setLayout( + com.google.cloud.documentai.v1.Document.Page.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + layout_ = builderForValue.build(); + onChanged(); + } else { + layoutBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public Builder mergeLayout(com.google.cloud.documentai.v1.Document.Page.Layout value) { + if (layoutBuilder_ == null) { + if (layout_ != null) { + layout_ = + com.google.cloud.documentai.v1.Document.Page.Layout.newBuilder(layout_) + .mergeFrom(value) + .buildPartial(); + } else { + layout_ = value; + } + onChanged(); + } else { + layoutBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public Builder clearLayout() { + if (layoutBuilder_ == null) { + layout_ = null; + onChanged(); + } else { + layout_ = null; + layoutBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public com.google.cloud.documentai.v1.Document.Page.Layout.Builder getLayoutBuilder() { + + onChanged(); + return getLayoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + public com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder getLayoutOrBuilder() { + if (layoutBuilder_ != null) { + return layoutBuilder_.getMessageOrBuilder(); + } else { + return layout_ == null + ? com.google.cloud.documentai.v1.Document.Page.Layout.getDefaultInstance() + : layout_; + } + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.Layout, + com.google.cloud.documentai.v1.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder> + getLayoutFieldBuilder() { + if (layoutBuilder_ == null) { + layoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.Layout, + com.google.cloud.documentai.v1.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1.Document.Page.LayoutOrBuilder>( + getLayout(), getParentForChildren(), isClean()); + layout_ = null; + } + return layoutBuilder_; + } + + private com.google.cloud.documentai.v1.Barcode barcode_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Barcode, + com.google.cloud.documentai.v1.Barcode.Builder, + com.google.cloud.documentai.v1.BarcodeOrBuilder> + barcodeBuilder_; + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + public boolean hasBarcode() { + return barcodeBuilder_ != null || barcode_ != null; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + * + * @return The barcode. + */ + public com.google.cloud.documentai.v1.Barcode getBarcode() { + if (barcodeBuilder_ == null) { + return barcode_ == null + ? com.google.cloud.documentai.v1.Barcode.getDefaultInstance() + : barcode_; + } else { + return barcodeBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public Builder setBarcode(com.google.cloud.documentai.v1.Barcode value) { + if (barcodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + barcode_ = value; + onChanged(); + } else { + barcodeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public Builder setBarcode(com.google.cloud.documentai.v1.Barcode.Builder builderForValue) { + if (barcodeBuilder_ == null) { + barcode_ = builderForValue.build(); + onChanged(); + } else { + barcodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public Builder mergeBarcode(com.google.cloud.documentai.v1.Barcode value) { + if (barcodeBuilder_ == null) { + if (barcode_ != null) { + barcode_ = + com.google.cloud.documentai.v1.Barcode.newBuilder(barcode_) + .mergeFrom(value) + .buildPartial(); + } else { + barcode_ = value; + } + onChanged(); + } else { + barcodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public Builder clearBarcode() { + if (barcodeBuilder_ == null) { + barcode_ = null; + onChanged(); + } else { + barcode_ = null; + barcodeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public com.google.cloud.documentai.v1.Barcode.Builder getBarcodeBuilder() { + + onChanged(); + return getBarcodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + public com.google.cloud.documentai.v1.BarcodeOrBuilder getBarcodeOrBuilder() { + if (barcodeBuilder_ != null) { + return barcodeBuilder_.getMessageOrBuilder(); + } else { + return barcode_ == null + ? com.google.cloud.documentai.v1.Barcode.getDefaultInstance() + : barcode_; + } + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1.Barcode barcode = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Barcode, + com.google.cloud.documentai.v1.Barcode.Builder, + com.google.cloud.documentai.v1.BarcodeOrBuilder> + getBarcodeFieldBuilder() { + if (barcodeBuilder_ == null) { + barcodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Barcode, + com.google.cloud.documentai.v1.Barcode.Builder, + com.google.cloud.documentai.v1.BarcodeOrBuilder>( + getBarcode(), getParentForChildren(), isClean()); + barcode_ = null; + } + return barcodeBuilder_; + } + + @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.documentai.v1.Document.Page.DetectedBarcode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Document.Page.DetectedBarcode) + private static final com.google.cloud.documentai.v1.Document.Page.DetectedBarcode + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Document.Page.DetectedBarcode(); + } + + public static com.google.cloud.documentai.v1.Document.Page.DetectedBarcode + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DetectedBarcode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectedBarcode(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.documentai.v1.Document.Page.DetectedBarcode + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public interface DetectedLanguageOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Document.Page.DetectedLanguage) @@ -29870,11 +31232,9 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * 1-based index for current
-     * [Page][google.cloud.documentai.v1.Document.Page] in a parent
-     * [Document][google.cloud.documentai.v1.Document]. Useful when a page is
-     * taken out of a [Document][google.cloud.documentai.v1.Document] for
-     * individual processing.
+     * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document].
+     * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual
+     * processing.
      * 
* * int32 page_number = 1; @@ -30789,6 +32149,90 @@ public com.google.cloud.documentai.v1.Document.Page.SymbolOrBuilder getSymbolsOr return symbols_.get(index); } + public static final int DETECTED_BARCODES_FIELD_NUMBER = 15; + private java.util.List + detectedBarcodes_; + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public java.util.List + getDetectedBarcodesList() { + return detectedBarcodes_; + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesOrBuilderList() { + return detectedBarcodes_; + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public int getDetectedBarcodesCount() { + return detectedBarcodes_.size(); + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode getDetectedBarcodes( + int index) { + return detectedBarcodes_.get(index); + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index) { + return detectedBarcodes_.get(index); + } + public static final int PROVENANCE_FIELD_NUMBER = 16; private com.google.cloud.documentai.v1.Document.Provenance provenance_; /** @@ -30893,6 +32337,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < transforms_.size(); i++) { output.writeMessage(14, transforms_.get(i)); } + for (int i = 0; i < detectedBarcodes_.size(); i++) { + output.writeMessage(15, detectedBarcodes_.get(i)); + } if (provenance_ != null) { output.writeMessage(16, getProvenance()); } @@ -30948,6 +32395,10 @@ public int getSerializedSize() { for (int i = 0; i < transforms_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, transforms_.get(i)); } + for (int i = 0; i < detectedBarcodes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(15, detectedBarcodes_.get(i)); + } if (provenance_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getProvenance()); } @@ -30990,6 +32441,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTablesList().equals(other.getTablesList())) return false; if (!getFormFieldsList().equals(other.getFormFieldsList())) return false; if (!getSymbolsList().equals(other.getSymbolsList())) return false; + if (!getDetectedBarcodesList().equals(other.getDetectedBarcodesList())) return false; if (hasProvenance() != other.hasProvenance()) return false; if (hasProvenance()) { if (!getProvenance().equals(other.getProvenance())) return false; @@ -31059,6 +32511,10 @@ public int hashCode() { hash = (37 * hash) + SYMBOLS_FIELD_NUMBER; hash = (53 * hash) + getSymbolsList().hashCode(); } + if (getDetectedBarcodesCount() > 0) { + hash = (37 * hash) + DETECTED_BARCODES_FIELD_NUMBER; + hash = (53 * hash) + getDetectedBarcodesList().hashCode(); + } if (hasProvenance()) { hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; hash = (53 * hash) + getProvenance().hashCode(); @@ -31215,6 +32671,7 @@ private void maybeForceBuilderInitialization() { getTablesFieldBuilder(); getFormFieldsFieldBuilder(); getSymbolsFieldBuilder(); + getDetectedBarcodesFieldBuilder(); } } @@ -31301,6 +32758,12 @@ public Builder clear() { } else { symbolsBuilder_.clear(); } + if (detectedBarcodesBuilder_ == null) { + detectedBarcodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + } else { + detectedBarcodesBuilder_.clear(); + } if (provenanceBuilder_ == null) { provenance_ = null; } else { @@ -31441,6 +32904,15 @@ public com.google.cloud.documentai.v1.Document.Page buildPartial() { } else { result.symbols_ = symbolsBuilder_.build(); } + if (detectedBarcodesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = java.util.Collections.unmodifiableList(detectedBarcodes_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.detectedBarcodes_ = detectedBarcodes_; + } else { + result.detectedBarcodes_ = detectedBarcodesBuilder_.build(); + } if (provenanceBuilder_ == null) { result.provenance_ = provenance_; } else { @@ -31779,6 +33251,33 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Document.Page other) { } } } + if (detectedBarcodesBuilder_ == null) { + if (!other.detectedBarcodes_.isEmpty()) { + if (detectedBarcodes_.isEmpty()) { + detectedBarcodes_ = other.detectedBarcodes_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.addAll(other.detectedBarcodes_); + } + onChanged(); + } + } else { + if (!other.detectedBarcodes_.isEmpty()) { + if (detectedBarcodesBuilder_.isEmpty()) { + detectedBarcodesBuilder_.dispose(); + detectedBarcodesBuilder_ = null; + detectedBarcodes_ = other.detectedBarcodes_; + bitField0_ = (bitField0_ & ~0x00000400); + detectedBarcodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetectedBarcodesFieldBuilder() + : null; + } else { + detectedBarcodesBuilder_.addAllMessages(other.detectedBarcodes_); + } + } + } if (other.hasProvenance()) { mergeProvenance(other.getProvenance()); } @@ -31818,11 +33317,9 @@ public Builder mergeFrom( * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1.Document]. Useful when a page is
-       * taken out of a [Document][google.cloud.documentai.v1.Document] for
-       * individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -31837,11 +33334,9 @@ public int getPageNumber() { * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1.Document]. Useful when a page is
-       * taken out of a [Document][google.cloud.documentai.v1.Document] for
-       * individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -31859,11 +33354,9 @@ public Builder setPageNumber(int value) { * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1.Document]. Useful when a page is
-       * taken out of a [Document][google.cloud.documentai.v1.Document] for
-       * individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -36231,6 +37724,413 @@ public com.google.cloud.documentai.v1.Document.Page.Symbol.Builder addSymbolsBui return symbolsBuilder_; } + private java.util.List + detectedBarcodes_ = java.util.Collections.emptyList(); + + private void ensureDetectedBarcodesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = + new java.util.ArrayList( + detectedBarcodes_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder> + detectedBarcodesBuilder_; + + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List + getDetectedBarcodesList() { + if (detectedBarcodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(detectedBarcodes_); + } else { + return detectedBarcodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public int getDetectedBarcodesCount() { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.size(); + } else { + return detectedBarcodesBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode getDetectedBarcodes( + int index) { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.get(index); + } else { + return detectedBarcodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder setDetectedBarcodes( + int index, com.google.cloud.documentai.v1.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.set(index, value); + onChanged(); + } else { + detectedBarcodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder setDetectedBarcodes( + int index, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.set(index, builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(value); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + int index, com.google.cloud.documentai.v1.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(index, value); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + int index, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(index, builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addAllDetectedBarcodes( + java.lang.Iterable + values) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, detectedBarcodes_); + onChanged(); + } else { + detectedBarcodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder clearDetectedBarcodes() { + if (detectedBarcodesBuilder_ == null) { + detectedBarcodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + detectedBarcodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder removeDetectedBarcodes(int index) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.remove(index); + onChanged(); + } else { + detectedBarcodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder + getDetectedBarcodesBuilder(int index) { + return getDetectedBarcodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index) { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.get(index); + } else { + return detectedBarcodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesOrBuilderList() { + if (detectedBarcodesBuilder_ != null) { + return detectedBarcodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(detectedBarcodes_); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder + addDetectedBarcodesBuilder() { + return getDetectedBarcodesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder + addDetectedBarcodesBuilder(int index) { + return getDetectedBarcodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List + getDetectedBarcodesBuilderList() { + return getDetectedBarcodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesFieldBuilder() { + if (detectedBarcodesBuilder_ == null) { + detectedBarcodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1.Document.Page.DetectedBarcodeOrBuilder>( + detectedBarcodes_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + detectedBarcodes_ = null; + } + return detectedBarcodesBuilder_; + } + private com.google.cloud.documentai.v1.Document.Provenance provenance_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.documentai.v1.Document.Provenance, @@ -36479,8 +38379,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -36495,8 +38394,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -36511,8 +38409,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -36550,8 +38447,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -36563,8 +38460,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -36615,8 +38512,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -36630,8 +38527,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -36645,8 +38542,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -36686,8 +38583,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -36703,8 +38600,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -36720,8 +38617,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -36737,8 +38634,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -36750,8 +38647,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -36763,8 +38660,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -36776,8 +38673,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -36790,8 +38687,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -36845,8 +38742,7 @@ public interface EntityOrBuilder * * *
-     * Optional. Whether the entity will be redacted for de-identification
-     * purposes.
+     * Optional. Whether the entity will be redacted for de-identification purposes.
      * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -37257,6 +39153,56 @@ public interface NormalizedValueOrBuilder */ boolean getBooleanValue(); + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + boolean hasIntegerValue(); + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + int getIntegerValue(); + + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + boolean hasFloatValue(); + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + float getFloatValue(); + /** * * @@ -37426,6 +39372,18 @@ private NormalizedValue( structuredValueCase_ = 6; break; } + case 56: + { + structuredValue_ = input.readInt32(); + structuredValueCase_ = 7; + break; + } + case 69: + { + structuredValue_ = input.readFloat(); + structuredValueCase_ = 8; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -37475,6 +39433,8 @@ public enum StructuredValueCase DATETIME_VALUE(4), ADDRESS_VALUE(5), BOOLEAN_VALUE(6), + INTEGER_VALUE(7), + FLOAT_VALUE(8), STRUCTUREDVALUE_NOT_SET(0); private final int value; @@ -37503,6 +39463,10 @@ public static StructuredValueCase forNumber(int value) { return ADDRESS_VALUE; case 6: return BOOLEAN_VALUE; + case 7: + return INTEGER_VALUE; + case 8: + return FLOAT_VALUE; case 0: return STRUCTUREDVALUE_NOT_SET; default: @@ -37772,6 +39736,76 @@ public boolean getBooleanValue() { return false; } + public static final int INTEGER_VALUE_FIELD_NUMBER = 7; + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + @java.lang.Override + public boolean hasIntegerValue() { + return structuredValueCase_ == 7; + } + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + @java.lang.Override + public int getIntegerValue() { + if (structuredValueCase_ == 7) { + return (java.lang.Integer) structuredValue_; + } + return 0; + } + + public static final int FLOAT_VALUE_FIELD_NUMBER = 8; + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + @java.lang.Override + public boolean hasFloatValue() { + return structuredValueCase_ == 8; + } + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + @java.lang.Override + public float getFloatValue() { + if (structuredValueCase_ == 8) { + return (java.lang.Float) structuredValue_; + } + return 0F; + } + public static final int TEXT_FIELD_NUMBER = 1; private volatile java.lang.Object text_; /** @@ -37869,6 +39903,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (structuredValueCase_ == 6) { output.writeBool(6, (boolean) ((java.lang.Boolean) structuredValue_)); } + if (structuredValueCase_ == 7) { + output.writeInt32(7, (int) ((java.lang.Integer) structuredValue_)); + } + if (structuredValueCase_ == 8) { + output.writeFloat(8, (float) ((java.lang.Float) structuredValue_)); + } unknownFields.writeTo(output); } @@ -37906,6 +39946,16 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 6, (boolean) ((java.lang.Boolean) structuredValue_)); } + if (structuredValueCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 7, (int) ((java.lang.Integer) structuredValue_)); + } + if (structuredValueCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 8, (float) ((java.lang.Float) structuredValue_)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -37940,6 +39990,13 @@ public boolean equals(final java.lang.Object obj) { case 6: if (getBooleanValue() != other.getBooleanValue()) return false; break; + case 7: + if (getIntegerValue() != other.getIntegerValue()) return false; + break; + case 8: + if (java.lang.Float.floatToIntBits(getFloatValue()) + != java.lang.Float.floatToIntBits(other.getFloatValue())) return false; + break; case 0: default: } @@ -37977,6 +40034,14 @@ public int hashCode() { hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBooleanValue()); break; + case 7: + hash = (37 * hash) + INTEGER_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getIntegerValue(); + break; + case 8: + hash = (37 * hash) + FLOAT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFloatValue()); + break; case 0: default: } @@ -38195,6 +40260,12 @@ public com.google.cloud.documentai.v1.Document.Entity.NormalizedValue buildParti if (structuredValueCase_ == 6) { result.structuredValue_ = structuredValue_; } + if (structuredValueCase_ == 7) { + result.structuredValue_ = structuredValue_; + } + if (structuredValueCase_ == 8) { + result.structuredValue_ = structuredValue_; + } result.text_ = text_; result.structuredValueCase_ = structuredValueCase_; onBuilt(); @@ -38282,6 +40353,16 @@ public Builder mergeFrom( setBooleanValue(other.getBooleanValue()); break; } + case INTEGER_VALUE: + { + setIntegerValue(other.getIntegerValue()); + break; + } + case FLOAT_VALUE: + { + setFloatValue(other.getFloatValue()); + break; + } case STRUCTUREDVALUE_NOT_SET: { break; @@ -39264,6 +41345,144 @@ public Builder clearBooleanValue() { return this; } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + public boolean hasIntegerValue() { + return structuredValueCase_ == 7; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + public int getIntegerValue() { + if (structuredValueCase_ == 7) { + return (java.lang.Integer) structuredValue_; + } + return 0; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @param value The integerValue to set. + * @return This builder for chaining. + */ + public Builder setIntegerValue(int value) { + structuredValueCase_ = 7; + structuredValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return This builder for chaining. + */ + public Builder clearIntegerValue() { + if (structuredValueCase_ == 7) { + structuredValueCase_ = 0; + structuredValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + public boolean hasFloatValue() { + return structuredValueCase_ == 8; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + public float getFloatValue() { + if (structuredValueCase_ == 8) { + return (java.lang.Float) structuredValue_; + } + return 0F; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @param value The floatValue to set. + * @return This builder for chaining. + */ + public Builder setFloatValue(float value) { + structuredValueCase_ = 8; + structuredValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return This builder for chaining. + */ + public Builder clearFloatValue() { + if (structuredValueCase_ == 8) { + structuredValueCase_ = 0; + structuredValue_ = null; + onChanged(); + } + return this; + } + private java.lang.Object text_ = ""; /** * @@ -39472,8 +41691,7 @@ public com.google.protobuf.Parser getParserForType() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -39491,8 +41709,7 @@ public boolean hasTextAnchor() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -39512,8 +41729,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * @@ -39580,8 +41796,8 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -39604,8 +41820,8 @@ public java.lang.String getMentionText() { * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -39698,8 +41914,8 @@ public float getConfidence() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -39716,8 +41932,8 @@ public boolean hasPageAnchor() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -39736,8 +41952,8 @@ public com.google.cloud.documentai.v1.Document.PageAnchor getPageAnchor() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -39806,8 +42022,8 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -39826,8 +42042,8 @@ public boolean hasNormalizedValue() { * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -39848,8 +42064,8 @@ public com.google.cloud.documentai.v1.Document.Entity.NormalizedValue getNormali * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -39870,8 +42086,8 @@ public com.google.cloud.documentai.v1.Document.Entity.NormalizedValue getNormali * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -39886,8 +42102,8 @@ public java.util.List getPropert * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -39903,8 +42119,8 @@ public java.util.List getPropert * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -39919,8 +42135,8 @@ public int getPropertiesCount() { * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -39935,8 +42151,8 @@ public com.google.cloud.documentai.v1.Document.Entity getProperties(int index) { * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40009,8 +42225,7 @@ public com.google.cloud.documentai.v1.Document.ProvenanceOrBuilder getProvenance * * *
-     * Optional. Whether the entity will be redacted for de-identification
-     * purposes.
+     * Optional. Whether the entity will be redacted for de-identification purposes.
      * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -40605,8 +42820,7 @@ public Builder mergeFrom( * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40623,8 +42837,7 @@ public boolean hasTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40647,8 +42860,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40673,8 +42885,7 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40697,8 +42908,7 @@ public Builder setTextAnchor( * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40727,8 +42937,7 @@ public Builder mergeTextAnchor(com.google.cloud.documentai.v1.Document.TextAncho * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40751,8 +42960,7 @@ public Builder clearTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40769,8 +42977,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40791,8 +42998,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchor * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -40927,8 +43133,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -40950,8 +43156,8 @@ public java.lang.String getMentionText() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -40973,8 +43179,8 @@ public com.google.protobuf.ByteString getMentionTextBytes() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -40995,8 +43201,8 @@ public Builder setMentionText(java.lang.String value) { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41013,8 +43219,8 @@ public Builder clearMentionText() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41201,8 +43407,8 @@ public Builder clearConfidence() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41218,8 +43424,8 @@ public boolean hasPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41241,8 +43447,8 @@ public com.google.cloud.documentai.v1.Document.PageAnchor getPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41266,8 +43472,8 @@ public Builder setPageAnchor(com.google.cloud.documentai.v1.Document.PageAnchor * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41289,8 +43495,8 @@ public Builder setPageAnchor( * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41318,8 +43524,8 @@ public Builder mergePageAnchor(com.google.cloud.documentai.v1.Document.PageAncho * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41341,8 +43547,8 @@ public Builder clearPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41358,8 +43564,8 @@ public com.google.cloud.documentai.v1.Document.PageAnchor.Builder getPageAnchorB * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41379,8 +43585,8 @@ public com.google.cloud.documentai.v1.Document.PageAnchorOrBuilder getPageAnchor * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41525,8 +43731,8 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41544,8 +43750,8 @@ public boolean hasNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41569,8 +43775,8 @@ public com.google.cloud.documentai.v1.Document.Entity.NormalizedValue getNormali * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41597,8 +43803,8 @@ public Builder setNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41622,8 +43828,8 @@ public Builder setNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41655,8 +43861,8 @@ public Builder mergeNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41680,8 +43886,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41700,8 +43906,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41724,8 +43930,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -41772,8 +43978,8 @@ private void ensurePropertiesIsMutable() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41791,8 +43997,8 @@ public java.util.List getPropert * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41810,8 +44016,8 @@ public int getPropertiesCount() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41829,8 +44035,8 @@ public com.google.cloud.documentai.v1.Document.Entity getProperties(int index) { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41855,8 +44061,8 @@ public Builder setProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41878,8 +44084,8 @@ public Builder setProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41903,8 +44109,8 @@ public Builder addProperties(com.google.cloud.documentai.v1.Document.Entity valu * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41929,8 +44135,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41952,8 +44158,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41975,8 +44181,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -41998,8 +44204,8 @@ public Builder addAllProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42020,8 +44226,8 @@ public Builder clearProperties() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42042,8 +44248,8 @@ public Builder removeProperties(int index) { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42058,8 +44264,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder getPropertiesBuild * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42078,8 +44284,8 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getPropertiesOrBu * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42098,8 +44304,8 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getPropertiesOrBu * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42114,8 +44320,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder addPropertiesBuild * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42131,8 +44337,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder addPropertiesBuild * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42370,8 +44576,7 @@ public com.google.cloud.documentai.v1.Document.ProvenanceOrBuilder getProvenance * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -42386,8 +44591,7 @@ public boolean getRedacted() { * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -42405,8 +44609,7 @@ public Builder setRedacted(boolean value) { * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -42556,8 +44759,7 @@ public interface EntityRelationOrBuilder * * *
-   * Relationship between
-   * [Entities][google.cloud.documentai.v1.Document.Entity].
+   * Relationship between [Entities][google.cloud.documentai.v1.Document.Entity].
    * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.EntityRelation} @@ -42994,8 +45196,7 @@ protected Builder newBuilderForType( * * *
-     * Relationship between
-     * [Entities][google.cloud.documentai.v1.Document.Entity].
+     * Relationship between [Entities][google.cloud.documentai.v1.Document.Entity].
      * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.EntityRelation} @@ -43546,8 +45747,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -43559,8 +45759,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -43571,8 +45770,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -43583,8 +45781,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -43597,8 +45794,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -43640,8 +45836,7 @@ public interface TextAnchorOrBuilder * * *
-   * Text reference indexing into the
-   * [Document.text][google.cloud.documentai.v1.Document.text].
+   * Text reference indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.TextAnchor} @@ -43760,9 +45955,7 @@ public interface TextSegmentOrBuilder * * *
-       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-       * start UTF-8 char index in the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * int64 start_index = 1; @@ -43775,8 +45968,7 @@ public interface TextSegmentOrBuilder * * *
-       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-       * half open end UTF-8 char index in the
+       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
        * [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* @@ -43790,11 +45982,9 @@ public interface TextSegmentOrBuilder * * *
-     * A text segment in the
-     * [Document.text][google.cloud.documentai.v1.Document.text]. The indices
-     * may be out of bounds which indicate that the text extends into another
-     * document shard for large sharded documents. See
-     * [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
+     * A text segment in the [Document.text][google.cloud.documentai.v1.Document.text]. The indices may be out of bounds
+     * which indicate that the text extends into another document shard for
+     * large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
      * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.TextAnchor.TextSegment} @@ -43893,9 +46083,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-       * start UTF-8 char index in the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * int64 start_index = 1; @@ -43913,8 +46101,7 @@ public long getStartIndex() { * * *
-       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-       * half open end UTF-8 char index in the
+       * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
        * [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* @@ -44103,11 +46290,9 @@ protected Builder newBuilderForType( * * *
-       * A text segment in the
-       * [Document.text][google.cloud.documentai.v1.Document.text]. The indices
-       * may be out of bounds which indicate that the text extends into another
-       * document shard for large sharded documents. See
-       * [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
+       * A text segment in the [Document.text][google.cloud.documentai.v1.Document.text]. The indices may be out of bounds
+       * which indicate that the text extends into another document shard for
+       * large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
        * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.TextAnchor.TextSegment} @@ -44282,9 +46467,7 @@ public Builder mergeFrom( * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * int64 start_index = 1; @@ -44299,9 +46482,7 @@ public long getStartIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * int64 start_index = 1; @@ -44319,9 +46500,7 @@ public Builder setStartIndex(long value) { * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1.Document.text].
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* * int64 start_index = 1; @@ -44340,8 +46519,7 @@ public Builder clearStartIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* @@ -44357,8 +46535,7 @@ public long getEndIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* @@ -44377,8 +46554,7 @@ public Builder setEndIndex(long value) { * * *
-         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1.Document.text].
          * 
* @@ -44455,8 +46631,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -44471,8 +46646,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -44488,8 +46662,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -44503,8 +46676,7 @@ public int getTextSegmentsCount() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -44519,8 +46691,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.TextSegment getTextSeg * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; @@ -44760,8 +46931,7 @@ protected Builder newBuilderForType( * * *
-     * Text reference indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * Text reference indexing into the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.TextAnchor} @@ -44988,8 +47158,7 @@ private void ensureTextSegmentsIsMutable() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45008,8 +47177,7 @@ private void ensureTextSegmentsIsMutable() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45027,8 +47195,7 @@ public int getTextSegmentsCount() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45047,8 +47214,7 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.TextSegment getTextSeg * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45073,8 +47239,7 @@ public Builder setTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45097,8 +47262,7 @@ public Builder setTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45123,8 +47287,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45149,8 +47312,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45172,8 +47334,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45196,8 +47357,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45221,8 +47381,7 @@ public Builder addAllTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45243,8 +47402,7 @@ public Builder clearTextSegments() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45265,8 +47423,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45281,8 +47438,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45301,8 +47457,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45322,8 +47477,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45341,8 +47495,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45361,8 +47514,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text].
        * 
* * @@ -45624,10 +47776,9 @@ com.google.cloud.documentai.v1.Document.PageAnchor.PageRefOrBuilder getPageRefsO * * *
-   * Referencing the visual context of the entity in the
-   * [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors
-   * can be cross-page, consist of multiple bounding polygons and optionally
-   * reference specific layout element types.
+   * Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1.Document.pages].
+   * Page anchors can be cross-page, consist of multiple bounding polygons and
+   * optionally reference specific layout element types.
    * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.PageAnchor} @@ -45738,11 +47889,9 @@ public interface PageRefOrBuilder * * *
-       * Required. Index into the
-       * [Document.pages][google.cloud.documentai.v1.Document.pages] element,
-       * for example using [Document.pages][page_refs.page] to locate the
-       * related page element. This field is skipped when its value is the
-       * default 0. See
+       * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using
+       * [Document.pages][page_refs.page] to locate the related page element.
+       * This field is skipped when its value is the default 0. See
        * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* @@ -45756,8 +47905,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -45771,8 +47919,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -45787,16 +47934,14 @@ public interface PageRefOrBuilder * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is deprecated. - * See google/cloud/documentai/v1/document.proto;l=623 + * See google/cloud/documentai/v1/document.proto;l=599 * @return The layoutId. */ @java.lang.Deprecated @@ -45805,16 +47950,14 @@ public interface PageRefOrBuilder * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is deprecated. - * See google/cloud/documentai/v1/document.proto;l=623 + * See google/cloud/documentai/v1/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Deprecated @@ -45824,8 +47967,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -45839,8 +47981,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -45854,8 +47995,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -45868,8 +48008,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Confidence of detected page element, if applicable. Range [0,
-       * 1].
+       * Optional. Confidence of detected page element, if applicable. Range [0, 1].
        * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -46032,9 +48171,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks]
-         * element.
+         * References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element.
          * 
* * BLOCK = 1; @@ -46044,9 +48181,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs]
-         * element.
+         * References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element.
          * 
* * PARAGRAPH = 2; @@ -46056,8 +48191,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
+         * References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
          * 
* * LINE = 3; @@ -46067,9 +48201,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens]
-         * element.
+         * References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element.
          * 
* * TOKEN = 4; @@ -46079,9 +48211,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements]
-         * element.
+         * References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element.
          * 
* * VISUAL_ELEMENT = 5; @@ -46091,9 +48221,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * Refrrences a
-         * [Page.tables][google.cloud.documentai.v1.Document.Page.tables]
-         * element.
+         * Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element.
          * 
* * TABLE = 6; @@ -46103,9 +48231,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields]
-         * element.
+         * References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element.
          * 
* * FORM_FIELD = 7; @@ -46128,9 +48254,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks]
-         * element.
+         * References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element.
          * 
* * BLOCK = 1; @@ -46140,9 +48264,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs]
-         * element.
+         * References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element.
          * 
* * PARAGRAPH = 2; @@ -46152,8 +48274,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
+         * References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
          * 
* * LINE = 3; @@ -46163,9 +48284,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens]
-         * element.
+         * References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element.
          * 
* * TOKEN = 4; @@ -46175,9 +48294,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements]
-         * element.
+         * References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element.
          * 
* * VISUAL_ELEMENT = 5; @@ -46187,9 +48304,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * Refrrences a
-         * [Page.tables][google.cloud.documentai.v1.Document.Page.tables]
-         * element.
+         * Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element.
          * 
* * TABLE = 6; @@ -46199,9 +48314,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields]
-         * element.
+         * References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element.
          * 
* * FORM_FIELD = 7; @@ -46310,11 +48423,9 @@ private LayoutType(int value) { * * *
-       * Required. Index into the
-       * [Document.pages][google.cloud.documentai.v1.Document.pages] element,
-       * for example using [Document.pages][page_refs.page] to locate the
-       * related page element. This field is skipped when its value is the
-       * default 0. See
+       * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using
+       * [Document.pages][page_refs.page] to locate the related page element.
+       * This field is skipped when its value is the default 0. See
        * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* @@ -46333,8 +48444,7 @@ public long getPage() { * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -46351,8 +48461,7 @@ public int getLayoutTypeValue() { * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -46378,16 +48487,14 @@ public com.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType get * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is deprecated. - * See google/cloud/documentai/v1/document.proto;l=623 + * See google/cloud/documentai/v1/document.proto;l=599 * @return The layoutId. */ @java.lang.Override @@ -46407,16 +48514,14 @@ public java.lang.String getLayoutId() { * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is deprecated. - * See google/cloud/documentai/v1/document.proto;l=623 + * See google/cloud/documentai/v1/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Override @@ -46439,8 +48544,7 @@ public com.google.protobuf.ByteString getLayoutIdBytes() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46457,8 +48561,7 @@ public boolean hasBoundingPoly() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46477,8 +48580,7 @@ public com.google.cloud.documentai.v1.BoundingPoly getBoundingPoly() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46496,8 +48598,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-       * Optional. Confidence of detected page element, if applicable. Range [0,
-       * 1].
+       * Optional. Confidence of detected page element, if applicable. Range [0, 1].
        * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -46920,11 +49021,9 @@ public Builder mergeFrom( * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1.Document.pages] element,
-         * for example using [Document.pages][page_refs.page] to locate the
-         * related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -46940,11 +49039,9 @@ public long getPage() { * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1.Document.pages] element,
-         * for example using [Document.pages][page_refs.page] to locate the
-         * related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -46963,11 +49060,9 @@ public Builder setPage(long value) { * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1.Document.pages] element,
-         * for example using [Document.pages][page_refs.page] to locate the
-         * related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -46987,8 +49082,7 @@ public Builder clearPage() { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47005,8 +49099,7 @@ public int getLayoutTypeValue() { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47026,8 +49119,7 @@ public Builder setLayoutTypeValue(int value) { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47051,8 +49143,7 @@ public Builder setLayoutTypeValue(int value) { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47076,8 +49167,7 @@ public Builder setLayoutType( * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47098,16 +49188,14 @@ public Builder clearLayoutType() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1/document.proto;l=623 + * deprecated. See google/cloud/documentai/v1/document.proto;l=599 * @return The layoutId. */ @java.lang.Deprecated @@ -47126,16 +49214,14 @@ public java.lang.String getLayoutId() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1/document.proto;l=623 + * deprecated. See google/cloud/documentai/v1/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Deprecated @@ -47154,16 +49240,14 @@ public com.google.protobuf.ByteString getLayoutIdBytes() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1/document.proto;l=623 + * deprecated. See google/cloud/documentai/v1/document.proto;l=599 * @param value The layoutId to set. * @return This builder for chaining. */ @@ -47181,16 +49265,14 @@ public Builder setLayoutId(java.lang.String value) { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1/document.proto;l=623 + * deprecated. See google/cloud/documentai/v1/document.proto;l=599 * @return This builder for chaining. */ @java.lang.Deprecated @@ -47204,16 +49286,14 @@ public Builder clearLayoutId() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1/document.proto;l=623 + * deprecated. See google/cloud/documentai/v1/document.proto;l=599 * @param value The bytes for layoutId to set. * @return This builder for chaining. */ @@ -47239,8 +49319,7 @@ public Builder setLayoutIdBytes(com.google.protobuf.ByteString value) { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47256,8 +49335,7 @@ public boolean hasBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47279,8 +49357,7 @@ public com.google.cloud.documentai.v1.BoundingPoly getBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47304,8 +49381,7 @@ public Builder setBoundingPoly(com.google.cloud.documentai.v1.BoundingPoly value * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47327,8 +49403,7 @@ public Builder setBoundingPoly( * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47356,8 +49431,7 @@ public Builder mergeBoundingPoly(com.google.cloud.documentai.v1.BoundingPoly val * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47379,8 +49453,7 @@ public Builder clearBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47396,8 +49469,7 @@ public com.google.cloud.documentai.v1.BoundingPoly.Builder getBoundingPolyBuilde * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47417,8 +49489,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47447,8 +49518,7 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -47463,8 +49533,7 @@ public float getConfidence() { * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -47482,8 +49551,7 @@ public Builder setConfidence(float value) { * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -47790,10 +49858,9 @@ protected Builder newBuilderForType( * * *
-     * Referencing the visual context of the entity in the
-     * [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors
-     * can be cross-page, consist of multiple bounding polygons and optionally
-     * reference specific layout element types.
+     * Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1.Document.pages].
+     * Page anchors can be cross-page, consist of multiple bounding polygons and
+     * optionally reference specific layout element types.
      * 
* * Protobuf type {@code google.cloud.documentai.v1.Document.PageAnchor} @@ -48456,7 +50523,7 @@ public interface ProvenanceOrBuilder * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=687 + * google/cloud/documentai/v1/document.proto;l=663 * @return The id. */ @java.lang.Deprecated @@ -48960,7 +51027,7 @@ public interface ParentOrBuilder * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.Parent.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=653 + * google/cloud/documentai/v1/document.proto;l=629 * @return The id. */ @java.lang.Deprecated @@ -49118,7 +51185,7 @@ public int getIndex() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.Parent.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=653 + * google/cloud/documentai/v1/document.proto;l=629 * @return The id. */ @java.lang.Override @@ -49601,7 +51668,7 @@ public Builder clearIndex() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.Parent.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=653 + * google/cloud/documentai/v1/document.proto;l=629 * @return The id. */ @java.lang.Override @@ -49619,7 +51686,7 @@ public int getId() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.Parent.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=653 + * google/cloud/documentai/v1/document.proto;l=629 * @param value The id to set. * @return This builder for chaining. */ @@ -49640,7 +51707,7 @@ public Builder setId(int value) { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.Parent.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=653 + * google/cloud/documentai/v1/document.proto;l=629 * @return This builder for chaining. */ @java.lang.Deprecated @@ -49735,7 +51802,7 @@ public int getRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=687 + * google/cloud/documentai/v1/document.proto;l=663 * @return The id. */ @java.lang.Override @@ -50334,7 +52401,7 @@ public Builder clearRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=687 + * google/cloud/documentai/v1/document.proto;l=663 * @return The id. */ @java.lang.Override @@ -50353,7 +52420,7 @@ public int getId() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=687 + * google/cloud/documentai/v1/document.proto;l=663 * @param value The id to set. * @return This builder for chaining. */ @@ -50375,7 +52442,7 @@ public Builder setId(int value) { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=687 + * google/cloud/documentai/v1/document.proto;l=663 * @return This builder for chaining. */ @java.lang.Deprecated @@ -51016,10 +53083,13 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return A list containing the parent. */ + @java.lang.Deprecated java.util.List getParentList(); /** * @@ -51030,10 +53100,13 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated int getParentCount(); /** * @@ -51044,13 +53117,75 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated int getParent(int index); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + java.util.List getParentIdsList(); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + int getParentIdsCount(); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + java.lang.String getParentIds(int index); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + com.google.protobuf.ByteString getParentIdsBytes(int index); + /** * * @@ -51145,6 +53280,7 @@ private Revision(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Revision() { id_ = ""; parent_ = emptyIntList(); + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -51252,6 +53388,16 @@ private Revision( humanReview_ = subBuilder.buildPartial(); } + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + parentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + parentIds_.add(s); break; } default: @@ -51273,6 +53419,9 @@ private Revision( if (((mutable_bitField0_ & 0x00000001) != 0)) { parent_.makeImmutable(); // C } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + parentIds_ = parentIds_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -52422,11 +54571,14 @@ public com.google.protobuf.ByteString getIdBytes() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return A list containing the parent. */ @java.lang.Override + @java.lang.Deprecated public java.util.List getParentList() { return parent_; } @@ -52439,10 +54591,13 @@ public java.util.List getParentList() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated public int getParentCount() { return parent_.size(); } @@ -52455,17 +54610,89 @@ public int getParentCount() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated public int getParent(int index) { return parent_.getInt(index); } private int parentMemoizedSerializedSize = -1; + public static final int PARENT_IDS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList parentIds_; + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + public com.google.protobuf.ProtocolStringList getParentIdsList() { + return parentIds_; + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + public int getParentIdsCount() { + return parentIds_.size(); + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + public java.lang.String getParentIds(int index) { + return parentIds_.get(index); + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + public com.google.protobuf.ByteString getParentIdsBytes(int index) { + return parentIds_.getByteString(index); + } + public static final int CREATE_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp createTime_; /** @@ -52598,6 +54825,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (humanReview_ != null) { output.writeMessage(6, getHumanReview()); } + for (int i = 0; i < parentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, parentIds_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -52635,6 +54865,14 @@ public int getSerializedSize() { if (humanReview_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getHumanReview()); } + { + int dataSize = 0; + for (int i = 0; i < parentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(parentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getParentIdsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -52653,6 +54891,7 @@ public boolean equals(final java.lang.Object obj) { if (!getId().equals(other.getId())) return false; if (!getParentList().equals(other.getParentList())) return false; + if (!getParentIdsList().equals(other.getParentIdsList())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -52689,6 +54928,10 @@ public int hashCode() { hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParentList().hashCode(); } + if (getParentIdsCount() > 0) { + hash = (37 * hash) + PARENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getParentIdsList().hashCode(); + } if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -52860,6 +55103,8 @@ public Builder clear() { parent_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000001); + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -52914,6 +55159,11 @@ public com.google.cloud.documentai.v1.Document.Revision buildPartial() { bitField0_ = (bitField0_ & ~0x00000001); } result.parent_ = parent_; + if (((bitField0_ & 0x00000002) != 0)) { + parentIds_ = parentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parentIds_ = parentIds_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -52991,6 +55241,16 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Document.Revision other) } onChanged(); } + if (!other.parentIds_.isEmpty()) { + if (parentIds_.isEmpty()) { + parentIds_ = other.parentIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureParentIdsIsMutable(); + parentIds_.addAll(other.parentIds_); + } + onChanged(); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -53466,10 +55726,13 @@ private void ensureParentIsMutable() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return A list containing the parent. */ + @java.lang.Deprecated public java.util.List getParentList() { return ((bitField0_ & 0x00000001) != 0) ? java.util.Collections.unmodifiableList(parent_) @@ -53484,10 +55747,13 @@ public java.util.List getParentList() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated public int getParentCount() { return parent_.size(); } @@ -53500,11 +55766,14 @@ public int getParentCount() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated public int getParent(int index) { return parent_.getInt(index); } @@ -53517,12 +55786,15 @@ public int getParent(int index) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param index The index to set the value at. * @param value The parent to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setParent(int index, int value) { ensureParentIsMutable(); parent_.setInt(index, value); @@ -53538,11 +55810,14 @@ public Builder setParent(int index, int value) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param value The parent to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addParent(int value) { ensureParentIsMutable(); parent_.addInt(value); @@ -53558,11 +55833,14 @@ public Builder addParent(int value) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @param values The parent to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllParent(java.lang.Iterable values) { ensureParentIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parent_); @@ -53578,10 +55856,13 @@ public Builder addAllParent(java.lang.Iterable valu * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1/document.proto;l=701 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearParent() { parent_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000001); @@ -53589,6 +55870,192 @@ public Builder clearParent() { return this; } + private com.google.protobuf.LazyStringList parentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureParentIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parentIds_ = new com.google.protobuf.LazyStringArrayList(parentIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + public com.google.protobuf.ProtocolStringList getParentIdsList() { + return parentIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + public int getParentIdsCount() { + return parentIds_.size(); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + public java.lang.String getParentIds(int index) { + return parentIds_.get(index); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + public com.google.protobuf.ByteString getParentIdsBytes(int index) { + return parentIds_.getByteString(index); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index to set the value at. + * @param value The parentIds to set. + * @return This builder for chaining. + */ + public Builder setParentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParentIdsIsMutable(); + parentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param value The parentIds to add. + * @return This builder for chaining. + */ + public Builder addParentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParentIdsIsMutable(); + parentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param values The parentIds to add. + * @return This builder for chaining. + */ + public Builder addAllParentIds(java.lang.Iterable values) { + ensureParentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parentIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return This builder for chaining. + */ + public Builder clearParentIds() { + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param value The bytes of the parentIds to add. + * @return This builder for chaining. + */ + public Builder addParentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureParentIdsIsMutable(); + parentIds_.add(value); + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -54027,9 +56494,8 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54044,9 +56510,8 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54061,9 +56526,8 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54286,9 +56750,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54306,9 +56769,8 @@ public boolean hasTextAnchor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54328,9 +56790,8 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-     * only be a single `TextAnchor.text_segments` element.  If the start and
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
      * end index of the text segment are the same, the text change is inserted
      * before that index.
      * 
@@ -54880,9 +57341,8 @@ public Builder mergeFrom( * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -54899,9 +57359,8 @@ public boolean hasTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -54924,9 +57383,8 @@ public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -54951,9 +57409,8 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -54976,9 +57433,8 @@ public Builder setTextAnchor( * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -55007,9 +57463,8 @@ public Builder mergeTextAnchor(com.google.cloud.documentai.v1.Document.TextAncho * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -55032,9 +57487,8 @@ public Builder clearTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -55051,9 +57505,8 @@ public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorB * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -55074,9 +57527,8 @@ public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchor * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1.Document.text].  There can
-       * only be a single `TextAnchor.text_segments` element.  If the start and
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
        * end index of the text segment are the same, the text change is inserted
        * before that index.
        * 
@@ -55893,7 +58345,7 @@ public com.google.protobuf.ByteString getTextBytes() { * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -55906,7 +58358,7 @@ public java.util.List getTextStyl * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -55920,7 +58372,7 @@ public java.util.List getTextStyl * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -55933,7 +58385,7 @@ public int getTextStylesCount() { * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -55946,7 +58398,7 @@ public com.google.cloud.documentai.v1.Document.Style getTextStyles(int index) { * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -56031,9 +58483,8 @@ public com.google.cloud.documentai.v1.Document.PageOrBuilder getPagesOrBuilder(i * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -56046,9 +58497,8 @@ public java.util.List getEntitie * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -56062,9 +58512,8 @@ public java.util.List getEntitie * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -56077,9 +58526,8 @@ public int getEntitiesCount() { * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -56092,9 +58540,8 @@ public com.google.cloud.documentai.v1.Document.Entity getEntities(int index) { * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -56110,8 +58557,7 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getEntitiesOrBuil * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -56125,8 +58571,7 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getEntitiesOrBuil * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -56140,8 +58585,7 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getEntitiesOrBuil * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -56154,8 +58598,7 @@ public int getEntityRelationsCount() { * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -56168,8 +58611,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation getEntityRelations * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -56186,9 +58628,9 @@ public com.google.cloud.documentai.v1.Document.EntityRelation getEntityRelations * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -56201,9 +58643,9 @@ public java.util.List getTex * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -56217,9 +58659,9 @@ public java.util.List getTex * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -56232,9 +58674,9 @@ public int getTextChangesCount() { * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -56247,9 +58689,9 @@ public com.google.cloud.documentai.v1.Document.TextChange getTextChanges(int ind * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -56363,7 +58805,7 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -56376,7 +58818,7 @@ public java.util.List getRevis * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -56390,7 +58832,7 @@ public java.util.List getRevis * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -56403,7 +58845,7 @@ public int getRevisionsCount() { * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -56416,7 +58858,7 @@ public com.google.cloud.documentai.v1.Document.Revision getRevisions(int index) * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -56729,11 +59171,10 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Document represents the canonical document resource in Document Understanding
-   * AI.
-   * It is an interchange format that provides insights into documents and allows
-   * for collaboration between users and Document Understanding AI to iterate and
-   * optimize for quality.
+   * Document represents the canonical document resource in Document AI. It is an
+   * interchange format that provides insights into documents and allows for
+   * collaboration between users and Document AI to iterate and optimize for
+   * quality.
    * 
* * Protobuf type {@code google.cloud.documentai.v1.Document} @@ -57705,7 +60146,7 @@ private void ensureTextStylesIsMutable() { * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57721,7 +60162,7 @@ public java.util.List getTextStyl * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57737,7 +60178,7 @@ public int getTextStylesCount() { * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57753,7 +60194,7 @@ public com.google.cloud.documentai.v1.Document.Style getTextStyles(int index) { * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57775,7 +60216,7 @@ public Builder setTextStyles(int index, com.google.cloud.documentai.v1.Document. * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57795,7 +60236,7 @@ public Builder setTextStyles( * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57817,7 +60258,7 @@ public Builder addTextStyles(com.google.cloud.documentai.v1.Document.Style value * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57839,7 +60280,7 @@ public Builder addTextStyles(int index, com.google.cloud.documentai.v1.Document. * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57859,7 +60300,7 @@ public Builder addTextStyles( * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57879,7 +60320,7 @@ public Builder addTextStyles( * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57899,7 +60340,7 @@ public Builder addAllTextStyles( * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57918,7 +60359,7 @@ public Builder clearTextStyles() { * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57937,7 +60378,7 @@ public Builder removeTextStyles(int index) { * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57949,7 +60390,7 @@ public com.google.cloud.documentai.v1.Document.Style.Builder getTextStylesBuilde * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57966,7 +60407,7 @@ public com.google.cloud.documentai.v1.Document.StyleOrBuilder getTextStylesOrBui * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57983,7 +60424,7 @@ public com.google.cloud.documentai.v1.Document.StyleOrBuilder getTextStylesOrBui * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -57996,7 +60437,7 @@ public com.google.cloud.documentai.v1.Document.Style.Builder addTextStylesBuilde * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -58009,7 +60450,7 @@ public com.google.cloud.documentai.v1.Document.Style.Builder addTextStylesBuilde * * *
-     * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
      * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -58406,9 +60847,8 @@ private void ensureEntitiesIsMutable() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58424,9 +60864,8 @@ public java.util.List getEntitie * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58442,9 +60881,8 @@ public int getEntitiesCount() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58460,9 +60898,8 @@ public com.google.cloud.documentai.v1.Document.Entity getEntities(int index) { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58484,9 +60921,8 @@ public Builder setEntities(int index, com.google.cloud.documentai.v1.Document.En * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58506,9 +60942,8 @@ public Builder setEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58530,9 +60965,8 @@ public Builder addEntities(com.google.cloud.documentai.v1.Document.Entity value) * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58554,9 +60988,8 @@ public Builder addEntities(int index, com.google.cloud.documentai.v1.Document.En * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58576,9 +61009,8 @@ public Builder addEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58598,9 +61030,8 @@ public Builder addEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58620,9 +61051,8 @@ public Builder addAllEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58641,9 +61071,8 @@ public Builder clearEntities() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58662,9 +61091,8 @@ public Builder removeEntities(int index) { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58676,9 +61104,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder getEntitiesBuilder * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58694,9 +61121,8 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getEntitiesOrBuil * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58713,9 +61139,8 @@ public com.google.cloud.documentai.v1.Document.EntityOrBuilder getEntitiesOrBuil * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58728,9 +61153,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder addEntitiesBuilder * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58743,9 +61167,8 @@ public com.google.cloud.documentai.v1.Document.Entity.Builder addEntitiesBuilder * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-     * shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -58794,8 +61217,7 @@ private void ensureEntityRelationsIsMutable() { * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58813,8 +61235,7 @@ private void ensureEntityRelationsIsMutable() { * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58831,8 +61252,7 @@ public int getEntityRelationsCount() { * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58849,8 +61269,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation getEntityRelations * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58874,8 +61293,7 @@ public Builder setEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58896,8 +61314,7 @@ public Builder setEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58921,8 +61338,7 @@ public Builder addEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58946,8 +61362,7 @@ public Builder addEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58968,8 +61383,7 @@ public Builder addEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -58990,8 +61404,7 @@ public Builder addEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59013,8 +61426,7 @@ public Builder addAllEntityRelations( * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59034,8 +61446,7 @@ public Builder clearEntityRelations() { * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59055,8 +61466,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59070,8 +61480,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation.Builder getEntityR * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59089,8 +61498,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation.Builder getEntityR * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59108,8 +61516,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation.Builder getEntityR * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59124,8 +61531,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation.Builder getEntityR * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59141,8 +61547,7 @@ public com.google.cloud.documentai.v1.Document.EntityRelation.Builder addEntityR * * *
-     * Relationship among
-     * [Document.entities][google.cloud.documentai.v1.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -59195,9 +61600,9 @@ private void ensureTextChangesIsMutable() { * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59213,9 +61618,9 @@ public java.util.List getTex * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59231,9 +61636,9 @@ public int getTextChangesCount() { * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59249,9 +61654,9 @@ public com.google.cloud.documentai.v1.Document.TextChange getTextChanges(int ind * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59274,9 +61679,9 @@ public Builder setTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59296,9 +61701,9 @@ public Builder setTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59320,9 +61725,9 @@ public Builder addTextChanges(com.google.cloud.documentai.v1.Document.TextChange * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59345,9 +61750,9 @@ public Builder addTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59367,9 +61772,9 @@ public Builder addTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59389,9 +61794,9 @@ public Builder addTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59411,9 +61816,9 @@ public Builder addAllTextChanges( * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59432,9 +61837,9 @@ public Builder clearTextChanges() { * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59453,9 +61858,9 @@ public Builder removeTextChanges(int index) { * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59468,9 +61873,9 @@ public com.google.cloud.documentai.v1.Document.TextChange.Builder getTextChanges * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59487,9 +61892,9 @@ public com.google.cloud.documentai.v1.Document.TextChangeOrBuilder getTextChange * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59506,9 +61911,9 @@ public com.google.cloud.documentai.v1.Document.TextChangeOrBuilder getTextChange * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59521,9 +61926,9 @@ public com.google.cloud.documentai.v1.Document.TextChange.Builder addTextChanges * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59538,9 +61943,9 @@ public com.google.cloud.documentai.v1.Document.TextChange.Builder addTextChanges * * *
-     * A list of text corrections made to [Document.text].  This is usually
-     * used for annotating corrections to OCR mistakes.  Text changes for a given
-     * revision may not overlap with each other.
+     * Placeholder.  A list of text corrections made to [Document.text].  This is
+     * usually used for annotating corrections to OCR mistakes.  Text changes for
+     * a given revision may not overlap with each other.
      * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -59956,7 +62361,7 @@ private void ensureRevisionsIsMutable() { * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -59972,7 +62377,7 @@ public java.util.List getRevis * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -59988,7 +62393,7 @@ public int getRevisionsCount() { * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60004,7 +62409,7 @@ public com.google.cloud.documentai.v1.Document.Revision getRevisions(int index) * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60026,7 +62431,7 @@ public Builder setRevisions(int index, com.google.cloud.documentai.v1.Document.R * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60046,7 +62451,7 @@ public Builder setRevisions( * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60068,7 +62473,7 @@ public Builder addRevisions(com.google.cloud.documentai.v1.Document.Revision val * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60090,7 +62495,7 @@ public Builder addRevisions(int index, com.google.cloud.documentai.v1.Document.R * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60110,7 +62515,7 @@ public Builder addRevisions( * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60130,7 +62535,7 @@ public Builder addRevisions( * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60150,7 +62555,7 @@ public Builder addAllRevisions( * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60169,7 +62574,7 @@ public Builder clearRevisions() { * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60188,7 +62593,7 @@ public Builder removeRevisions(int index) { * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60200,7 +62605,7 @@ public com.google.cloud.documentai.v1.Document.Revision.Builder getRevisionsBuil * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60217,7 +62622,7 @@ public com.google.cloud.documentai.v1.Document.RevisionOrBuilder getRevisionsOrB * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60234,7 +62639,7 @@ public com.google.cloud.documentai.v1.Document.RevisionOrBuilder getRevisionsOrB * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60247,7 +62652,7 @@ public com.google.cloud.documentai.v1.Document.Revision.Builder addRevisionsBuil * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -60260,7 +62665,7 @@ public com.google.cloud.documentai.v1.Document.Revision.Builder addRevisionsBuil * * *
-     * Revision history of this document.
+     * Placeholder. Revision history of this document.
      * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiDocumentSchema.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiDocumentSchema.java new file mode 100644 index 00000000000..42e7216de3c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiDocumentSchema.java @@ -0,0 +1,149 @@ +/* + * 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/documentai/v1/document_schema.proto + +package com.google.cloud.documentai.v1; + +public final class DocumentAiDocumentSchema { + private DocumentAiDocumentSchema() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DocumentSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/documentai/v1/document_sc" + + "hema.proto\022\032google.cloud.documentai.v1\"\247" + + "\007\n\016DocumentSchema\022\024\n\014display_name\030\001 \001(\t\022" + + "\023\n\013description\030\002 \001(\t\022K\n\014entity_types\030\003 \003" + + "(\01325.google.cloud.documentai.v1.Document" + + "Schema.EntityType\022E\n\010metadata\030\004 \001(\01323.go" + + "ogle.cloud.documentai.v1.DocumentSchema." + + "Metadata\032\276\004\n\nEntityType\022W\n\013enum_values\030\016" + + " \001(\0132@.google.cloud.documentai.v1.Docume" + + "ntSchema.EntityType.EnumValuesH\000\022\024\n\014disp" + + "lay_name\030\r \001(\t\022\014\n\004name\030\001 \001(\t\022\022\n\nbase_typ" + + "es\030\002 \003(\t\022R\n\nproperties\030\006 \003(\0132>.google.cl" + + "oud.documentai.v1.DocumentSchema.EntityT" + + "ype.Property\032\034\n\nEnumValues\022\016\n\006values\030\001 \003" + + "(\t\032\234\002\n\010Property\022\014\n\004name\030\001 \001(\t\022\022\n\nvalue_t" + + "ype\030\002 \001(\t\022f\n\017occurrence_type\030\003 \001(\0162M.goo" + + "gle.cloud.documentai.v1.DocumentSchema.E" + + "ntityType.Property.OccurrenceType\"\205\001\n\016Oc" + + "currenceType\022\037\n\033OCCURRENCE_TYPE_UNSPECIF" + + "IED\020\000\022\021\n\rOPTIONAL_ONCE\020\001\022\025\n\021OPTIONAL_MUL" + + "TIPLE\020\002\022\021\n\rREQUIRED_ONCE\020\003\022\025\n\021REQUIRED_M" + + "ULTIPLE\020\004B\016\n\014value_source\032\224\001\n\010Metadata\022\031" + + "\n\021document_splitter\030\001 \001(\010\022&\n\036document_al" + + "low_multiple_labels\030\002 \001(\010\022%\n\035prefixed_na" + + "ming_on_properties\030\006 \001(\010\022\036\n\026skip_naming_" + + "validation\030\007 \001(\010B\334\001\n\036com.google.cloud.do" + + "cumentai.v1B\030DocumentAiDocumentSchemaP\001Z" + + "Dgoogle.golang.org/genproto/googleapis/c" + + "loud/documentai/v1;documentai\252\002\032Google.C" + + "loud.DocumentAI.V1\312\002\032Google\\Cloud\\Docume" + + "ntAI\\V1\352\002\035Google::Cloud::DocumentAI::V1b" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_DocumentSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor, + new java.lang.String[] { + "DisplayName", "Description", "EntityTypes", "Metadata", + }); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor = + internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor, + new java.lang.String[] { + "EnumValues", "DisplayName", "Name", "BaseTypes", "Properties", "ValueSource", + }); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor = + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor = + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor, + new java.lang.String[] { + "Name", "ValueType", "OccurrenceType", + }); + internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor = + internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor, + new java.lang.String[] { + "DocumentSplitter", + "DocumentAllowMultipleLabels", + "PrefixedNamingOnProperties", + "SkipNamingValidation", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java new file mode 100644 index 00000000000..fe83bc6da09 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java @@ -0,0 +1,157 @@ +/* + * 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/documentai/v1/processor.proto + +package com.google.cloud.documentai.v1; + +public final class DocumentAiProcessor { + private DocumentAiProcessor() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ProcessorVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Processor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Processor_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n*google/cloud/documentai/v1/processor.p" + + "roto\022\032google.cloud.documentai.v1\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032\037google/protobuf/timestamp." + + "proto\"\220\006\n\020ProcessorVersion\022\014\n\004name\030\001 \001(\t" + + "\022\024\n\014display_name\030\002 \001(\t\022A\n\005state\030\006 \001(\01622." + + "google.cloud.documentai.v1.ProcessorVers" + + "ion.State\022/\n\013create_time\030\007 \001(\0132\032.google." + + "protobuf.Timestamp\022\024\n\014kms_key_name\030\t \001(\t" + + "\022\034\n\024kms_key_version_name\030\n \001(\t\022\026\n\016google" + + "_managed\030\013 \001(\010\022V\n\020deprecation_info\030\r \001(\013" + + "2<.google.cloud.documentai.v1.ProcessorV" + + "ersion.DeprecationInfo\032\237\001\n\017DeprecationIn" + + "fo\0224\n\020deprecation_time\030\001 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022V\n\035replacement_processo" + + "r_version\030\002 \001(\tB/\372A,\n*documentai.googlea" + + "pis.com/ProcessorVersion\"\204\001\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\014\n\010DEPLOYED\020\001\022\r\n\tDEPLO" + + "YING\020\002\022\016\n\nUNDEPLOYED\020\003\022\017\n\013UNDEPLOYING\020\004\022" + + "\014\n\010CREATING\020\005\022\014\n\010DELETING\020\006\022\n\n\006FAILED\020\007:" + + "\226\001\352A\222\001\n*documentai.googleapis.com/Proces" + + "sorVersion\022dprojects/{project}/locations" + + "/{location}/processors/{processor}/proce" + + "ssorVersions/{processor_version}\"\255\004\n\tPro" + + "cessor\022\024\n\004name\030\001 \001(\tB\006\340A\005\340A\003\022\014\n\004type\030\002 \001" + + "(\t\022\024\n\014display_name\030\003 \001(\t\022?\n\005state\030\004 \001(\0162" + + "+.google.cloud.documentai.v1.Processor.S" + + "tateB\003\340A\003\022R\n\031default_processor_version\030\t" + + " \001(\tB/\372A,\n*documentai.googleapis.com/Pro" + + "cessorVersion\022 \n\020process_endpoint\030\006 \001(\tB" + + "\006\340A\003\340A\005\022/\n\013create_time\030\007 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\024\n\014kms_key_name\030\010 \001(\t\"~" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABLE" + + "D\020\001\022\014\n\010DISABLED\020\002\022\014\n\010ENABLING\020\003\022\r\n\tDISAB" + + "LING\020\004\022\014\n\010CREATING\020\005\022\n\n\006FAILED\020\006\022\014\n\010DELE" + + "TING\020\007:h\352Ae\n#documentai.googleapis.com/P" + + "rocessor\022>projects/{project}/locations/{" + + "location}/processors/{processor}B\327\001\n\036com" + + ".google.cloud.documentai.v1B\023DocumentAiP" + + "rocessorP\001ZDgoogle.golang.org/genproto/g" + + "oogleapis/cloud/documentai/v1;documentai" + + "\252\002\032Google.Cloud.DocumentAI.V1\312\002\032Google\\C" + + "loud\\DocumentAI\\V1\352\002\035Google::Cloud::Docu" + + "mentAI::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_ProcessorVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "State", + "CreateTime", + "KmsKeyName", + "KmsKeyVersionName", + "GoogleManaged", + "DeprecationInfo", + }); + internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor = + internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor, + new java.lang.String[] { + "DeprecationTime", "ReplacementProcessorVersion", + }); + internal_static_google_cloud_documentai_v1_Processor_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_documentai_v1_Processor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Processor_descriptor, + new java.lang.String[] { + "Name", + "Type", + "DisplayName", + "State", + "DefaultProcessorVersion", + "ProcessEndpoint", + "CreateTime", + "KmsKeyName", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java index 67374a304dc..dd8f7ce997b 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java @@ -55,6 +55,126 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_GetProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EnableProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EnableProcessorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -83,97 +203,262 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ld_behavior.proto\032\031google/api/resource.p" + "roto\032)google/cloud/documentai/v1/documen" + "t.proto\032,google/cloud/documentai/v1/docu" - + "ment_io.proto\0323google/cloud/documentai/v" - + "1/operation_metadata.proto\032#google/longr" - + "unning/operations.proto\032\037google/protobuf" - + "/timestamp.proto\032\027google/rpc/status.prot" - + "o\"\362\001\n\016ProcessRequest\022?\n\017inline_document\030" - + "\004 \001(\0132$.google.cloud.documentai.v1.Docum" - + "entH\000\022?\n\014raw_document\030\005 \001(\0132\'.google.clo" - + "ud.documentai.v1.RawDocumentH\000\0229\n\004name\030\001" - + " \001(\tB+\340A\002\372A%\n#documentai.googleapis.com/" - + "Processor\022\031\n\021skip_human_review\030\003 \001(\010B\010\n\006" - + "source\"\356\001\n\021HumanReviewStatus\022B\n\005state\030\001 " - + "\001(\01623.google.cloud.documentai.v1.HumanRe" - + "viewStatus.State\022\025\n\rstate_message\030\002 \001(\t\022" - + "\036\n\026human_review_operation\030\003 \001(\t\"^\n\005State" - + "\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025\n\021" - + "VALIDATION_PASSED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t\n\005" - + "ERROR\020\004\"\225\001\n\017ProcessResponse\0226\n\010document\030" - + "\001 \001(\0132$.google.cloud.documentai.v1.Docum" - + "ent\022J\n\023human_review_status\030\003 \001(\0132-.googl" - + "e.cloud.documentai.v1.HumanReviewStatus\"" - + "\215\002\n\023BatchProcessRequest\0229\n\004name\030\001 \001(\tB+\340" - + "A\002\372A%\n#documentai.googleapis.com/Process" - + "or\022N\n\017input_documents\030\005 \001(\01325.google.clo" - + "ud.documentai.v1.BatchDocumentsInputConf" - + "ig\022P\n\026document_output_config\030\006 \001(\01320.goo" - + "gle.cloud.documentai.v1.DocumentOutputCo" - + "nfig\022\031\n\021skip_human_review\030\004 \001(\010\"\026\n\024Batch" - + "ProcessResponse\"\377\004\n\024BatchProcessMetadata" - + "\022E\n\005state\030\001 \001(\01626.google.cloud.documenta" - + "i.v1.BatchProcessMetadata.State\022\025\n\rstate" - + "_message\030\002 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022/\n\013update_time\030\004" - + " \001(\0132\032.google.protobuf.Timestamp\022m\n\033indi" - + "vidual_process_statuses\030\005 \003(\0132H.google.c" - + "loud.documentai.v1.BatchProcessMetadata." - + "IndividualProcessStatus\032\303\001\n\027IndividualPr" - + "ocessStatus\022\030\n\020input_gcs_source\030\001 \001(\t\022\"\n" - + "\006status\030\002 \001(\0132\022.google.rpc.Status\022\036\n\026out" - + "put_gcs_destination\030\003 \001(\t\022J\n\023human_revie" - + "w_status\030\005 \001(\0132-.google.cloud.documentai" - + ".v1.HumanReviewStatus\"r\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\013\n\007WAITING\020\001\022\013\n\007RUNNING\020\002\022" - + "\r\n\tSUCCEEDED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCEL" - + "LED\020\005\022\n\n\006FAILED\020\006\"\317\002\n\025ReviewDocumentRequ" - + "est\022?\n\017inline_document\030\004 \001(\0132$.google.cl" - + "oud.documentai.v1.DocumentH\000\022P\n\023human_re" - + "view_config\030\001 \001(\tB3\340A\002\372A-\n+documentai.go" - + "ogleapis.com/HumanReviewConfig\022 \n\030enable" - + "_schema_validation\030\003 \001(\010\022L\n\010priority\030\005 \001" - + "(\0162:.google.cloud.documentai.v1.ReviewDo" - + "cumentRequest.Priority\"#\n\010Priority\022\013\n\007DE" - + "FAULT\020\000\022\n\n\006URGENT\020\001B\010\n\006sourceJ\004\010\002\020\003\"1\n\026R" - + "eviewDocumentResponse\022\027\n\017gcs_destination" - + "\030\001 \001(\t\"\204\001\n\037ReviewDocumentOperationMetada" - + "ta\022L\n\017common_metadata\030\005 \001(\01323.google.clo" - + "ud.documentai.v1.CommonOperationMetadata" - + "\022\023\n\013question_id\030\006 \001(\t2\253\006\n\030DocumentProces" - + "sorService\022\264\001\n\017ProcessDocument\022*.google." - + "cloud.documentai.v1.ProcessRequest\032+.goo" - + "gle.cloud.documentai.v1.ProcessResponse\"" - + "H\202\323\344\223\002;\"6/v1/{name=projects/*/locations/" - + "*/processors/*}:process:\001*\332A\004name\022\345\001\n\025Ba" - + "tchProcessDocuments\022/.google.cloud.docum" - + "entai.v1.BatchProcessRequest\032\035.google.lo" - + "ngrunning.Operation\"|\202\323\344\223\002@\";/v1/{name=p" - + "rojects/*/locations/*/processors/*}:batc" - + "hProcess:\001*\332A\004name\312A,\n\024BatchProcessRespo" - + "nse\022\024BatchProcessMetadata\022\240\002\n\016ReviewDocu" - + "ment\0221.google.cloud.documentai.v1.Review" - + "DocumentRequest\032\035.google.longrunning.Ope" - + "ration\"\273\001\202\323\344\223\002c\"^/v1/{human_review_confi" - + "g=projects/*/locations/*/processors/*/hu" - + "manReviewConfig}:reviewDocument:\001*\332A\023hum" - + "an_review_config\312A9\n\026ReviewDocumentRespo" - + "nse\022\037ReviewDocumentOperationMetadata\032M\312A" - + "\031documentai.googleapis.com\322A.https://www" - + ".googleapis.com/auth/cloud-platformB\230\004\n\036" - + "com.google.cloud.documentai.v1B\032Document" - + "AiProcessorServiceP\001ZDgoogle.golang.org/" - + "genproto/googleapis/cloud/documentai/v1;" - + "documentai\252\002\032Google.Cloud.DocumentAI.V1\312" - + "\002\032Google\\Cloud\\DocumentAI\\V1\352\002\035Google::C" - + "loud::DocumentAI::V1\352AM\n\"documentai.goog" - + "leapis.com/Location\022\'projects/{project}/" - + "locations/{location}\352Ae\n#documentai.goog" - + "leapis.com/Processor\022>projects/{project}" - + "/locations/{location}/processors/{proces" - + "sor}\352A\177\n+documentai.googleapis.com/Human" - + "ReviewConfig\022Pprojects/{project}/locatio" - + "ns/{location}/processors/{processor}/hum" - + "anReviewConfigb\006proto3" + + "ment_io.proto\0320google/cloud/documentai/v" + + "1/document_schema.proto\0323google/cloud/do" + + "cumentai/v1/operation_metadata.proto\032*go" + + "ogle/cloud/documentai/v1/processor.proto" + + "\032/google/cloud/documentai/v1/processor_t" + + "ype.proto\032#google/longrunning/operations" + + ".proto\032 google/protobuf/field_mask.proto" + + "\032\037google/protobuf/timestamp.proto\032\027googl" + + "e/rpc/status.proto\"\200\002\n\016ProcessRequest\022?\n" + + "\017inline_document\030\004 \001(\0132$.google.cloud.do" + + "cumentai.v1.DocumentH\000\022?\n\014raw_document\030\005" + + " \001(\0132\'.google.cloud.documentai.v1.RawDoc" + + "umentH\000\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022\031\n\021skip" + + "_human_review\030\003 \001(\010\022.\n\nfield_mask\030\006 \001(\0132" + + "\032.google.protobuf.FieldMaskB\010\n\006source\"\356\001" + + "\n\021HumanReviewStatus\022B\n\005state\030\001 \001(\01623.goo" + + "gle.cloud.documentai.v1.HumanReviewStatu" + + "s.State\022\025\n\rstate_message\030\002 \001(\t\022\036\n\026human_" + + "review_operation\030\003 \001(\t\"^\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025\n\021VALIDATIO" + + "N_PASSED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t\n\005ERROR\020\004\"\225" + + "\001\n\017ProcessResponse\0226\n\010document\030\001 \001(\0132$.g" + + "oogle.cloud.documentai.v1.Document\022J\n\023hu" + + "man_review_status\030\003 \001(\0132-.google.cloud.d" + + "ocumentai.v1.HumanReviewStatus\"\353\001\n\023Batch" + + "ProcessRequest\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022" + + "N\n\017input_documents\030\005 \001(\01325.google.cloud." + + "documentai.v1.BatchDocumentsInputConfig\022" + + "P\n\026document_output_config\030\006 \001(\01320.google" + + ".cloud.documentai.v1.DocumentOutputConfi" + + "g\022\031\n\021skip_human_review\030\004 \001(\010\"\026\n\024BatchPro" + + "cessResponse\"\377\004\n\024BatchProcessMetadata\022E\n" + + "\005state\030\001 \001(\01626.google.cloud.documentai.v" + + "1.BatchProcessMetadata.State\022\025\n\rstate_me" + + "ssage\030\002 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022/\n\013update_time\030\004 \001(" + + "\0132\032.google.protobuf.Timestamp\022m\n\033individ" + + "ual_process_statuses\030\005 \003(\0132H.google.clou" + + "d.documentai.v1.BatchProcessMetadata.Ind" + + "ividualProcessStatus\032\303\001\n\027IndividualProce" + + "ssStatus\022\030\n\020input_gcs_source\030\001 \001(\t\022\"\n\006st" + + "atus\030\002 \001(\0132\022.google.rpc.Status\022\036\n\026output" + + "_gcs_destination\030\003 \001(\t\022J\n\023human_review_s" + + "tatus\030\005 \001(\0132-.google.cloud.documentai.v1" + + ".HumanReviewStatus\"r\n\005State\022\025\n\021STATE_UNS" + + "PECIFIED\020\000\022\013\n\007WAITING\020\001\022\013\n\007RUNNING\020\002\022\r\n\t" + + "SUCCEEDED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED" + + "\020\005\022\n\n\006FAILED\020\006\"]\n\032FetchProcessorTypesReq" + + "uest\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'documentai" + + ".googleapis.com/ProcessorType\"a\n\033FetchPr" + + "ocessorTypesResponse\022B\n\017processor_types\030" + + "\001 \003(\0132).google.cloud.documentai.v1.Proce" + + "ssorType\"\203\001\n\031ListProcessorTypesRequest\022?" + + "\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'documentai.googl" + + "eapis.com/ProcessorType\022\021\n\tpage_size\030\002 \001" + + "(\005\022\022\n\npage_token\030\003 \001(\t\"y\n\032ListProcessorT" + + "ypesResponse\022B\n\017processor_types\030\001 \003(\0132)." + + "google.cloud.documentai.v1.ProcessorType" + + "\022\027\n\017next_page_token\030\002 \001(\t\"{\n\025ListProcess" + + "orsRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#docu" + + "mentai.googleapis.com/Processor\022\021\n\tpage_" + + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"l\n\026ListPr" + + "ocessorsResponse\0229\n\nprocessors\030\001 \003(\0132%.g" + + "oogle.cloud.documentai.v1.Processor\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"P\n\023GetProcessorRequ" + + "est\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documentai.go" + + "ogleapis.com/Processor\"^\n\032GetProcessorVe" + + "rsionRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*docu" + + "mentai.googleapis.com/ProcessorVersion\"\211" + + "\001\n\034ListProcessorVersionsRequest\022B\n\006paren" + + "t\030\001 \001(\tB2\340A\002\372A,\022*documentai.googleapis.c" + + "om/ProcessorVersion\022\021\n\tpage_size\030\002 \001(\005\022\022" + + "\n\npage_token\030\003 \001(\t\"\202\001\n\035ListProcessorVers" + + "ionsResponse\022H\n\022processor_versions\030\001 \003(\013" + + "2,.google.cloud.documentai.v1.ProcessorV" + + "ersion\022\027\n\017next_page_token\030\002 \001(\t\"a\n\035Delet" + + "eProcessorVersionRequest\022@\n\004name\030\001 \001(\tB2" + + "\340A\002\372A,\n*documentai.googleapis.com/Proces" + + "sorVersion\"n\n\036DeleteProcessorVersionMeta" + + "data\022L\n\017common_metadata\030\001 \001(\01323.google.c" + + "loud.documentai.v1.CommonOperationMetada" + + "ta\"a\n\035DeployProcessorVersionRequest\022@\n\004n" + + "ame\030\001 \001(\tB2\340A\002\372A,\n*documentai.googleapis" + + ".com/ProcessorVersion\" \n\036DeployProcessor" + + "VersionResponse\"n\n\036DeployProcessorVersio" + + "nMetadata\022L\n\017common_metadata\030\001 \001(\01323.goo" + + "gle.cloud.documentai.v1.CommonOperationM" + + "etadata\"c\n\037UndeployProcessorVersionReque" + + "st\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*documentai.goo" + + "gleapis.com/ProcessorVersion\"\"\n Undeploy" + + "ProcessorVersionResponse\"p\n UndeployProc" + + "essorVersionMetadata\022L\n\017common_metadata\030" + + "\001 \001(\01323.google.cloud.documentai.v1.Commo" + + "nOperationMetadata\"\224\001\n\026CreateProcessorRe" + + "quest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#documenta" + + "i.googleapis.com/Processor\022=\n\tprocessor\030" + + "\002 \001(\0132%.google.cloud.documentai.v1.Proce" + + "ssorB\003\340A\002\"S\n\026DeleteProcessorRequest\0229\n\004n" + + "ame\030\001 \001(\tB+\340A\002\372A%\n#documentai.googleapis" + + ".com/Processor\"g\n\027DeleteProcessorMetadat" + + "a\022L\n\017common_metadata\030\005 \001(\01323.google.clou" + + "d.documentai.v1.CommonOperationMetadata\"" + + "S\n\026EnableProcessorRequest\0229\n\004name\030\001 \001(\tB" + + "+\340A\002\372A%\n#documentai.googleapis.com/Proce" + + "ssor\"\031\n\027EnableProcessorResponse\"g\n\027Enabl" + + "eProcessorMetadata\022L\n\017common_metadata\030\005 " + + "\001(\01323.google.cloud.documentai.v1.CommonO" + + "perationMetadata\"T\n\027DisableProcessorRequ" + + "est\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documentai.go" + + "ogleapis.com/Processor\"\032\n\030DisableProcess" + + "orResponse\"h\n\030DisableProcessorMetadata\022L" + + "\n\017common_metadata\030\005 \001(\01323.google.cloud.d" + + "ocumentai.v1.CommonOperationMetadata\"\272\001\n" + + "!SetDefaultProcessorVersionRequest\022>\n\tpr" + + "ocessor\030\001 \001(\tB+\340A\002\372A%\n#documentai.google" + + "apis.com/Processor\022U\n\031default_processor_" + + "version\030\002 \001(\tB2\340A\002\372A,\n*documentai.google" + + "apis.com/ProcessorVersion\"$\n\"SetDefaultP" + + "rocessorVersionResponse\"r\n\"SetDefaultPro" + + "cessorVersionMetadata\022L\n\017common_metadata" + + "\030\001 \001(\01323.google.cloud.documentai.v1.Comm" + + "onOperationMetadata\"\216\003\n\025ReviewDocumentRe" + + "quest\022?\n\017inline_document\030\004 \001(\0132$.google." + + "cloud.documentai.v1.DocumentH\000\022P\n\023human_" + + "review_config\030\001 \001(\tB3\340A\002\372A-\n+documentai." + + "googleapis.com/HumanReviewConfig\022 \n\030enab" + + "le_schema_validation\030\003 \001(\010\022L\n\010priority\030\005" + + " \001(\0162:.google.cloud.documentai.v1.Review" + + "DocumentRequest.Priority\022C\n\017document_sch" + + "ema\030\006 \001(\0132*.google.cloud.documentai.v1.D" + + "ocumentSchema\"#\n\010Priority\022\013\n\007DEFAULT\020\000\022\n" + + "\n\006URGENT\020\001B\010\n\006source\"\321\001\n\026ReviewDocumentR" + + "esponse\022\027\n\017gcs_destination\030\001 \001(\t\022G\n\005stat" + + "e\030\002 \001(\01628.google.cloud.documentai.v1.Rev" + + "iewDocumentResponse.State\022\030\n\020rejection_r" + + "eason\030\003 \001(\t\";\n\005State\022\025\n\021STATE_UNSPECIFIE" + + "D\020\000\022\014\n\010REJECTED\020\001\022\r\n\tSUCCEEDED\020\002\"\204\001\n\037Rev" + + "iewDocumentOperationMetadata\022L\n\017common_m" + + "etadata\030\005 \001(\01323.google.cloud.documentai." + + "v1.CommonOperationMetadata\022\023\n\013question_i" + + "d\030\006 \001(\t2\310 \n\030DocumentProcessorService\022\207\002\n" + + "\017ProcessDocument\022*.google.cloud.document" + + "ai.v1.ProcessRequest\032+.google.cloud.docu" + + "mentai.v1.ProcessResponse\"\232\001\202\323\344\223\002\214\001\"6/v1" + + "/{name=projects/*/locations/*/processors" + + "/*}:process:\001*ZO\"J/v1/{name=projects/*/l" + + "ocations/*/processors/*/processorVersion" + + "s/*}:process:\001*\332A\004name\022\275\002\n\025BatchProcessD" + + "ocuments\022/.google.cloud.documentai.v1.Ba" + + "tchProcessRequest\032\035.google.longrunning.O" + + "peration\"\323\001\202\323\344\223\002\226\001\";/v1/{name=projects/*" + + "/locations/*/processors/*}:batchProcess:" + + "\001*ZT\"O/v1/{name=projects/*/locations/*/p" + + "rocessors/*/processorVersions/*}:batchPr" + + "ocess:\001*\332A\004name\312A,\n\024BatchProcessResponse" + + "\022\024BatchProcessMetadata\022\320\001\n\023FetchProcesso" + + "rTypes\0226.google.cloud.documentai.v1.Fetc" + + "hProcessorTypesRequest\0327.google.cloud.do" + + "cumentai.v1.FetchProcessorTypesResponse\"" + + "H\202\323\344\223\0029\0227/v1/{parent=projects/*/location" + + "s/*}:fetchProcessorTypes\332A\006parent\022\310\001\n\022Li" + + "stProcessorTypes\0225.google.cloud.document" + + "ai.v1.ListProcessorTypesRequest\0326.google" + + ".cloud.documentai.v1.ListProcessorTypesR" + + "esponse\"C\202\323\344\223\0024\0222/v1/{parent=projects/*/" + + "locations/*}/processorTypes\332A\006parent\022\270\001\n" + + "\016ListProcessors\0221.google.cloud.documenta" + + "i.v1.ListProcessorsRequest\0322.google.clou" + + "d.documentai.v1.ListProcessorsResponse\"?" + + "\202\323\344\223\0020\022./v1/{parent=projects/*/locations" + + "/*}/processors\332A\006parent\022\245\001\n\014GetProcessor" + + "\022/.google.cloud.documentai.v1.GetProcess" + + "orRequest\032%.google.cloud.documentai.v1.P" + + "rocessor\"=\202\323\344\223\0020\022./v1/{name=projects/*/l" + + "ocations/*/processors/*}\332A\004name\022\316\001\n\023GetP" + + "rocessorVersion\0226.google.cloud.documenta" + + "i.v1.GetProcessorVersionRequest\032,.google" + + ".cloud.documentai.v1.ProcessorVersion\"Q\202" + + "\323\344\223\002D\022B/v1/{name=projects/*/locations/*/" + + "processors/*/processorVersions/*}\332A\004name" + + "\022\341\001\n\025ListProcessorVersions\0228.google.clou" + + "d.documentai.v1.ListProcessorVersionsReq" + + "uest\0329.google.cloud.documentai.v1.ListPr" + + "ocessorVersionsResponse\"S\202\323\344\223\002D\022B/v1/{pa" + + "rent=projects/*/locations/*/processors/*" + + "}/processorVersions\332A\006parent\022\200\002\n\026DeleteP" + + "rocessorVersion\0229.google.cloud.documenta" + + "i.v1.DeleteProcessorVersionRequest\032\035.goo" + + "gle.longrunning.Operation\"\213\001\202\323\344\223\002D*B/v1/" + + "{name=projects/*/locations/*/processors/" + + "*/processorVersions/*}\332A\004name\312A7\n\025google" + + ".protobuf.Empty\022\036DeleteProcessorVersionM" + + "etadata\022\223\002\n\026DeployProcessorVersion\0229.goo" + + "gle.cloud.documentai.v1.DeployProcessorV" + + "ersionRequest\032\035.google.longrunning.Opera" + + "tion\"\236\001\202\323\344\223\002N\"I/v1/{name=projects/*/loca" + + "tions/*/processors/*/processorVersions/*" + + "}:deploy:\001*\332A\004name\312A@\n\036DeployProcessorVe" + + "rsionResponse\022\036DeployProcessorVersionMet" + + "adata\022\235\002\n\030UndeployProcessorVersion\022;.goo" + + "gle.cloud.documentai.v1.UndeployProcesso" + + "rVersionRequest\032\035.google.longrunning.Ope" + + "ration\"\244\001\202\323\344\223\002P\"K/v1/{name=projects/*/lo" + + "cations/*/processors/*/processorVersions" + + "/*}:undeploy:\001*\332A\004name\312AD\n UndeployProce" + + "ssorVersionResponse\022 UndeployProcessorVe" + + "rsionMetadata\022\302\001\n\017CreateProcessor\0222.goog" + + "le.cloud.documentai.v1.CreateProcessorRe" + + "quest\032%.google.cloud.documentai.v1.Proce" + + "ssor\"T\202\323\344\223\002;\"./v1/{parent=projects/*/loc" + + "ations/*}/processors:\tprocessor\332A\020parent" + + ",processor\022\326\001\n\017DeleteProcessor\0222.google." + + "cloud.documentai.v1.DeleteProcessorReque" + + "st\032\035.google.longrunning.Operation\"p\202\323\344\223\002" + + "0*./v1/{name=projects/*/locations/*/proc" + + "essors/*}\332A\004name\312A0\n\025google.protobuf.Emp" + + "ty\022\027DeleteProcessorMetadata\022\333\001\n\017EnablePr" + + "ocessor\0222.google.cloud.documentai.v1.Ena" + + "bleProcessorRequest\032\035.google.longrunning" + + ".Operation\"u\202\323\344\223\002:\"5/v1/{name=projects/*" + + "/locations/*/processors/*}:enable:\001*\312A2\n" + + "\027EnableProcessorResponse\022\027EnableProcesso" + + "rMetadata\022\340\001\n\020DisableProcessor\0223.google." + + "cloud.documentai.v1.DisableProcessorRequ" + + "est\032\035.google.longrunning.Operation\"x\202\323\344\223" + + "\002;\"6/v1/{name=projects/*/locations/*/pro" + + "cessors/*}:disable:\001*\312A4\n\030DisableProcess" + + "orResponse\022\030DisableProcessorMetadata\022\241\002\n" + + "\032SetDefaultProcessorVersion\022=.google.clo" + + "ud.documentai.v1.SetDefaultProcessorVers" + + "ionRequest\032\035.google.longrunning.Operatio" + + "n\"\244\001\202\323\344\223\002S\"N/v1/{processor=projects/*/lo" + + "cations/*/processors/*}:setDefaultProces" + + "sorVersion:\001*\312AH\n\"SetDefaultProcessorVer" + + "sionResponse\022\"SetDefaultProcessorVersion" + + "Metadata\022\240\002\n\016ReviewDocument\0221.google.clo" + + "ud.documentai.v1.ReviewDocumentRequest\032\035" + + ".google.longrunning.Operation\"\273\001\202\323\344\223\002c\"^" + + "/v1/{human_review_config=projects/*/loca" + + "tions/*/processors/*/humanReviewConfig}:" + + "reviewDocument:\001*\332A\023human_review_config\312" + + "A9\n\026ReviewDocumentResponse\022\037ReviewDocume" + + "ntOperationMetadata\032M\312A\031documentai.googl" + + "eapis.com\322A.https://www.googleapis.com/a" + + "uth/cloud-platformB\260\003\n\036com.google.cloud." + + "documentai.v1B\032DocumentAiProcessorServic" + + "eP\001ZDgoogle.golang.org/genproto/googleap" + + "is/cloud/documentai/v1;documentai\252\002\032Goog" + + "le.Cloud.DocumentAI.V1\312\002\032Google\\Cloud\\Do" + + "cumentAI\\V1\352\002\035Google::Cloud::DocumentAI:" + + ":V1\352A\177\n+documentai.googleapis.com/HumanR" + + "eviewConfig\022Pprojects/{project}/location" + + "s/{location}/processors/{processor}/huma" + + "nReviewConfig\352AM\n\"documentai.googleapis." + + "com/Location\022\'projects/{project}/locatio" + + "ns/{location}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -185,8 +470,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentIoProto.getDescriptor(), + com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(), com.google.cloud.documentai.v1.OperationMetadataProto.getDescriptor(), + com.google.cloud.documentai.v1.DocumentAiProcessor.getDescriptor(), + com.google.cloud.documentai.v1.DocumentAiProcessorType.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); @@ -196,7 +485,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ProcessRequest_descriptor, new java.lang.String[] { - "InlineDocument", "RawDocument", "Name", "SkipHumanReview", "Source", + "InlineDocument", "RawDocument", "Name", "SkipHumanReview", "FieldMask", "Source", }); internal_static_google_cloud_documentai_v1_HumanReviewStatus_descriptor = getDescriptor().getMessageTypes().get(1); @@ -246,24 +535,259 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "InputGcsSource", "Status", "OutputGcsDestination", "HumanReviewStatus", }); - internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor = + internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor, + new java.lang.String[] { + "ProcessorTypes", + }); + internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor, + new java.lang.String[] { + "ProcessorTypes", "NextPageToken", + }); + internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_documentai_v1_ListProcessorsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_documentai_v1_ListProcessorsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor, + new java.lang.String[] { + "Processors", "NextPageToken", + }); + internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_documentai_v1_GetProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor, + new java.lang.String[] { + "ProcessorVersions", "NextPageToken", + }); + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor, + new java.lang.String[] { + "Parent", "Processor", + }); + internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_documentai_v1_EnableProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_documentai_v1_EnableProcessorResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Processor", "DefaultProcessorVersion", + }); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(36); internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor, new java.lang.String[] { - "InlineDocument", "HumanReviewConfig", "EnableSchemaValidation", "Priority", "Source", + "InlineDocument", + "HumanReviewConfig", + "EnableSchemaValidation", + "Priority", + "DocumentSchema", + "Source", }); internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(37); internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_descriptor, new java.lang.String[] { - "GcsDestination", + "GcsDestination", "State", "RejectionReason", }); internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(38); internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_descriptor, @@ -288,8 +812,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentIoProto.getDescriptor(); + com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(); com.google.cloud.documentai.v1.OperationMetadataProto.getDescriptor(); + com.google.cloud.documentai.v1.DocumentAiProcessor.getDescriptor(); + com.google.cloud.documentai.v1.DocumentAiProcessorType.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorType.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorType.java new file mode 100644 index 00000000000..68ffba2a1b0 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorType.java @@ -0,0 +1,100 @@ +/* + * 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/documentai/v1/processor_type.proto + +package com.google.cloud.documentai.v1; + +public final class DocumentAiProcessorType { + private DocumentAiProcessorType() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ProcessorType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ProcessorType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/cloud/documentai/v1/processor_t" + + "ype.proto\022\032google.cloud.documentai.v1\032\035g" + + "oogle/api/launch_stage.proto\032\031google/api" + + "/resource.proto\"\365\002\n\rProcessorType\022\014\n\004nam" + + "e\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\020\n\010category\030\003 \001(\t\022" + + "S\n\023available_locations\030\004 \003(\01326.google.cl" + + "oud.documentai.v1.ProcessorType.Location" + + "Info\022\026\n\016allow_creation\030\006 \001(\010\022-\n\014launch_s" + + "tage\030\010 \001(\0162\027.google.api.LaunchStage\032#\n\014L" + + "ocationInfo\022\023\n\013location_id\030\001 \001(\t:u\352Ar\n\'d" + + "ocumentai.googleapis.com/ProcessorType\022G" + + "projects/{project}/locations/{location}/" + + "processorTypes/{processor_type}B\333\001\n\036com." + + "google.cloud.documentai.v1B\027DocumentAiPr" + + "ocessorTypeP\001ZDgoogle.golang.org/genprot" + + "o/googleapis/cloud/documentai/v1;documen" + + "tai\252\002\032Google.Cloud.DocumentAI.V1\312\002\032Googl" + + "e\\Cloud\\DocumentAI\\V1\352\002\035Google::Cloud::D" + + "ocumentAI::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.LaunchStageProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_documentai_v1_ProcessorType_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_ProcessorType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ProcessorType_descriptor, + new java.lang.String[] { + "Name", "Type", "Category", "AvailableLocations", "AllowCreation", "LaunchStage", + }); + internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor = + internal_static_google_cloud_documentai_v1_ProcessorType_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor, + new java.lang.String[] { + "LocationId", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.LaunchStageProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentOrBuilder.java index f923628b959..9cde15ef2aa 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentOrBuilder.java @@ -159,7 +159,7 @@ public interface DocumentOrBuilder * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -169,7 +169,7 @@ public interface DocumentOrBuilder * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -179,7 +179,7 @@ public interface DocumentOrBuilder * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -189,7 +189,7 @@ public interface DocumentOrBuilder * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -200,7 +200,7 @@ public interface DocumentOrBuilder * * *
-   * Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
    * 
* * repeated .google.cloud.documentai.v1.Document.Style text_styles = 5; @@ -263,9 +263,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -275,9 +274,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -287,9 +285,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -299,9 +296,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -312,9 +308,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1.Document.text]. For document
-   * shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1.Document.Entity entities = 7; @@ -325,8 +320,7 @@ public interface DocumentOrBuilder * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -336,8 +330,7 @@ public interface DocumentOrBuilder * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -347,8 +340,7 @@ public interface DocumentOrBuilder * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -358,8 +350,7 @@ public interface DocumentOrBuilder * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -370,8 +361,7 @@ public interface DocumentOrBuilder * * *
-   * Relationship among
-   * [Document.entities][google.cloud.documentai.v1.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; @@ -383,9 +373,9 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -395,9 +385,9 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -407,9 +397,9 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -419,9 +409,9 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -432,9 +422,9 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * A list of text corrections made to [Document.text].  This is usually
-   * used for annotating corrections to OCR mistakes.  Text changes for a given
-   * revision may not overlap with each other.
+   * Placeholder.  A list of text corrections made to [Document.text].  This is
+   * usually used for annotating corrections to OCR mistakes.  Text changes for
+   * a given revision may not overlap with each other.
    * 
* * repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; @@ -518,7 +508,7 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -528,7 +518,7 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -538,7 +528,7 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -548,7 +538,7 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; @@ -559,7 +549,7 @@ com.google.cloud.documentai.v1.Document.EntityRelationOrBuilder getEntityRelatio * * *
-   * Revision history of this document.
+   * Placeholder. Revision history of this document.
    * 
* * repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java index a56b7280c7e..c65a6f017d2 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java @@ -107,6 +107,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1_Document_Page_FormField_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1_Document_Page_FormField_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1_Document_Page_DetectedLanguage_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -170,215 +174,226 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n)google/cloud/documentai/v1/document.pr" + "oto\022\032google.cloud.documentai.v1\032\037google/" - + "api/field_behavior.proto\032)google/cloud/d" - + "ocumentai/v1/geometry.proto\032\037google/prot" - + "obuf/timestamp.proto\032\027google/rpc/status." - + "proto\032\027google/type/color.proto\032\026google/t" - + "ype/date.proto\032\032google/type/datetime.pro" - + "to\032\027google/type/money.proto\032 google/type" - + "/postal_address.proto\"\264;\n\010Document\022\022\n\003ur" - + "i\030\001 \001(\tB\003\340A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A\001H\000\022\021" - + "\n\tmime_type\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A\001\022?\n\013" - + "text_styles\030\005 \003(\0132*.google.cloud.documen" - + "tai.v1.Document.Style\0228\n\005pages\030\006 \003(\0132).g" - + "oogle.cloud.documentai.v1.Document.Page\022" - + "=\n\010entities\030\007 \003(\0132+.google.cloud.documen" - + "tai.v1.Document.Entity\022M\n\020entity_relatio" - + "ns\030\010 \003(\01323.google.cloud.documentai.v1.Do" - + "cument.EntityRelation\022E\n\014text_changes\030\016 " - + "\003(\0132/.google.cloud.documentai.v1.Documen" - + "t.TextChange\022B\n\nshard_info\030\t \001(\0132..googl" - + "e.cloud.documentai.v1.Document.ShardInfo" - + "\022!\n\005error\030\n \001(\0132\022.google.rpc.Status\022@\n\tr" - + "evisions\030\r \003(\0132-.google.cloud.documentai" - + ".v1.Document.Revision\032J\n\tShardInfo\022\023\n\013sh" - + "ard_index\030\001 \001(\003\022\023\n\013shard_count\030\002 \001(\003\022\023\n\013" - + "text_offset\030\003 \001(\003\032\320\002\n\005Style\022D\n\013text_anch" - + "or\030\001 \001(\0132/.google.cloud.documentai.v1.Do" - + "cument.TextAnchor\022!\n\005color\030\002 \001(\0132\022.googl" - + "e.type.Color\022,\n\020background_color\030\003 \001(\0132\022" - + ".google.type.Color\022\023\n\013font_weight\030\004 \001(\t\022" - + "\022\n\ntext_style\030\005 \001(\t\022\027\n\017text_decoration\030\006" - + " \001(\t\022F\n\tfont_size\030\007 \001(\01323.google.cloud.d" - + "ocumentai.v1.Document.Style.FontSize\032&\n\010" - + "FontSize\022\014\n\004size\030\001 \001(\002\022\014\n\004unit\030\002 \001(\t\032\360 \n" - + "\004Page\022\023\n\013page_number\030\001 \001(\005\022>\n\005image\030\r \001(" - + "\0132/.google.cloud.documentai.v1.Document." - + "Page.Image\022D\n\ntransforms\030\016 \003(\01320.google." - + "cloud.documentai.v1.Document.Page.Matrix" - + "\022F\n\tdimension\030\002 \001(\01323.google.cloud.docum" - + "entai.v1.Document.Page.Dimension\022@\n\006layo" - + "ut\030\003 \001(\01320.google.cloud.documentai.v1.Do" - + "cument.Page.Layout\022V\n\022detected_languages" - + "\030\004 \003(\0132:.google.cloud.documentai.v1.Docu" - + "ment.Page.DetectedLanguage\022?\n\006blocks\030\005 \003" - + "(\0132/.google.cloud.documentai.v1.Document" - + ".Page.Block\022G\n\nparagraphs\030\006 \003(\01323.google" - + ".cloud.documentai.v1.Document.Page.Parag" - + "raph\022=\n\005lines\030\007 \003(\0132..google.cloud.docum" - + "entai.v1.Document.Page.Line\022?\n\006tokens\030\010 " - + "\003(\0132/.google.cloud.documentai.v1.Documen" - + "t.Page.Token\022P\n\017visual_elements\030\t \003(\01327." - + "google.cloud.documentai.v1.Document.Page" - + ".VisualElement\022?\n\006tables\030\n \003(\0132/.google." - + "cloud.documentai.v1.Document.Page.Table\022" - + "H\n\013form_fields\030\013 \003(\01323.google.cloud.docu" - + "mentai.v1.Document.Page.FormField\022A\n\007sym" - + "bols\030\014 \003(\01320.google.cloud.documentai.v1." - + "Document.Page.Symbol\022C\n\nprovenance\030\020 \001(\013" - + "2/.google.cloud.documentai.v1.Document.P" - + "rovenance\0328\n\tDimension\022\r\n\005width\030\001 \001(\002\022\016\n" - + "\006height\030\002 \001(\002\022\014\n\004unit\030\003 \001(\t\032J\n\005Image\022\017\n\007" - + "content\030\001 \001(\014\022\021\n\tmime_type\030\002 \001(\t\022\r\n\005widt" - + "h\030\003 \001(\005\022\016\n\006height\030\004 \001(\005\032@\n\006Matrix\022\014\n\004row" - + "s\030\001 \001(\005\022\014\n\004cols\030\002 \001(\005\022\014\n\004type\030\003 \001(\005\022\014\n\004d" - + "ata\030\004 \001(\014\032\335\002\n\006Layout\022D\n\013text_anchor\030\001 \001(" - + "\0132/.google.cloud.documentai.v1.Document." - + "TextAnchor\022\022\n\nconfidence\030\002 \001(\002\022?\n\rboundi" - + "ng_poly\030\003 \001(\0132(.google.cloud.documentai." - + "v1.BoundingPoly\022Q\n\013orientation\030\004 \001(\0162<.g" - + "oogle.cloud.documentai.v1.Document.Page." - + "Layout.Orientation\"e\n\013Orientation\022\033\n\027ORI" - + "ENTATION_UNSPECIFIED\020\000\022\013\n\007PAGE_UP\020\001\022\016\n\nP" - + "AGE_RIGHT\020\002\022\r\n\tPAGE_DOWN\020\003\022\r\n\tPAGE_LEFT\020" - + "\004\032\346\001\n\005Block\022@\n\006layout\030\001 \001(\01320.google.clo" - + "ud.documentai.v1.Document.Page.Layout\022V\n" - + "\022detected_languages\030\002 \003(\0132:.google.cloud" - + ".documentai.v1.Document.Page.DetectedLan" - + "guage\022C\n\nprovenance\030\003 \001(\0132/.google.cloud" - + ".documentai.v1.Document.Provenance\032\352\001\n\tP" - + "aragraph\022@\n\006layout\030\001 \001(\01320.google.cloud." + + "api/field_behavior.proto\032(google/cloud/d" + + "ocumentai/v1/barcode.proto\032)google/cloud" + + "/documentai/v1/geometry.proto\032\037google/pr" + + "otobuf/timestamp.proto\032\027google/rpc/statu" + + "s.proto\032\027google/type/color.proto\032\026google" + + "/type/date.proto\032\032google/type/datetime.p" + + "roto\032\027google/type/money.proto\032 google/ty" + + "pe/postal_address.proto\"\230>\n\010Document\022\022\n\003" + + "uri\030\001 \001(\tB\003\340A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A\001H\000" + + "\022\021\n\tmime_type\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A\001\022?" + + "\n\013text_styles\030\005 \003(\0132*.google.cloud.docum" + + "entai.v1.Document.Style\0228\n\005pages\030\006 \003(\0132)" + + ".google.cloud.documentai.v1.Document.Pag" + + "e\022=\n\010entities\030\007 \003(\0132+.google.cloud.docum" + + "entai.v1.Document.Entity\022M\n\020entity_relat" + + "ions\030\010 \003(\01323.google.cloud.documentai.v1." + + "Document.EntityRelation\022E\n\014text_changes\030" + + "\016 \003(\0132/.google.cloud.documentai.v1.Docum" + + "ent.TextChange\022B\n\nshard_info\030\t \001(\0132..goo" + + "gle.cloud.documentai.v1.Document.ShardIn" + + "fo\022!\n\005error\030\n \001(\0132\022.google.rpc.Status\022@\n" + + "\trevisions\030\r \003(\0132-.google.cloud.document" + + "ai.v1.Document.Revision\032J\n\tShardInfo\022\023\n\013" + + "shard_index\030\001 \001(\003\022\023\n\013shard_count\030\002 \001(\003\022\023" + + "\n\013text_offset\030\003 \001(\003\032\320\002\n\005Style\022D\n\013text_an" + + "chor\030\001 \001(\0132/.google.cloud.documentai.v1." + + "Document.TextAnchor\022!\n\005color\030\002 \001(\0132\022.goo" + + "gle.type.Color\022,\n\020background_color\030\003 \001(\013" + + "2\022.google.type.Color\022\023\n\013font_weight\030\004 \001(" + + "\t\022\022\n\ntext_style\030\005 \001(\t\022\027\n\017text_decoration" + + "\030\006 \001(\t\022F\n\tfont_size\030\007 \001(\01323.google.cloud" + + ".documentai.v1.Document.Style.FontSize\032&" + + "\n\010FontSize\022\014\n\004size\030\001 \001(\002\022\014\n\004unit\030\002 \001(\t\032\214" + + "#\n\004Page\022\023\n\013page_number\030\001 \001(\005\022>\n\005image\030\r " + + "\001(\0132/.google.cloud.documentai.v1.Documen" + + "t.Page.Image\022D\n\ntransforms\030\016 \003(\01320.googl" + + "e.cloud.documentai.v1.Document.Page.Matr" + + "ix\022F\n\tdimension\030\002 \001(\01323.google.cloud.doc" + + "umentai.v1.Document.Page.Dimension\022@\n\006la" + + "yout\030\003 \001(\01320.google.cloud.documentai.v1." + + "Document.Page.Layout\022V\n\022detected_languag" + + "es\030\004 \003(\0132:.google.cloud.documentai.v1.Do" + + "cument.Page.DetectedLanguage\022?\n\006blocks\030\005" + + " \003(\0132/.google.cloud.documentai.v1.Docume" + + "nt.Page.Block\022G\n\nparagraphs\030\006 \003(\01323.goog" + + "le.cloud.documentai.v1.Document.Page.Par" + + "agraph\022=\n\005lines\030\007 \003(\0132..google.cloud.doc" + + "umentai.v1.Document.Page.Line\022?\n\006tokens\030" + + "\010 \003(\0132/.google.cloud.documentai.v1.Docum" + + "ent.Page.Token\022P\n\017visual_elements\030\t \003(\0132" + + "7.google.cloud.documentai.v1.Document.Pa" + + "ge.VisualElement\022?\n\006tables\030\n \003(\0132/.googl" + + "e.cloud.documentai.v1.Document.Page.Tabl" + + "e\022H\n\013form_fields\030\013 \003(\01323.google.cloud.do" + + "cumentai.v1.Document.Page.FormField\022A\n\007s" + + "ymbols\030\014 \003(\01320.google.cloud.documentai.v" + + "1.Document.Page.Symbol\022T\n\021detected_barco" + + "des\030\017 \003(\01329.google.cloud.documentai.v1.D" + + "ocument.Page.DetectedBarcode\022C\n\nprovenan" + + "ce\030\020 \001(\0132/.google.cloud.documentai.v1.Do" + + "cument.Provenance\0328\n\tDimension\022\r\n\005width\030" + + "\001 \001(\002\022\016\n\006height\030\002 \001(\002\022\014\n\004unit\030\003 \001(\t\032J\n\005I" + + "mage\022\017\n\007content\030\001 \001(\014\022\021\n\tmime_type\030\002 \001(\t" + + "\022\r\n\005width\030\003 \001(\005\022\016\n\006height\030\004 \001(\005\032@\n\006Matri" + + "x\022\014\n\004rows\030\001 \001(\005\022\014\n\004cols\030\002 \001(\005\022\014\n\004type\030\003 " + + "\001(\005\022\014\n\004data\030\004 \001(\014\032\335\002\n\006Layout\022D\n\013text_anc" + + "hor\030\001 \001(\0132/.google.cloud.documentai.v1.D" + + "ocument.TextAnchor\022\022\n\nconfidence\030\002 \001(\002\022?" + + "\n\rbounding_poly\030\003 \001(\0132(.google.cloud.doc" + + "umentai.v1.BoundingPoly\022Q\n\013orientation\030\004" + + " \001(\0162<.google.cloud.documentai.v1.Docume" + + "nt.Page.Layout.Orientation\"e\n\013Orientatio" + + "n\022\033\n\027ORIENTATION_UNSPECIFIED\020\000\022\013\n\007PAGE_U" + + "P\020\001\022\016\n\nPAGE_RIGHT\020\002\022\r\n\tPAGE_DOWN\020\003\022\r\n\tPA" + + "GE_LEFT\020\004\032\346\001\n\005Block\022@\n\006layout\030\001 \001(\01320.go" + + "ogle.cloud.documentai.v1.Document.Page.L" + + "ayout\022V\n\022detected_languages\030\002 \003(\0132:.goog" + + "le.cloud.documentai.v1.Document.Page.Det" + + "ectedLanguage\022C\n\nprovenance\030\003 \001(\0132/.goog" + + "le.cloud.documentai.v1.Document.Provenan" + + "ce\032\352\001\n\tParagraph\022@\n\006layout\030\001 \001(\01320.googl" + + "e.cloud.documentai.v1.Document.Page.Layo" + + "ut\022V\n\022detected_languages\030\002 \003(\0132:.google." + + "cloud.documentai.v1.Document.Page.Detect" + + "edLanguage\022C\n\nprovenance\030\003 \001(\0132/.google." + + "cloud.documentai.v1.Document.Provenance\032" + + "\345\001\n\004Line\022@\n\006layout\030\001 \001(\01320.google.cloud." + "documentai.v1.Document.Page.Layout\022V\n\022de" + "tected_languages\030\002 \003(\0132:.google.cloud.do" + "cumentai.v1.Document.Page.DetectedLangua" + "ge\022C\n\nprovenance\030\003 \001(\0132/.google.cloud.do" - + "cumentai.v1.Document.Provenance\032\345\001\n\004Line" - + "\022@\n\006layout\030\001 \001(\01320.google.cloud.document" - + "ai.v1.Document.Page.Layout\022V\n\022detected_l" - + "anguages\030\002 \003(\0132:.google.cloud.documentai" - + ".v1.Document.Page.DetectedLanguage\022C\n\npr" - + "ovenance\030\003 \001(\0132/.google.cloud.documentai" - + ".v1.Document.Provenance\032\346\003\n\005Token\022@\n\006lay" - + "out\030\001 \001(\01320.google.cloud.documentai.v1.D" - + "ocument.Page.Layout\022U\n\016detected_break\030\002 " - + "\001(\0132=.google.cloud.documentai.v1.Documen" - + "t.Page.Token.DetectedBreak\022V\n\022detected_l" - + "anguages\030\003 \003(\0132:.google.cloud.documentai" - + ".v1.Document.Page.DetectedLanguage\022C\n\npr" - + "ovenance\030\004 \001(\0132/.google.cloud.documentai" - + ".v1.Document.Provenance\032\246\001\n\rDetectedBrea" - + "k\022P\n\004type\030\001 \001(\0162B.google.cloud.documenta" - + "i.v1.Document.Page.Token.DetectedBreak.T" - + "ype\"C\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\t\n\005SPA" - + "CE\020\001\022\016\n\nWIDE_SPACE\020\002\022\n\n\006HYPHEN\020\003\032\242\001\n\006Sym" - + "bol\022@\n\006layout\030\001 \001(\01320.google.cloud.docum" - + "entai.v1.Document.Page.Layout\022V\n\022detecte" - + "d_languages\030\002 \003(\0132:.google.cloud.documen" - + "tai.v1.Document.Page.DetectedLanguage\032\267\001" - + "\n\rVisualElement\022@\n\006layout\030\001 \001(\01320.google" - + ".cloud.documentai.v1.Document.Page.Layou" - + "t\022\014\n\004type\030\002 \001(\t\022V\n\022detected_languages\030\003 " - + "\003(\0132:.google.cloud.documentai.v1.Documen" - + "t.Page.DetectedLanguage\032\337\004\n\005Table\022@\n\006lay" - + "out\030\001 \001(\01320.google.cloud.documentai.v1.D" - + "ocument.Page.Layout\022M\n\013header_rows\030\002 \003(\013" - + "28.google.cloud.documentai.v1.Document.P" - + "age.Table.TableRow\022K\n\tbody_rows\030\003 \003(\01328." - + "google.cloud.documentai.v1.Document.Page" - + ".Table.TableRow\022V\n\022detected_languages\030\004 " - + "\003(\0132:.google.cloud.documentai.v1.Documen" - + "t.Page.DetectedLanguage\032T\n\010TableRow\022H\n\005c" - + "ells\030\001 \003(\01329.google.cloud.documentai.v1." - + "Document.Page.Table.TableCell\032\311\001\n\tTableC" - + "ell\022@\n\006layout\030\001 \001(\01320.google.cloud.docum" - + "entai.v1.Document.Page.Layout\022\020\n\010row_spa" - + "n\030\002 \001(\005\022\020\n\010col_span\030\003 \001(\005\022V\n\022detected_la" - + "nguages\030\004 \003(\0132:.google.cloud.documentai." - + "v1.Document.Page.DetectedLanguage\032\254\003\n\tFo" - + "rmField\022D\n\nfield_name\030\001 \001(\01320.google.clo" - + "ud.documentai.v1.Document.Page.Layout\022E\n" - + "\013field_value\030\002 \001(\01320.google.cloud.docume" - + "ntai.v1.Document.Page.Layout\022[\n\027name_det" - + "ected_languages\030\003 \003(\0132:.google.cloud.doc" + + "cumentai.v1.Document.Provenance\032\346\003\n\005Toke" + + "n\022@\n\006layout\030\001 \001(\01320.google.cloud.documen" + + "tai.v1.Document.Page.Layout\022U\n\016detected_" + + "break\030\002 \001(\0132=.google.cloud.documentai.v1" + + ".Document.Page.Token.DetectedBreak\022V\n\022de" + + "tected_languages\030\003 \003(\0132:.google.cloud.do" + + "cumentai.v1.Document.Page.DetectedLangua" + + "ge\022C\n\nprovenance\030\004 \001(\0132/.google.cloud.do" + + "cumentai.v1.Document.Provenance\032\246\001\n\rDete" + + "ctedBreak\022P\n\004type\030\001 \001(\0162B.google.cloud.d" + + "ocumentai.v1.Document.Page.Token.Detecte" + + "dBreak.Type\"C\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020" + + "\000\022\t\n\005SPACE\020\001\022\016\n\nWIDE_SPACE\020\002\022\n\n\006HYPHEN\020\003" + + "\032\242\001\n\006Symbol\022@\n\006layout\030\001 \001(\01320.google.clo" + + "ud.documentai.v1.Document.Page.Layout\022V\n" + + "\022detected_languages\030\002 \003(\0132:.google.cloud" + + ".documentai.v1.Document.Page.DetectedLan" + + "guage\032\267\001\n\rVisualElement\022@\n\006layout\030\001 \001(\0132" + + "0.google.cloud.documentai.v1.Document.Pa" + + "ge.Layout\022\014\n\004type\030\002 \001(\t\022V\n\022detected_lang" + + "uages\030\003 \003(\0132:.google.cloud.documentai.v1" + + ".Document.Page.DetectedLanguage\032\337\004\n\005Tabl" + + "e\022@\n\006layout\030\001 \001(\01320.google.cloud.documen" + + "tai.v1.Document.Page.Layout\022M\n\013header_ro" + + "ws\030\002 \003(\01328.google.cloud.documentai.v1.Do" + + "cument.Page.Table.TableRow\022K\n\tbody_rows\030" + + "\003 \003(\01328.google.cloud.documentai.v1.Docum" + + "ent.Page.Table.TableRow\022V\n\022detected_lang" + + "uages\030\004 \003(\0132:.google.cloud.documentai.v1" + + ".Document.Page.DetectedLanguage\032T\n\010Table" + + "Row\022H\n\005cells\030\001 \003(\01329.google.cloud.docume" + + "ntai.v1.Document.Page.Table.TableCell\032\311\001" + + "\n\tTableCell\022@\n\006layout\030\001 \001(\01320.google.clo" + + "ud.documentai.v1.Document.Page.Layout\022\020\n" + + "\010row_span\030\002 \001(\005\022\020\n\010col_span\030\003 \001(\005\022V\n\022det" + + "ected_languages\030\004 \003(\0132:.google.cloud.doc" + "umentai.v1.Document.Page.DetectedLanguag" - + "e\022\\\n\030value_detected_languages\030\004 \003(\0132:.go" - + "ogle.cloud.documentai.v1.Document.Page.D" - + "etectedLanguage\022\022\n\nvalue_type\030\005 \001(\t\022C\n\np" - + "rovenance\030\010 \001(\0132/.google.cloud.documenta" - + "i.v1.Document.Provenance\032=\n\020DetectedLang" - + "uage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\nconfidenc" - + "e\030\002 \001(\002\032\240\006\n\006Entity\022I\n\013text_anchor\030\001 \001(\0132" - + "/.google.cloud.documentai.v1.Document.Te" - + "xtAnchorB\003\340A\001\022\021\n\004type\030\002 \001(\tB\003\340A\002\022\031\n\014ment" - + "ion_text\030\003 \001(\tB\003\340A\001\022\027\n\nmention_id\030\004 \001(\tB" - + "\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\022I\n\013page_an" - + "chor\030\006 \001(\0132/.google.cloud.documentai.v1." - + "Document.PageAnchorB\003\340A\001\022\017\n\002id\030\007 \001(\tB\003\340A" - + "\001\022Z\n\020normalized_value\030\t \001(\0132;.google.clo" - + "ud.documentai.v1.Document.Entity.Normali" - + "zedValueB\003\340A\001\022D\n\nproperties\030\n \003(\0132+.goog" - + "le.cloud.documentai.v1.Document.EntityB\003" - + "\340A\001\022H\n\nprovenance\030\013 \001(\0132/.google.cloud.d" - + "ocumentai.v1.Document.ProvenanceB\003\340A\001\022\025\n" - + "\010redacted\030\014 \001(\010B\003\340A\001\032\213\002\n\017NormalizedValue" - + "\022)\n\013money_value\030\002 \001(\0132\022.google.type.Mone" - + "yH\000\022\'\n\ndate_value\030\003 \001(\0132\021.google.type.Da" - + "teH\000\022/\n\016datetime_value\030\004 \001(\0132\025.google.ty" - + "pe.DateTimeH\000\0223\n\raddress_value\030\005 \001(\0132\032.g" - + "oogle.type.PostalAddressH\000\022\027\n\rboolean_va" - + "lue\030\006 \001(\010H\000\022\021\n\004text\030\001 \001(\tB\003\340A\001B\022\n\020struct" - + "ured_value\032I\n\016EntityRelation\022\022\n\nsubject_" - + "id\030\001 \001(\t\022\021\n\tobject_id\030\002 \001(\t\022\020\n\010relation\030" - + "\003 \001(\t\032\250\001\n\nTextAnchor\022R\n\rtext_segments\030\001 " - + "\003(\0132;.google.cloud.documentai.v1.Documen" - + "t.TextAnchor.TextSegment\022\017\n\007content\030\002 \001(" - + "\t\0325\n\013TextSegment\022\023\n\013start_index\030\001 \001(\003\022\021\n" - + "\tend_index\030\002 \001(\003\032\330\003\n\nPageAnchor\022J\n\tpage_" - + "refs\030\001 \003(\01327.google.cloud.documentai.v1." - + "Document.PageAnchor.PageRef\032\375\002\n\007PageRef\022" - + "\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013layout_type\030\002 \001(\0162" - + "B.google.cloud.documentai.v1.Document.Pa" - + "geAnchor.PageRef.LayoutTypeB\003\340A\001\022\030\n\tlayo" - + "ut_id\030\003 \001(\tB\005\030\001\340A\001\022D\n\rbounding_poly\030\004 \001(" - + "\0132(.google.cloud.documentai.v1.BoundingP" - + "olyB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\"\207\001\n\nLa" - + "youtType\022\033\n\027LAYOUT_TYPE_UNSPECIFIED\020\000\022\t\n" - + "\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010\n\004LINE\020\003\022\t\n\005TOK" - + "EN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022\t\n\005TABLE\020\006\022\016\n\nF" - + "ORM_FIELD\020\007\032\214\003\n\nProvenance\022\020\n\010revision\030\001" - + " \001(\005\022\016\n\002id\030\002 \001(\005B\002\030\001\022G\n\007parents\030\003 \003(\01326." - + "google.cloud.documentai.v1.Document.Prov" - + "enance.Parent\022K\n\004type\030\004 \001(\0162=.google.clo" - + "ud.documentai.v1.Document.Provenance.Ope" - + "rationType\0329\n\006Parent\022\020\n\010revision\030\001 \001(\005\022\r" - + "\n\005index\030\003 \001(\005\022\016\n\002id\030\002 \001(\005B\002\030\001\"\212\001\n\rOperat" - + "ionType\022\036\n\032OPERATION_TYPE_UNSPECIFIED\020\000\022" - + "\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003\022\022\n\016EVA" - + "L_REQUESTED\020\004\022\021\n\rEVAL_APPROVED\020\005\022\020\n\014EVAL" - + "_SKIPPED\020\006\032\215\002\n\010Revision\022\017\n\005agent\030\004 \001(\tH\000" - + "\022\023\n\tprocessor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001(\t\022\016\n\006par" - + "ent\030\002 \003(\005\022/\n\013create_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\022O\n\014human_review\030\006 \001(\013" - + "29.google.cloud.documentai.v1.Document.R" - + "evision.HumanReview\0323\n\013HumanReview\022\r\n\005st" - + "ate\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006sour" - + "ce\032\255\001\n\nTextChange\022D\n\013text_anchor\030\001 \001(\0132/" - + ".google.cloud.documentai.v1.Document.Tex" - + "tAnchor\022\024\n\014changed_text\030\002 \001(\t\022C\n\nprovena" - + "nce\030\003 \003(\0132/.google.cloud.documentai.v1.D" - + "ocument.ProvenanceB\010\n\006sourceB\321\001\n\036com.goo" - + "gle.cloud.documentai.v1B\rDocumentProtoP\001" - + "ZDgoogle.golang.org/genproto/googleapis/" - + "cloud/documentai/v1;documentai\252\002\032Google." - + "Cloud.DocumentAI.V1\312\002\032Google\\Cloud\\Docum" - + "entAI\\V1\352\002\035Google::Cloud::DocumentAI::V1" - + "b\006proto3" + + "e\032\346\003\n\tFormField\022D\n\nfield_name\030\001 \001(\01320.go" + + "ogle.cloud.documentai.v1.Document.Page.L" + + "ayout\022E\n\013field_value\030\002 \001(\01320.google.clou" + + "d.documentai.v1.Document.Page.Layout\022[\n\027" + + "name_detected_languages\030\003 \003(\0132:.google.c" + + "loud.documentai.v1.Document.Page.Detecte" + + "dLanguage\022\\\n\030value_detected_languages\030\004 " + + "\003(\0132:.google.cloud.documentai.v1.Documen" + + "t.Page.DetectedLanguage\022\022\n\nvalue_type\030\005 " + + "\001(\t\022\032\n\022corrected_key_text\030\006 \001(\t\022\034\n\024corre" + + "cted_value_text\030\007 \001(\t\022C\n\nprovenance\030\010 \001(" + + "\0132/.google.cloud.documentai.v1.Document." + + "Provenance\032\211\001\n\017DetectedBarcode\022@\n\006layout" + + "\030\001 \001(\01320.google.cloud.documentai.v1.Docu" + + "ment.Page.Layout\0224\n\007barcode\030\002 \001(\0132#.goog" + + "le.cloud.documentai.v1.Barcode\032=\n\020Detect" + + "edLanguage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\ncon" + + "fidence\030\002 \001(\002\032\320\006\n\006Entity\022I\n\013text_anchor\030" + + "\001 \001(\0132/.google.cloud.documentai.v1.Docum" + + "ent.TextAnchorB\003\340A\001\022\021\n\004type\030\002 \001(\tB\003\340A\002\022\031" + + "\n\014mention_text\030\003 \001(\tB\003\340A\001\022\027\n\nmention_id\030" + + "\004 \001(\tB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\022I\n\013p" + + "age_anchor\030\006 \001(\0132/.google.cloud.document" + + "ai.v1.Document.PageAnchorB\003\340A\001\022\017\n\002id\030\007 \001" + + "(\tB\003\340A\001\022Z\n\020normalized_value\030\t \001(\0132;.goog" + + "le.cloud.documentai.v1.Document.Entity.N" + + "ormalizedValueB\003\340A\001\022D\n\nproperties\030\n \003(\0132" + + "+.google.cloud.documentai.v1.Document.En" + + "tityB\003\340A\001\022H\n\nprovenance\030\013 \001(\0132/.google.c" + + "loud.documentai.v1.Document.ProvenanceB\003" + + "\340A\001\022\025\n\010redacted\030\014 \001(\010B\003\340A\001\032\273\002\n\017Normalize" + + "dValue\022)\n\013money_value\030\002 \001(\0132\022.google.typ" + + "e.MoneyH\000\022\'\n\ndate_value\030\003 \001(\0132\021.google.t" + + "ype.DateH\000\022/\n\016datetime_value\030\004 \001(\0132\025.goo" + + "gle.type.DateTimeH\000\0223\n\raddress_value\030\005 \001" + + "(\0132\032.google.type.PostalAddressH\000\022\027\n\rbool" + + "ean_value\030\006 \001(\010H\000\022\027\n\rinteger_value\030\007 \001(\005" + + "H\000\022\025\n\013float_value\030\010 \001(\002H\000\022\021\n\004text\030\001 \001(\tB" + + "\003\340A\001B\022\n\020structured_value\032I\n\016EntityRelati" + + "on\022\022\n\nsubject_id\030\001 \001(\t\022\021\n\tobject_id\030\002 \001(" + + "\t\022\020\n\010relation\030\003 \001(\t\032\250\001\n\nTextAnchor\022R\n\rte" + + "xt_segments\030\001 \003(\0132;.google.cloud.documen" + + "tai.v1.Document.TextAnchor.TextSegment\022\017" + + "\n\007content\030\002 \001(\t\0325\n\013TextSegment\022\023\n\013start_" + + "index\030\001 \001(\003\022\021\n\tend_index\030\002 \001(\003\032\330\003\n\nPageA" + + "nchor\022J\n\tpage_refs\030\001 \003(\01327.google.cloud." + + "documentai.v1.Document.PageAnchor.PageRe" + + "f\032\375\002\n\007PageRef\022\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013layo" + + "ut_type\030\002 \001(\0162B.google.cloud.documentai." + + "v1.Document.PageAnchor.PageRef.LayoutTyp" + + "eB\003\340A\001\022\030\n\tlayout_id\030\003 \001(\tB\005\030\001\340A\001\022D\n\rboun" + + "ding_poly\030\004 \001(\0132(.google.cloud.documenta" + + "i.v1.BoundingPolyB\003\340A\001\022\027\n\nconfidence\030\005 \001" + + "(\002B\003\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_TYPE_UN" + + "SPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010\n" + + "\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022\t" + + "\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\214\003\n\nProvenance" + + "\022\020\n\010revision\030\001 \001(\005\022\016\n\002id\030\002 \001(\005B\002\030\001\022G\n\007pa" + + "rents\030\003 \003(\01326.google.cloud.documentai.v1" + + ".Document.Provenance.Parent\022K\n\004type\030\004 \001(" + + "\0162=.google.cloud.documentai.v1.Document." + + "Provenance.OperationType\0329\n\006Parent\022\020\n\010re" + + "vision\030\001 \001(\005\022\r\n\005index\030\003 \001(\005\022\016\n\002id\030\002 \001(\005B" + + "\002\030\001\"\212\001\n\rOperationType\022\036\n\032OPERATION_TYPE_" + + "UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007RE" + + "PLACE\020\003\022\022\n\016EVAL_REQUESTED\020\004\022\021\n\rEVAL_APPR" + + "OVED\020\005\022\020\n\014EVAL_SKIPPED\020\006\032\245\002\n\010Revision\022\017\n" + + "\005agent\030\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\tH\000\022\n\n\002i" + + "d\030\001 \001(\t\022\022\n\006parent\030\002 \003(\005B\002\030\001\022\022\n\nparent_id" + + "s\030\007 \003(\t\022/\n\013create_time\030\003 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022O\n\014human_review\030\006 \001(\01329" + + ".google.cloud.documentai.v1.Document.Rev" + + "ision.HumanReview\0323\n\013HumanReview\022\r\n\005stat" + + "e\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006source" + + "\032\255\001\n\nTextChange\022D\n\013text_anchor\030\001 \001(\0132/.g" + + "oogle.cloud.documentai.v1.Document.TextA" + + "nchor\022\024\n\014changed_text\030\002 \001(\t\022C\n\nprovenanc" + + "e\030\003 \003(\0132/.google.cloud.documentai.v1.Doc" + + "ument.ProvenanceB\010\n\006sourceB\321\001\n\036com.googl" + + "e.cloud.documentai.v1B\rDocumentProtoP\001ZD" + + "google.golang.org/genproto/googleapis/cl" + + "oud/documentai/v1;documentai\252\002\032Google.Cl" + + "oud.DocumentAI.V1\312\002\032Google\\Cloud\\Documen" + + "tAI\\V1\352\002\035Google::Cloud::DocumentAI::V1b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.documentai.v1.BarcodeProto.getDescriptor(), com.google.cloud.documentai.v1.GeometryProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), @@ -460,6 +475,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Tables", "FormFields", "Symbols", + "DetectedBarcodes", "Provenance", }); internal_static_google_cloud_documentai_v1_Document_Page_Dimension_descriptor = @@ -595,12 +611,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "NameDetectedLanguages", "ValueDetectedLanguages", "ValueType", + "CorrectedKeyText", + "CorrectedValueText", "Provenance", }); - internal_static_google_cloud_documentai_v1_Document_Page_DetectedLanguage_descriptor = + internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor = internal_static_google_cloud_documentai_v1_Document_Page_descriptor .getNestedTypes() .get(12); + internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Document_Page_DetectedBarcode_descriptor, + new java.lang.String[] { + "Layout", "Barcode", + }); + internal_static_google_cloud_documentai_v1_Document_Page_DetectedLanguage_descriptor = + internal_static_google_cloud_documentai_v1_Document_Page_descriptor + .getNestedTypes() + .get(13); internal_static_google_cloud_documentai_v1_Document_Page_DetectedLanguage_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_Document_Page_DetectedLanguage_descriptor, @@ -638,6 +666,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DatetimeValue", "AddressValue", "BooleanValue", + "IntegerValue", + "FloatValue", "Text", "StructuredValue", }); @@ -709,7 +739,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_Document_Revision_descriptor, new java.lang.String[] { - "Agent", "Processor", "Id", "Parent", "CreateTime", "HumanReview", "Source", + "Agent", + "Processor", + "Id", + "Parent", + "ParentIds", + "CreateTime", + "HumanReview", + "Source", }); internal_static_google_cloud_documentai_v1_Document_Revision_HumanReview_descriptor = internal_static_google_cloud_documentai_v1_Document_Revision_descriptor @@ -735,6 +772,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.documentai.v1.BarcodeProto.getDescriptor(); com.google.cloud.documentai.v1.GeometryProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java new file mode 100644 index 00000000000..b0ebce018e5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java @@ -0,0 +1,7083 @@ +/* + * 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/documentai/v1/document_schema.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The schema defines the output of the processed document by a processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema} + */ +public final class DocumentSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DocumentSchema) + DocumentSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentSchema.newBuilder() to construct. + private DocumentSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentSchema() { + displayName_ = ""; + description_ = ""; + entityTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentSchema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentSchema( + 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(); + + displayName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entityTypes_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.DocumentSchema.EntityType>(); + mutable_bitField0_ |= 0x00000001; + } + entityTypes_.add( + input.readMessage( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.parser(), + extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + com.google.cloud.documentai.v1.DocumentSchema.Metadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.class, + com.google.cloud.documentai.v1.DocumentSchema.Builder.class); + } + + public interface EntityTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DocumentSchema.EntityType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + boolean hasEnumValues(); + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues getEnumValues(); + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder(); + + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + java.util.List getBaseTypesList(); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + int getBaseTypesCount(); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + java.lang.String getBaseTypes(int index); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + com.google.protobuf.ByteString getBaseTypesBytes(int index); + + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + java.util.List + getPropertiesList(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property getProperties(int index); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + int getPropertiesCount(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + java.util.List< + ? extends com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index); + + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.ValueSourceCase + getValueSourceCase(); + } + /** + * + * + *
+   * EntityType is the wrapper of a label of the corresponding model with
+   * detailed attributes and limitations for entity-based processors. Multiple
+   * types can also compose a dependency tree to represent nested types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType} + */ + public static final class EntityType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DocumentSchema.EntityType) + EntityTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use EntityType.newBuilder() to construct. + private EntityType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EntityType() { + displayName_ = ""; + name_ = ""; + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + properties_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EntityType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + baseTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + baseTypes_.add(s); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + properties_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property>(); + mutable_bitField0_ |= 0x00000002; + } + properties_.add( + input.readMessage( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.parser(), + extensionRegistry)); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 114: + { + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder + subBuilder = null; + if (valueSourceCase_ == 14) { + subBuilder = + ((com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_) + .toBuilder(); + } + valueSource_ = + input.readMessage( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_); + valueSource_ = subBuilder.buildPartial(); + } + valueSourceCase_ = 14; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + baseTypes_ = baseTypes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder.class); + } + + public interface EnumValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); + } + /** + * + * + *
+     * Defines the a list of enum values.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} + */ + public static final class EnumValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + EnumValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumValues.newBuilder() to construct. + private EnumValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumValues(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnumValues( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + values_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList values_; + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + 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 < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + 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 < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + 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.documentai.v1.DocumentSchema.EntityType.EnumValues)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues other = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) obj; + + if (!getValuesList().equals(other.getValuesList())) 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 (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues 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.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues 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.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues 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.documentai.v1.DocumentSchema.EntityType.EnumValues + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + 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.documentai.v1.DocumentSchema.EntityType.EnumValues parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues 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.documentai.v1.DocumentSchema.EntityType.EnumValues 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; + } + /** + * + * + *
+       * Defines the a list of enum values.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder + .class); + } + + // Construct using + // com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.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(); + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues build() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues buildPartial() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues result = + new com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + 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.documentai.v1.DocumentSchema.EntityType.EnumValues) { + return mergeFrom( + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues other) { + if (other + == com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + 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.documentai.v1.DocumentSchema.EntityType.EnumValues parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList values_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_.getUnmodifiableView(); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(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.documentai.v1.DocumentSchema.EntityType.EnumValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + private static final com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues(); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumValues parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumValues(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.documentai.v1.DocumentSchema.EntityType.EnumValues + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + java.lang.String getValueType(); + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + com.google.protobuf.ByteString getValueTypeBytes(); + + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + int getOccurrenceTypeValue(); + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType(); + } + /** + * + * + *
+     * Defines properties that can be part of the entity type.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType.Property} + */ + public static final class Property extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + PropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Property() { + name_ = ""; + valueType_ = ""; + occurrenceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Property(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Property( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + valueType_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + occurrenceType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder.class); + } + + /** + * + * + *
+       * Types of occurrences of the entity type in the document.  Note: this
+       * represents the number of instances of an entity types, not number of
+       * mentions of a given entity instance.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType} + */ + public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Unspecified occurrence type.
+         * 
+ * + * OCCURRENCE_TYPE_UNSPECIFIED = 0; + */ + OCCURRENCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+         * There will be zero or one instance of this entity type.
+         * 
+ * + * OPTIONAL_ONCE = 1; + */ + OPTIONAL_ONCE(1), + /** + * + * + *
+         * The entity type will appear zero or multiple times.
+         * 
+ * + * OPTIONAL_MULTIPLE = 2; + */ + OPTIONAL_MULTIPLE(2), + /** + * + * + *
+         * The entity type will only appear exactly once.
+         * 
+ * + * REQUIRED_ONCE = 3; + */ + REQUIRED_ONCE(3), + /** + * + * + *
+         * The entity type will appear once or more times.
+         * 
+ * + * REQUIRED_MULTIPLE = 4; + */ + REQUIRED_MULTIPLE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Unspecified occurrence type.
+         * 
+ * + * OCCURRENCE_TYPE_UNSPECIFIED = 0; + */ + public static final int OCCURRENCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * There will be zero or one instance of this entity type.
+         * 
+ * + * OPTIONAL_ONCE = 1; + */ + public static final int OPTIONAL_ONCE_VALUE = 1; + /** + * + * + *
+         * The entity type will appear zero or multiple times.
+         * 
+ * + * OPTIONAL_MULTIPLE = 2; + */ + public static final int OPTIONAL_MULTIPLE_VALUE = 2; + /** + * + * + *
+         * The entity type will only appear exactly once.
+         * 
+ * + * REQUIRED_ONCE = 3; + */ + public static final int REQUIRED_ONCE_VALUE = 3; + /** + * + * + *
+         * The entity type will appear once or more times.
+         * 
+ * + * REQUIRED_MULTIPLE = 4; + */ + public static final int REQUIRED_MULTIPLE_VALUE = 4; + + 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 OccurrenceType 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 OccurrenceType forNumber(int value) { + switch (value) { + case 0: + return OCCURRENCE_TYPE_UNSPECIFIED; + case 1: + return OPTIONAL_ONCE; + case 2: + return OPTIONAL_MULTIPLE; + case 3: + return REQUIRED_ONCE; + case 4: + return REQUIRED_MULTIPLE; + 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 OccurrenceType findValueByNumber(int number) { + return OccurrenceType.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.documentai.v1.DocumentSchema.EntityType.Property.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final OccurrenceType[] VALUES = values(); + + public static OccurrenceType 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 OccurrenceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object valueType_; + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + @java.lang.Override + public java.lang.String getValueType() { + java.lang.Object ref = valueType_; + 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(); + valueType_ = s; + return s; + } + } + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueTypeBytes() { + java.lang.Object ref = valueType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OCCURRENCE_TYPE_FIELD_NUMBER = 3; + private int occurrenceType_; + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + @java.lang.Override + public int getOccurrenceTypeValue() { + return occurrenceType_; + } + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType result = + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .valueOf(occurrenceType_); + return result == null + ? com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .UNRECOGNIZED + : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valueType_); + } + if (occurrenceType_ + != com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .OCCURRENCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, occurrenceType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueType_); + } + if (occurrenceType_ + != com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .OCCURRENCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, occurrenceType_); + } + 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.documentai.v1.DocumentSchema.EntityType.Property)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property other = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValueType().equals(other.getValueType())) return false; + if (occurrenceType_ != other.occurrenceType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + hash = (37 * hash) + OCCURRENCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + occurrenceType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property 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.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property 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.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property 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.documentai.v1.DocumentSchema.EntityType.Property + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + 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.documentai.v1.DocumentSchema.EntityType.Property parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property 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.documentai.v1.DocumentSchema.EntityType.Property 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; + } + /** + * + * + *
+       * Defines properties that can be part of the entity type.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType.Property} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + valueType_ = ""; + + occurrenceType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property build() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property buildPartial() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property result = + new com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property(this); + result.name_ = name_; + result.valueType_ = valueType_; + result.occurrenceType_ = occurrenceType_; + 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.documentai.v1.DocumentSchema.EntityType.Property) { + return mergeFrom( + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property other) { + if (other + == com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getValueType().isEmpty()) { + valueType_ = other.valueType_; + onChanged(); + } + if (other.occurrenceType_ != 0) { + setOccurrenceTypeValue(other.getOccurrenceTypeValue()); + } + 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.documentai.v1.DocumentSchema.EntityType.Property parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object valueType_ = ""; + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + public java.lang.String getValueType() { + java.lang.Object ref = valueType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + public com.google.protobuf.ByteString getValueTypeBytes() { + java.lang.Object ref = valueType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @param value The valueType to set. + * @return This builder for chaining. + */ + public Builder setValueType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearValueType() { + + valueType_ = getDefaultInstance().getValueType(); + onChanged(); + return this; + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @param value The bytes for valueType to set. + * @return This builder for chaining. + */ + public Builder setValueTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueType_ = value; + onChanged(); + return this; + } + + private int occurrenceType_ = 0; + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + @java.lang.Override + public int getOccurrenceTypeValue() { + return occurrenceType_; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @param value The enum numeric value on the wire for occurrenceType to set. + * @return This builder for chaining. + */ + public Builder setOccurrenceTypeValue(int value) { + + occurrenceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType result = + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .valueOf(occurrenceType_); + return result == null + ? com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @param value The occurrenceType to set. + * @return This builder for chaining. + */ + public Builder setOccurrenceType( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + value) { + if (value == null) { + throw new NullPointerException(); + } + + occurrenceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearOccurrenceType() { + + occurrenceType_ = 0; + 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.documentai.v1.DocumentSchema.EntityType.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + private static final com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property(); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Property(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.documentai.v1.DocumentSchema.EntityType.Property + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int valueSourceCase_ = 0; + private java.lang.Object valueSource_; + + public enum ValueSourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ENUM_VALUES(14), + VALUESOURCE_NOT_SET(0); + private final int value; + + private ValueSourceCase(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 ValueSourceCase valueOf(int value) { + return forNumber(value); + } + + public static ValueSourceCase forNumber(int value) { + switch (value) { + case 14: + return ENUM_VALUES; + case 0: + return VALUESOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueSourceCase getValueSourceCase() { + return ValueSourceCase.forNumber(valueSourceCase_); + } + + public static final int ENUM_VALUES_FIELD_NUMBER = 14; + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueSourceCase_ == 14; + } + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues getEnumValues() { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) valueSource_; + } + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder() { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) valueSource_; + } + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 13; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BASE_TYPES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList baseTypes_; + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + public com.google.protobuf.ProtocolStringList getBaseTypesList() { + return baseTypes_; + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + public int getBaseTypesCount() { + return baseTypes_.size(); + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + public java.lang.String getBaseTypes(int index) { + return baseTypes_.get(index); + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + public com.google.protobuf.ByteString getBaseTypesBytes(int index) { + return baseTypes_.getByteString(index); + } + + public static final int PROPERTIES_FIELD_NUMBER = 6; + private java.util.List + properties_; + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public java.util.List + getPropertiesList() { + return properties_; + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property getProperties( + int index) { + return properties_.get(index); + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + return properties_.get(index); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < baseTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, baseTypes_.getRaw(i)); + } + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(6, properties_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, displayName_); + } + if (valueSourceCase_ == 14) { + output.writeMessage( + 14, (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) valueSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < baseTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(baseTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getBaseTypesList().size(); + } + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, properties_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, displayName_); + } + if (valueSourceCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) valueSource_); + } + 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.documentai.v1.DocumentSchema.EntityType)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DocumentSchema.EntityType other = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getName().equals(other.getName())) return false; + if (!getBaseTypesList().equals(other.getBaseTypesList())) return false; + if (!getPropertiesList().equals(other.getPropertiesList())) return false; + if (!getValueSourceCase().equals(other.getValueSourceCase())) return false; + switch (valueSourceCase_) { + case 14: + if (!getEnumValues().equals(other.getEnumValues())) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getBaseTypesCount() > 0) { + hash = (37 * hash) + BASE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getBaseTypesList().hashCode(); + } + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + switch (valueSourceCase_) { + case 14: + hash = (37 * hash) + ENUM_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getEnumValues().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType 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.documentai.v1.DocumentSchema.EntityType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType 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.documentai.v1.DocumentSchema.EntityType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType 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.documentai.v1.DocumentSchema.EntityType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType 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.documentai.v1.DocumentSchema.EntityType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType 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.documentai.v1.DocumentSchema.EntityType 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; + } + /** + * + * + *
+     * EntityType is the wrapper of a label of the corresponding model with
+     * detailed attributes and limitations for entity-based processors. Multiple
+     * types can also compose a dependency tree to represent nested types.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.EntityType} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DocumentSchema.EntityType) + com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.class, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DocumentSchema.EntityType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPropertiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + name_ = ""; + + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + propertiesBuilder_.clear(); + } + valueSourceCase_ = 0; + valueSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType build() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType buildPartial() { + com.google.cloud.documentai.v1.DocumentSchema.EntityType result = + new com.google.cloud.documentai.v1.DocumentSchema.EntityType(this); + int from_bitField0_ = bitField0_; + if (valueSourceCase_ == 14) { + if (enumValuesBuilder_ == null) { + result.valueSource_ = valueSource_; + } else { + result.valueSource_ = enumValuesBuilder_.build(); + } + } + result.displayName_ = displayName_; + result.name_ = name_; + if (((bitField0_ & 0x00000001) != 0)) { + baseTypes_ = baseTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.baseTypes_ = baseTypes_; + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + result.valueSourceCase_ = valueSourceCase_; + 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.documentai.v1.DocumentSchema.EntityType) { + return mergeFrom((com.google.cloud.documentai.v1.DocumentSchema.EntityType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DocumentSchema.EntityType other) { + if (other == com.google.cloud.documentai.v1.DocumentSchema.EntityType.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.baseTypes_.isEmpty()) { + if (baseTypes_.isEmpty()) { + baseTypes_ = other.baseTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBaseTypesIsMutable(); + baseTypes_.addAll(other.baseTypes_); + } + onChanged(); + } + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000002); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + switch (other.getValueSourceCase()) { + case ENUM_VALUES: + { + mergeEnumValues(other.getEnumValues()); + break; + } + case VALUESOURCE_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.documentai.v1.DocumentSchema.EntityType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DocumentSchema.EntityType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valueSourceCase_ = 0; + private java.lang.Object valueSource_; + + public ValueSourceCase getValueSourceCase() { + return ValueSourceCase.forNumber(valueSourceCase_); + } + + public Builder clearValueSource() { + valueSourceCase_ = 0; + valueSource_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder> + enumValuesBuilder_; + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueSourceCase_ == 14; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues getEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } else { + if (valueSourceCase_ == 14) { + return enumValuesBuilder_.getMessage(); + } + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder setEnumValues( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues value) { + if (enumValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueSource_ = value; + onChanged(); + } else { + enumValuesBuilder_.setMessage(value); + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder setEnumValues( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder + builderForValue) { + if (enumValuesBuilder_ == null) { + valueSource_ = builderForValue.build(); + onChanged(); + } else { + enumValuesBuilder_.setMessage(builderForValue.build()); + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder mergeEnumValues( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues value) { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14 + && valueSource_ + != com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance()) { + valueSource_ = + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.newBuilder( + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_) + .mergeFrom(value) + .buildPartial(); + } else { + valueSource_ = value; + } + onChanged(); + } else { + if (valueSourceCase_ == 14) { + enumValuesBuilder_.mergeFrom(value); + } else { + enumValuesBuilder_.setMessage(value); + } + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder clearEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14) { + valueSourceCase_ = 0; + valueSource_ = null; + onChanged(); + } + } else { + if (valueSourceCase_ == 14) { + valueSourceCase_ = 0; + valueSource_ = null; + } + enumValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder + getEnumValuesBuilder() { + return getEnumValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder() { + if ((valueSourceCase_ == 14) && (enumValuesBuilder_ != null)) { + return enumValuesBuilder_.getMessageOrBuilder(); + } else { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder> + getEnumValuesFieldBuilder() { + if (enumValuesBuilder_ == null) { + if (!(valueSourceCase_ == 14)) { + valueSource_ = + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + enumValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValuesOrBuilder>( + (com.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + valueSource_, + getParentForChildren(), + isClean()); + valueSource_ = null; + } + valueSourceCase_ = 14; + onChanged(); + ; + return enumValuesBuilder_; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList baseTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBaseTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + baseTypes_ = new com.google.protobuf.LazyStringArrayList(baseTypes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + public com.google.protobuf.ProtocolStringList getBaseTypesList() { + return baseTypes_.getUnmodifiableView(); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + public int getBaseTypesCount() { + return baseTypes_.size(); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + public java.lang.String getBaseTypes(int index) { + return baseTypes_.get(index); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + public com.google.protobuf.ByteString getBaseTypesBytes(int index) { + return baseTypes_.getByteString(index); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index to set the value at. + * @param value The baseTypes to set. + * @return This builder for chaining. + */ + public Builder setBaseTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBaseTypesIsMutable(); + baseTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param value The baseTypes to add. + * @return This builder for chaining. + */ + public Builder addBaseTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBaseTypesIsMutable(); + baseTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param values The baseTypes to add. + * @return This builder for chaining. + */ + public Builder addAllBaseTypes(java.lang.Iterable values) { + ensureBaseTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, baseTypes_); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return This builder for chaining. + */ + public Builder clearBaseTypes() { + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param value The bytes of the baseTypes to add. + * @return This builder for chaining. + */ + public Builder addBaseTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBaseTypesIsMutable(); + baseTypes_.add(value); + onChanged(); + return this; + } + + private java.util.List + properties_ = java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + properties_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property>(properties_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List + getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property getProperties( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder setProperties( + int index, com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder setProperties( + int index, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + int index, com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + int index, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addAllProperties( + java.lang.Iterable< + ? extends com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property> + values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + getPropertiesBuilder(int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder + addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder> + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.PropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + @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.documentai.v1.DocumentSchema.EntityType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DocumentSchema.EntityType) + private static final com.google.cloud.documentai.v1.DocumentSchema.EntityType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DocumentSchema.EntityType(); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.EntityType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EntityType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EntityType(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.documentai.v1.DocumentSchema.EntityType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DocumentSchema.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If true, a `document` entity type can be applied to subdocument (
+     * splitting). Otherwise, it can only be applied to the entire document
+     * (classification).
+     * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + boolean getDocumentSplitter(); + + /** + * + * + *
+     * If true, on a given page, there can be multiple `document` annotations
+     * covering it.
+     * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + boolean getDocumentAllowMultipleLabels(); + + /** + * + * + *
+     * If set, all the nested entities must be prefixed with the parents.
+     * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + boolean getPrefixedNamingOnProperties(); + + /** + * + * + *
+     * If set, we will skip the naming format validation in the schema. So the
+     * string values in `DocumentSchema.EntityType.name` and
+     * `DocumentSchema.EntityType.Property.name` will not be checked.
+     * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + boolean getSkipNamingValidation(); + } + /** + * + * + *
+   * Metadata for global schema behavior.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DocumentSchema.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Metadata( + 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: + { + documentSplitter_ = input.readBool(); + break; + } + case 16: + { + documentAllowMultipleLabels_ = input.readBool(); + break; + } + case 48: + { + prefixedNamingOnProperties_ = input.readBool(); + break; + } + case 56: + { + skipNamingValidation_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.Metadata.class, + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder.class); + } + + public static final int DOCUMENT_SPLITTER_FIELD_NUMBER = 1; + private boolean documentSplitter_; + /** + * + * + *
+     * If true, a `document` entity type can be applied to subdocument (
+     * splitting). Otherwise, it can only be applied to the entire document
+     * (classification).
+     * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + @java.lang.Override + public boolean getDocumentSplitter() { + return documentSplitter_; + } + + public static final int DOCUMENT_ALLOW_MULTIPLE_LABELS_FIELD_NUMBER = 2; + private boolean documentAllowMultipleLabels_; + /** + * + * + *
+     * If true, on a given page, there can be multiple `document` annotations
+     * covering it.
+     * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + @java.lang.Override + public boolean getDocumentAllowMultipleLabels() { + return documentAllowMultipleLabels_; + } + + public static final int PREFIXED_NAMING_ON_PROPERTIES_FIELD_NUMBER = 6; + private boolean prefixedNamingOnProperties_; + /** + * + * + *
+     * If set, all the nested entities must be prefixed with the parents.
+     * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + @java.lang.Override + public boolean getPrefixedNamingOnProperties() { + return prefixedNamingOnProperties_; + } + + public static final int SKIP_NAMING_VALIDATION_FIELD_NUMBER = 7; + private boolean skipNamingValidation_; + /** + * + * + *
+     * If set, we will skip the naming format validation in the schema. So the
+     * string values in `DocumentSchema.EntityType.name` and
+     * `DocumentSchema.EntityType.Property.name` will not be checked.
+     * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + @java.lang.Override + public boolean getSkipNamingValidation() { + return skipNamingValidation_; + } + + 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 (documentSplitter_ != false) { + output.writeBool(1, documentSplitter_); + } + if (documentAllowMultipleLabels_ != false) { + output.writeBool(2, documentAllowMultipleLabels_); + } + if (prefixedNamingOnProperties_ != false) { + output.writeBool(6, prefixedNamingOnProperties_); + } + if (skipNamingValidation_ != false) { + output.writeBool(7, skipNamingValidation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (documentSplitter_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, documentSplitter_); + } + if (documentAllowMultipleLabels_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, documentAllowMultipleLabels_); + } + if (prefixedNamingOnProperties_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(6, prefixedNamingOnProperties_); + } + if (skipNamingValidation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, skipNamingValidation_); + } + 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.documentai.v1.DocumentSchema.Metadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DocumentSchema.Metadata other = + (com.google.cloud.documentai.v1.DocumentSchema.Metadata) obj; + + if (getDocumentSplitter() != other.getDocumentSplitter()) return false; + if (getDocumentAllowMultipleLabels() != other.getDocumentAllowMultipleLabels()) return false; + if (getPrefixedNamingOnProperties() != other.getPrefixedNamingOnProperties()) return false; + if (getSkipNamingValidation() != other.getSkipNamingValidation()) 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) + DOCUMENT_SPLITTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentSplitter()); + hash = (37 * hash) + DOCUMENT_ALLOW_MULTIPLE_LABELS_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentAllowMultipleLabels()); + hash = (37 * hash) + PREFIXED_NAMING_ON_PROPERTIES_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPrefixedNamingOnProperties()); + hash = (37 * hash) + SKIP_NAMING_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipNamingValidation()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata 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.documentai.v1.DocumentSchema.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata 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.documentai.v1.DocumentSchema.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata 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.documentai.v1.DocumentSchema.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata 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.documentai.v1.DocumentSchema.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata 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.documentai.v1.DocumentSchema.Metadata 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; + } + /** + * + * + *
+     * Metadata for global schema behavior.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema.Metadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DocumentSchema.Metadata) + com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.Metadata.class, + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DocumentSchema.Metadata.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(); + documentSplitter_ = false; + + documentAllowMultipleLabels_ = false; + + prefixedNamingOnProperties_ = false; + + skipNamingValidation_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.Metadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DocumentSchema.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.Metadata build() { + com.google.cloud.documentai.v1.DocumentSchema.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.Metadata buildPartial() { + com.google.cloud.documentai.v1.DocumentSchema.Metadata result = + new com.google.cloud.documentai.v1.DocumentSchema.Metadata(this); + result.documentSplitter_ = documentSplitter_; + result.documentAllowMultipleLabels_ = documentAllowMultipleLabels_; + result.prefixedNamingOnProperties_ = prefixedNamingOnProperties_; + result.skipNamingValidation_ = skipNamingValidation_; + 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.documentai.v1.DocumentSchema.Metadata) { + return mergeFrom((com.google.cloud.documentai.v1.DocumentSchema.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DocumentSchema.Metadata other) { + if (other == com.google.cloud.documentai.v1.DocumentSchema.Metadata.getDefaultInstance()) + return this; + if (other.getDocumentSplitter() != false) { + setDocumentSplitter(other.getDocumentSplitter()); + } + if (other.getDocumentAllowMultipleLabels() != false) { + setDocumentAllowMultipleLabels(other.getDocumentAllowMultipleLabels()); + } + if (other.getPrefixedNamingOnProperties() != false) { + setPrefixedNamingOnProperties(other.getPrefixedNamingOnProperties()); + } + if (other.getSkipNamingValidation() != false) { + setSkipNamingValidation(other.getSkipNamingValidation()); + } + 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.documentai.v1.DocumentSchema.Metadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.DocumentSchema.Metadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean documentSplitter_; + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + @java.lang.Override + public boolean getDocumentSplitter() { + return documentSplitter_; + } + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @param value The documentSplitter to set. + * @return This builder for chaining. + */ + public Builder setDocumentSplitter(boolean value) { + + documentSplitter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @return This builder for chaining. + */ + public Builder clearDocumentSplitter() { + + documentSplitter_ = false; + onChanged(); + return this; + } + + private boolean documentAllowMultipleLabels_; + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + @java.lang.Override + public boolean getDocumentAllowMultipleLabels() { + return documentAllowMultipleLabels_; + } + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @param value The documentAllowMultipleLabels to set. + * @return This builder for chaining. + */ + public Builder setDocumentAllowMultipleLabels(boolean value) { + + documentAllowMultipleLabels_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return This builder for chaining. + */ + public Builder clearDocumentAllowMultipleLabels() { + + documentAllowMultipleLabels_ = false; + onChanged(); + return this; + } + + private boolean prefixedNamingOnProperties_; + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + @java.lang.Override + public boolean getPrefixedNamingOnProperties() { + return prefixedNamingOnProperties_; + } + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @param value The prefixedNamingOnProperties to set. + * @return This builder for chaining. + */ + public Builder setPrefixedNamingOnProperties(boolean value) { + + prefixedNamingOnProperties_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return This builder for chaining. + */ + public Builder clearPrefixedNamingOnProperties() { + + prefixedNamingOnProperties_ = false; + onChanged(); + return this; + } + + private boolean skipNamingValidation_; + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + @java.lang.Override + public boolean getSkipNamingValidation() { + return skipNamingValidation_; + } + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @param value The skipNamingValidation to set. + * @return This builder for chaining. + */ + public Builder setSkipNamingValidation(boolean value) { + + skipNamingValidation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @return This builder for chaining. + */ + public Builder clearSkipNamingValidation() { + + skipNamingValidation_ = false; + 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.documentai.v1.DocumentSchema.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DocumentSchema.Metadata) + private static final com.google.cloud.documentai.v1.DocumentSchema.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DocumentSchema.Metadata(); + } + + public static com.google.cloud.documentai.v1.DocumentSchema.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Metadata(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.documentai.v1.DocumentSchema.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_TYPES_FIELD_NUMBER = 3; + private java.util.List entityTypes_; + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + @java.lang.Override + public java.util.List + getEntityTypesList() { + return entityTypes_; + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + @java.lang.Override + public java.util.List + getEntityTypesOrBuilderList() { + return entityTypes_; + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + @java.lang.Override + public int getEntityTypesCount() { + return entityTypes_.size(); + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityType getEntityTypes(int index) { + return entityTypes_.get(index); + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder getEntityTypesOrBuilder( + int index) { + return entityTypes_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private com.google.cloud.documentai.v1.DocumentSchema.Metadata metadata_; + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.Metadata getMetadata() { + return metadata_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + for (int i = 0; i < entityTypes_.size(); i++) { + output.writeMessage(3, entityTypes_.get(i)); + } + if (metadata_ != null) { + output.writeMessage(4, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + for (int i = 0; i < entityTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, entityTypes_.get(i)); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMetadata()); + } + 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.documentai.v1.DocumentSchema)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DocumentSchema other = + (com.google.cloud.documentai.v1.DocumentSchema) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getEntityTypesList().equals(other.getEntityTypesList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getEntityTypesCount() > 0) { + hash = (37 * hash) + ENTITY_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getEntityTypesList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DocumentSchema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema 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.documentai.v1.DocumentSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema 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.documentai.v1.DocumentSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DocumentSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DocumentSchema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema 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.documentai.v1.DocumentSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema 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.documentai.v1.DocumentSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DocumentSchema 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.documentai.v1.DocumentSchema 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 schema defines the output of the processed document by a processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DocumentSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DocumentSchema) + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DocumentSchema.class, + com.google.cloud.documentai.v1.DocumentSchema.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DocumentSchema.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEntityTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + description_ = ""; + + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entityTypesBuilder_.clear(); + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1_DocumentSchema_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema build() { + com.google.cloud.documentai.v1.DocumentSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema buildPartial() { + com.google.cloud.documentai.v1.DocumentSchema result = + new com.google.cloud.documentai.v1.DocumentSchema(this); + int from_bitField0_ = bitField0_; + result.displayName_ = displayName_; + result.description_ = description_; + if (entityTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entityTypes_ = entityTypes_; + } else { + result.entityTypes_ = entityTypesBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DocumentSchema) { + return mergeFrom((com.google.cloud.documentai.v1.DocumentSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DocumentSchema other) { + if (other == com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (entityTypesBuilder_ == null) { + if (!other.entityTypes_.isEmpty()) { + if (entityTypes_.isEmpty()) { + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntityTypesIsMutable(); + entityTypes_.addAll(other.entityTypes_); + } + onChanged(); + } + } else { + if (!other.entityTypes_.isEmpty()) { + if (entityTypesBuilder_.isEmpty()) { + entityTypesBuilder_.dispose(); + entityTypesBuilder_ = null; + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + entityTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntityTypesFieldBuilder() + : null; + } else { + entityTypesBuilder_.addAllMessages(other.entityTypes_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.DocumentSchema parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1.DocumentSchema) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List entityTypes_ = + java.util.Collections.emptyList(); + + private void ensureEntityTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = + new java.util.ArrayList( + entityTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder> + entityTypesBuilder_; + + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public java.util.List + getEntityTypesList() { + if (entityTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entityTypes_); + } else { + return entityTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public int getEntityTypesCount() { + if (entityTypesBuilder_ == null) { + return entityTypes_.size(); + } else { + return entityTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType getEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder setEntityTypes( + int index, com.google.cloud.documentai.v1.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.set(index, value); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder setEntityTypes( + int index, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder addEntityTypes(com.google.cloud.documentai.v1.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder addEntityTypes( + int index, com.google.cloud.documentai.v1.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(index, value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder addEntityTypes( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder addEntityTypes( + int index, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder addAllEntityTypes( + java.lang.Iterable + values) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entityTypes_); + onChanged(); + } else { + entityTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder clearEntityTypes() { + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entityTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public Builder removeEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.remove(index); + onChanged(); + } else { + entityTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder getEntityTypesBuilder( + int index) { + return getEntityTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder + getEntityTypesOrBuilder(int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder> + getEntityTypesOrBuilderList() { + if (entityTypesBuilder_ != null) { + return entityTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entityTypes_); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder + addEntityTypesBuilder() { + return getEntityTypesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.DocumentSchema.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder addEntityTypesBuilder( + int index) { + return getEntityTypesFieldBuilder() + .addBuilder( + index, com.google.cloud.documentai.v1.DocumentSchema.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + public java.util.List + getEntityTypesBuilderList() { + return getEntityTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder> + getEntityTypesFieldBuilder() { + if (entityTypesBuilder_ == null) { + entityTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.EntityType, + com.google.cloud.documentai.v1.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder>( + entityTypes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entityTypes_ = null; + } + return entityTypesBuilder_; + } + + private com.google.cloud.documentai.v1.DocumentSchema.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.Metadata, + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + public com.google.cloud.documentai.v1.DocumentSchema.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public Builder setMetadata(com.google.cloud.documentai.v1.DocumentSchema.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public Builder setMetadata( + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public Builder mergeMetadata(com.google.cloud.documentai.v1.DocumentSchema.Metadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.documentai.v1.DocumentSchema.Metadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + public com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.Metadata, + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema.Metadata, + com.google.cloud.documentai.v1.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DocumentSchema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DocumentSchema) + private static final com.google.cloud.documentai.v1.DocumentSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DocumentSchema(); + } + + public static com.google.cloud.documentai.v1.DocumentSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentSchema(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.documentai.v1.DocumentSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchemaOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchemaOrBuilder.java new file mode 100644 index 00000000000..f0c0a2493a9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchemaOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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/documentai/v1/document_schema.proto + +package com.google.cloud.documentai.v1; + +public interface DocumentSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DocumentSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + java.util.List getEntityTypesList(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityType getEntityTypes(int index); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + int getEntityTypesCount(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + java.util.List + getEntityTypesOrBuilderList(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + com.google.cloud.documentai.v1.DocumentSchema.EntityTypeOrBuilder getEntityTypesOrBuilder( + int index); + + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + com.google.cloud.documentai.v1.DocumentSchema.Metadata getMetadata(); + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + com.google.cloud.documentai.v1.DocumentSchema.MetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadata.java new file mode 100644 index 00000000000..a861bfd579c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadata.java @@ -0,0 +1,742 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for enable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorMetadata} + */ +public final class EnableProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EnableProcessorMetadata) + EnableProcessorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnableProcessorMetadata.newBuilder() to construct. + private EnableProcessorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnableProcessorMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnableProcessorMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnableProcessorMetadata( + 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 42: + { + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorMetadata.class, + com.google.cloud.documentai.v1.EnableProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(5, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCommonMetadata()); + } + 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.documentai.v1.EnableProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EnableProcessorMetadata other = + (com.google.cloud.documentai.v1.EnableProcessorMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata 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.documentai.v1.EnableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata 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.documentai.v1.EnableProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata 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.documentai.v1.EnableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata 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.documentai.v1.EnableProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata 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.documentai.v1.EnableProcessorMetadata 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 long running operation metadata for enable processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EnableProcessorMetadata) + com.google.cloud.documentai.v1.EnableProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorMetadata.class, + com.google.cloud.documentai.v1.EnableProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EnableProcessorMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EnableProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorMetadata build() { + com.google.cloud.documentai.v1.EnableProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1.EnableProcessorMetadata result = + new com.google.cloud.documentai.v1.EnableProcessorMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.EnableProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.EnableProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.EnableProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1.EnableProcessorMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.EnableProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.EnableProcessorMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.EnableProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EnableProcessorMetadata) + private static final com.google.cloud.documentai.v1.EnableProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EnableProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1.EnableProcessorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnableProcessorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnableProcessorMetadata(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.documentai.v1.EnableProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadataOrBuilder.java new file mode 100644 index 00000000000..2033c63fe71 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EnableProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EnableProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequest.java new file mode 100644 index 00000000000..109e3a90aca --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequest.java @@ -0,0 +1,653 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the enable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorRequest} + */ +public final class EnableProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EnableProcessorRequest) + EnableProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnableProcessorRequest.newBuilder() to construct. + private EnableProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnableProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnableProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnableProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorRequest.class, + com.google.cloud.documentai.v1.EnableProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name to be enabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name to be enabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.EnableProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EnableProcessorRequest other = + (com.google.cloud.documentai.v1.EnableProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest 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.documentai.v1.EnableProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest 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.documentai.v1.EnableProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest 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.documentai.v1.EnableProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest 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.documentai.v1.EnableProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest 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.documentai.v1.EnableProcessorRequest 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; + } + /** + * + * + *
+   * Request message for the enable processor method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EnableProcessorRequest) + com.google.cloud.documentai.v1.EnableProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorRequest.class, + com.google.cloud.documentai.v1.EnableProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EnableProcessorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EnableProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorRequest build() { + com.google.cloud.documentai.v1.EnableProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.EnableProcessorRequest result = + new com.google.cloud.documentai.v1.EnableProcessorRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.EnableProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.EnableProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.EnableProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.EnableProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.EnableProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.EnableProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name to be enabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be enabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name to be enabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be enabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name to be enabled.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.EnableProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EnableProcessorRequest) + private static final com.google.cloud.documentai.v1.EnableProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EnableProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.EnableProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnableProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnableProcessorRequest(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.documentai.v1.EnableProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..4203db2277b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EnableProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EnableProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name to be enabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name to be enabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponse.java new file mode 100644 index 00000000000..95950434f9c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponse.java @@ -0,0 +1,461 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the enable processor method.
+ * Intentionally empty proto for adding fields in future.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorResponse} + */ +public final class EnableProcessorResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EnableProcessorResponse) + EnableProcessorResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnableProcessorResponse.newBuilder() to construct. + private EnableProcessorResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnableProcessorResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnableProcessorResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnableProcessorResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorResponse.class, + com.google.cloud.documentai.v1.EnableProcessorResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1.EnableProcessorResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EnableProcessorResponse other = + (com.google.cloud.documentai.v1.EnableProcessorResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse 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.documentai.v1.EnableProcessorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse 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.documentai.v1.EnableProcessorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse 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.documentai.v1.EnableProcessorResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse 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.documentai.v1.EnableProcessorResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse 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.documentai.v1.EnableProcessorResponse 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; + } + /** + * + * + *
+   * Response message for the enable processor method.
+   * Intentionally empty proto for adding fields in future.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EnableProcessorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EnableProcessorResponse) + com.google.cloud.documentai.v1.EnableProcessorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EnableProcessorResponse.class, + com.google.cloud.documentai.v1.EnableProcessorResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EnableProcessorResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EnableProcessorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorResponse build() { + com.google.cloud.documentai.v1.EnableProcessorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EnableProcessorResponse buildPartial() { + com.google.cloud.documentai.v1.EnableProcessorResponse result = + new com.google.cloud.documentai.v1.EnableProcessorResponse(this); + 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.documentai.v1.EnableProcessorResponse) { + return mergeFrom((com.google.cloud.documentai.v1.EnableProcessorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.EnableProcessorResponse other) { + if (other == com.google.cloud.documentai.v1.EnableProcessorResponse.getDefaultInstance()) + return this; + 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.documentai.v1.EnableProcessorResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.EnableProcessorResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1.EnableProcessorResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EnableProcessorResponse) + private static final com.google.cloud.documentai.v1.EnableProcessorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EnableProcessorResponse(); + } + + public static com.google.cloud.documentai.v1.EnableProcessorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnableProcessorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnableProcessorResponse(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.documentai.v1.EnableProcessorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponseOrBuilder.java new file mode 100644 index 00000000000..2573fec3808 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EnableProcessorResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EnableProcessorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EnableProcessorResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequest.java new file mode 100644 index 00000000000..e080a3b3e79 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequest.java @@ -0,0 +1,667 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for fetch processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.FetchProcessorTypesRequest} + */ +public final class FetchProcessorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.FetchProcessorTypesRequest) + FetchProcessorTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchProcessorTypesRequest.newBuilder() to construct. + private FetchProcessorTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchProcessorTypesRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchProcessorTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FetchProcessorTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest.class, + com.google.cloud.documentai.v1.FetchProcessorTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + 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.documentai.v1.FetchProcessorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.FetchProcessorTypesRequest other = + (com.google.cloud.documentai.v1.FetchProcessorTypesRequest) obj; + + if (!getParent().equals(other.getParent())) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest 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.documentai.v1.FetchProcessorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest 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.documentai.v1.FetchProcessorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest 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.documentai.v1.FetchProcessorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest 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.documentai.v1.FetchProcessorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest 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.documentai.v1.FetchProcessorTypesRequest 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; + } + /** + * + * + *
+   * Request message for fetch processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.FetchProcessorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.FetchProcessorTypesRequest) + com.google.cloud.documentai.v1.FetchProcessorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest.class, + com.google.cloud.documentai.v1.FetchProcessorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.FetchProcessorTypesRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.FetchProcessorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesRequest build() { + com.google.cloud.documentai.v1.FetchProcessorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesRequest buildPartial() { + com.google.cloud.documentai.v1.FetchProcessorTypesRequest result = + new com.google.cloud.documentai.v1.FetchProcessorTypesRequest(this); + result.parent_ = parent_; + 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.documentai.v1.FetchProcessorTypesRequest) { + return mergeFrom((com.google.cloud.documentai.v1.FetchProcessorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.FetchProcessorTypesRequest other) { + if (other == com.google.cloud.documentai.v1.FetchProcessorTypesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.documentai.v1.FetchProcessorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.FetchProcessorTypesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @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.documentai.v1.FetchProcessorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.FetchProcessorTypesRequest) + private static final com.google.cloud.documentai.v1.FetchProcessorTypesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.FetchProcessorTypesRequest(); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchProcessorTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FetchProcessorTypesRequest(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.documentai.v1.FetchProcessorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequestOrBuilder.java new file mode 100644 index 00000000000..4804da76711 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface FetchProcessorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.FetchProcessorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponse.java new file mode 100644 index 00000000000..2889b01781d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponse.java @@ -0,0 +1,964 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for fetch processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.FetchProcessorTypesResponse} + */ +public final class FetchProcessorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.FetchProcessorTypesResponse) + FetchProcessorTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchProcessorTypesResponse.newBuilder() to construct. + private FetchProcessorTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchProcessorTypesResponse() { + processorTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchProcessorTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FetchProcessorTypesResponse( + 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)) { + processorTypes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processorTypes_.add( + input.readMessage( + com.google.cloud.documentai.v1.ProcessorType.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.FetchProcessorTypesResponse.class, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse.Builder.class); + } + + public static final int PROCESSOR_TYPES_FIELD_NUMBER = 1; + private java.util.List processorTypes_; + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List getProcessorTypesList() { + return processorTypes_; + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List + getProcessorTypesOrBuilderList() { + return processorTypes_; + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public int getProcessorTypesCount() { + return processorTypes_.size(); + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index) { + return processorTypes_.get(index); + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + return processorTypes_.get(index); + } + + 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 < processorTypes_.size(); i++) { + output.writeMessage(1, processorTypes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processorTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, processorTypes_.get(i)); + } + 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.documentai.v1.FetchProcessorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.FetchProcessorTypesResponse other = + (com.google.cloud.documentai.v1.FetchProcessorTypesResponse) obj; + + if (!getProcessorTypesList().equals(other.getProcessorTypesList())) 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 (getProcessorTypesCount() > 0) { + hash = (37 * hash) + PROCESSOR_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getProcessorTypesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse 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.documentai.v1.FetchProcessorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse 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.documentai.v1.FetchProcessorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse 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.documentai.v1.FetchProcessorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse 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.documentai.v1.FetchProcessorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse 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.documentai.v1.FetchProcessorTypesResponse 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; + } + /** + * + * + *
+   * Response message for fetch processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.FetchProcessorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.FetchProcessorTypesResponse) + com.google.cloud.documentai.v1.FetchProcessorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.FetchProcessorTypesResponse.class, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.FetchProcessorTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorTypesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.FetchProcessorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesResponse build() { + com.google.cloud.documentai.v1.FetchProcessorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.FetchProcessorTypesResponse buildPartial() { + com.google.cloud.documentai.v1.FetchProcessorTypesResponse result = + new com.google.cloud.documentai.v1.FetchProcessorTypesResponse(this); + int from_bitField0_ = bitField0_; + if (processorTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processorTypes_ = processorTypes_; + } else { + result.processorTypes_ = processorTypesBuilder_.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.documentai.v1.FetchProcessorTypesResponse) { + return mergeFrom((com.google.cloud.documentai.v1.FetchProcessorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.FetchProcessorTypesResponse other) { + if (other == com.google.cloud.documentai.v1.FetchProcessorTypesResponse.getDefaultInstance()) + return this; + if (processorTypesBuilder_ == null) { + if (!other.processorTypes_.isEmpty()) { + if (processorTypes_.isEmpty()) { + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorTypesIsMutable(); + processorTypes_.addAll(other.processorTypes_); + } + onChanged(); + } + } else { + if (!other.processorTypes_.isEmpty()) { + if (processorTypesBuilder_.isEmpty()) { + processorTypesBuilder_.dispose(); + processorTypesBuilder_ = null; + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + processorTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorTypesFieldBuilder() + : null; + } else { + processorTypesBuilder_.addAllMessages(other.processorTypes_); + } + } + } + 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.documentai.v1.FetchProcessorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.FetchProcessorTypesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List processorTypes_ = + java.util.Collections.emptyList(); + + private void ensureProcessorTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = + new java.util.ArrayList(processorTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder> + processorTypesBuilder_; + + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List getProcessorTypesList() { + if (processorTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(processorTypes_); + } else { + return processorTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public int getProcessorTypesCount() { + if (processorTypesBuilder_ == null) { + return processorTypes_.size(); + } else { + return processorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, value); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes(com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addAllProcessorTypes( + java.lang.Iterable values) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processorTypes_); + onChanged(); + } else { + processorTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder clearProcessorTypes() { + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder removeProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.remove(index); + onChanged(); + } else { + processorTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder getProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesOrBuilderList() { + if (processorTypesBuilder_ != null) { + return processorTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processorTypes_); + } + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder addProcessorTypesBuilder() { + return getProcessorTypesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder addProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesBuilderList() { + return getProcessorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder> + getProcessorTypesFieldBuilder() { + if (processorTypesBuilder_ == null) { + processorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder>( + processorTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + processorTypes_ = null; + } + return processorTypesBuilder_; + } + + @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.documentai.v1.FetchProcessorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.FetchProcessorTypesResponse) + private static final com.google.cloud.documentai.v1.FetchProcessorTypesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.FetchProcessorTypesResponse(); + } + + public static com.google.cloud.documentai.v1.FetchProcessorTypesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchProcessorTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FetchProcessorTypesResponse(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.documentai.v1.FetchProcessorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponseOrBuilder.java new file mode 100644 index 00000000000..ab56b45c298 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/FetchProcessorTypesResponseOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface FetchProcessorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.FetchProcessorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + java.util.List getProcessorTypesList(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + int getProcessorTypesCount(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + java.util.List + getProcessorTypesOrBuilderList(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder(int index); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequest.java new file mode 100644 index 00000000000..bc1f5c089ea --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequest.java @@ -0,0 +1,652 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for get processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetProcessorRequest} + */ +public final class GetProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.GetProcessorRequest) + GetProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProcessorRequest.newBuilder() to construct. + private GetProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetProcessorRequest.class, + com.google.cloud.documentai.v1.GetProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.GetProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.GetProcessorRequest other = + (com.google.cloud.documentai.v1.GetProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest 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.documentai.v1.GetProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest 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.documentai.v1.GetProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest 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.documentai.v1.GetProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest 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.documentai.v1.GetProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest 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.documentai.v1.GetProcessorRequest 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; + } + /** + * + * + *
+   * Request message for get processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.GetProcessorRequest) + com.google.cloud.documentai.v1.GetProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetProcessorRequest.class, + com.google.cloud.documentai.v1.GetProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.GetProcessorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.GetProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorRequest build() { + com.google.cloud.documentai.v1.GetProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.GetProcessorRequest result = + new com.google.cloud.documentai.v1.GetProcessorRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.GetProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.GetProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.GetProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.GetProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.GetProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.GetProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.GetProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.GetProcessorRequest) + private static final com.google.cloud.documentai.v1.GetProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.GetProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.GetProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProcessorRequest(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.documentai.v1.GetProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..dea8bd9dcaa --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface GetProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.GetProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequest.java new file mode 100644 index 00000000000..32953e6341b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequest.java @@ -0,0 +1,653 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for get processor version.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetProcessorVersionRequest} + */ +public final class GetProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.GetProcessorVersionRequest) + GetProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProcessorVersionRequest.newBuilder() to construct. + private GetProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetProcessorVersionRequest.class, + com.google.cloud.documentai.v1.GetProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.GetProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.GetProcessorVersionRequest other = + (com.google.cloud.documentai.v1.GetProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest 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.documentai.v1.GetProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest 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.documentai.v1.GetProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest 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.documentai.v1.GetProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest 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.documentai.v1.GetProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest 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.documentai.v1.GetProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for get processor version.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.GetProcessorVersionRequest) + com.google.cloud.documentai.v1.GetProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetProcessorVersionRequest.class, + com.google.cloud.documentai.v1.GetProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.GetProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorVersionRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.GetProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorVersionRequest build() { + com.google.cloud.documentai.v1.GetProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.GetProcessorVersionRequest result = + new com.google.cloud.documentai.v1.GetProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.GetProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.GetProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.GetProcessorVersionRequest other) { + if (other == com.google.cloud.documentai.v1.GetProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.GetProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.GetProcessorVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.GetProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.GetProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.GetProcessorVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.GetProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.GetProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProcessorVersionRequest(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.documentai.v1.GetProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..75e045b8bd3 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface GetProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.GetProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequest.java new file mode 100644 index 00000000000..adcab879ff4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequest.java @@ -0,0 +1,944 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for list processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorTypesRequest} + */ +public final class ListProcessorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorTypesRequest) + ListProcessorTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorTypesRequest.newBuilder() to construct. + private ListProcessorTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorTypesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorTypesRequest.class, + com.google.cloud.documentai.v1.ListProcessorTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of processor types to return.
+   * If unspecified, at most 100 processor types will be returned.
+   * The maximum value is 500; values above 500 will be coerced to 500.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorTypesRequest other = + (com.google.cloud.documentai.v1.ListProcessorTypesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest 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.documentai.v1.ListProcessorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest 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.documentai.v1.ListProcessorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest 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.documentai.v1.ListProcessorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest 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.documentai.v1.ListProcessorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest 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.documentai.v1.ListProcessorTypesRequest 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; + } + /** + * + * + *
+   * Request message for list processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorTypesRequest) + com.google.cloud.documentai.v1.ListProcessorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorTypesRequest.class, + com.google.cloud.documentai.v1.ListProcessorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorTypesRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesRequest build() { + com.google.cloud.documentai.v1.ListProcessorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesRequest buildPartial() { + com.google.cloud.documentai.v1.ListProcessorTypesRequest result = + new com.google.cloud.documentai.v1.ListProcessorTypesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorTypesRequest) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorTypesRequest other) { + if (other == com.google.cloud.documentai.v1.ListProcessorTypesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorTypesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorTypesRequest) + private static final com.google.cloud.documentai.v1.ListProcessorTypesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorTypesRequest(); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorTypesRequest(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.documentai.v1.ListProcessorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequestOrBuilder.java new file mode 100644 index 00000000000..b704458e60f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of processor types to return.
+   * If unspecified, at most 100 processor types will be returned.
+   * The maximum value is 500; values above 500 will be coerced to 500.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponse.java new file mode 100644 index 00000000000..e93531046bc --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponse.java @@ -0,0 +1,1143 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for list processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorTypesResponse} + */ +public final class ListProcessorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorTypesResponse) + ListProcessorTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorTypesResponse.newBuilder() to construct. + private ListProcessorTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorTypesResponse() { + processorTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorTypesResponse( + 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)) { + processorTypes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processorTypes_.add( + input.readMessage( + com.google.cloud.documentai.v1.ProcessorType.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorTypesResponse.class, + com.google.cloud.documentai.v1.ListProcessorTypesResponse.Builder.class); + } + + public static final int PROCESSOR_TYPES_FIELD_NUMBER = 1; + private java.util.List processorTypes_; + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List getProcessorTypesList() { + return processorTypes_; + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List + getProcessorTypesOrBuilderList() { + return processorTypes_; + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public int getProcessorTypesCount() { + return processorTypes_.size(); + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index) { + return processorTypes_.get(index); + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + return processorTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < processorTypes_.size(); i++) { + output.writeMessage(1, processorTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processorTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, processorTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorTypesResponse other = + (com.google.cloud.documentai.v1.ListProcessorTypesResponse) obj; + + if (!getProcessorTypesList().equals(other.getProcessorTypesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProcessorTypesCount() > 0) { + hash = (37 * hash) + PROCESSOR_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getProcessorTypesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse 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.documentai.v1.ListProcessorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse 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.documentai.v1.ListProcessorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse 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.documentai.v1.ListProcessorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse 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.documentai.v1.ListProcessorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse 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.documentai.v1.ListProcessorTypesResponse 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; + } + /** + * + * + *
+   * Response message for list processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorTypesResponse) + com.google.cloud.documentai.v1.ListProcessorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorTypesResponse.class, + com.google.cloud.documentai.v1.ListProcessorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesResponse build() { + com.google.cloud.documentai.v1.ListProcessorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorTypesResponse buildPartial() { + com.google.cloud.documentai.v1.ListProcessorTypesResponse result = + new com.google.cloud.documentai.v1.ListProcessorTypesResponse(this); + int from_bitField0_ = bitField0_; + if (processorTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processorTypes_ = processorTypes_; + } else { + result.processorTypes_ = processorTypesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorTypesResponse) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorTypesResponse other) { + if (other == com.google.cloud.documentai.v1.ListProcessorTypesResponse.getDefaultInstance()) + return this; + if (processorTypesBuilder_ == null) { + if (!other.processorTypes_.isEmpty()) { + if (processorTypes_.isEmpty()) { + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorTypesIsMutable(); + processorTypes_.addAll(other.processorTypes_); + } + onChanged(); + } + } else { + if (!other.processorTypes_.isEmpty()) { + if (processorTypesBuilder_.isEmpty()) { + processorTypesBuilder_.dispose(); + processorTypesBuilder_ = null; + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + processorTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorTypesFieldBuilder() + : null; + } else { + processorTypesBuilder_.addAllMessages(other.processorTypes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorTypesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List processorTypes_ = + java.util.Collections.emptyList(); + + private void ensureProcessorTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = + new java.util.ArrayList(processorTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder> + processorTypesBuilder_; + + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List getProcessorTypesList() { + if (processorTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(processorTypes_); + } else { + return processorTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public int getProcessorTypesCount() { + if (processorTypesBuilder_ == null) { + return processorTypes_.size(); + } else { + return processorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, value); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes(com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder addAllProcessorTypes( + java.lang.Iterable values) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processorTypes_); + onChanged(); + } else { + processorTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder clearProcessorTypes() { + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public Builder removeProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.remove(index); + onChanged(); + } else { + processorTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder getProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesOrBuilderList() { + if (processorTypesBuilder_ != null) { + return processorTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processorTypes_); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder addProcessorTypesBuilder() { + return getProcessorTypesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1.ProcessorType.Builder addProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesBuilderList() { + return getProcessorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder> + getProcessorTypesFieldBuilder() { + if (processorTypesBuilder_ == null) { + processorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType, + com.google.cloud.documentai.v1.ProcessorType.Builder, + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder>( + processorTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + processorTypes_ = null; + } + return processorTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorTypesResponse) + private static final com.google.cloud.documentai.v1.ListProcessorTypesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorTypesResponse(); + } + + public static com.google.cloud.documentai.v1.ListProcessorTypesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorTypesResponse(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.documentai.v1.ListProcessorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponseOrBuilder.java new file mode 100644 index 00000000000..723f04e7854 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorTypesResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + java.util.List getProcessorTypesList(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1.ProcessorType getProcessorTypes(int index); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + int getProcessorTypesCount(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + java.util.List + getProcessorTypesOrBuilderList(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder getProcessorTypesOrBuilder(int index); + + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequest.java new file mode 100644 index 00000000000..1d25edffecd --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequest.java @@ -0,0 +1,944 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for list all processor versions belongs to a processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorVersionsRequest} + */ +public final class ListProcessorVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorVersionsRequest) + ListProcessorVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorVersionsRequest.newBuilder() to construct. + private ListProcessorVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorVersionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest.class, + com.google.cloud.documentai.v1.ListProcessorVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of processor versions to return.
+   * If unspecified, at most 10 processor versions will be returned.
+   * The maximum value is 20; values above 20 will be coerced to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorVersionsRequest other = + (com.google.cloud.documentai.v1.ListProcessorVersionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest 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.documentai.v1.ListProcessorVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest 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.documentai.v1.ListProcessorVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest 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.documentai.v1.ListProcessorVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest 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.documentai.v1.ListProcessorVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest 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.documentai.v1.ListProcessorVersionsRequest 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; + } + /** + * + * + *
+   * Request message for list all processor versions belongs to a processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorVersionsRequest) + com.google.cloud.documentai.v1.ListProcessorVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest.class, + com.google.cloud.documentai.v1.ListProcessorVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorVersionsRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsRequest build() { + com.google.cloud.documentai.v1.ListProcessorVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsRequest buildPartial() { + com.google.cloud.documentai.v1.ListProcessorVersionsRequest result = + new com.google.cloud.documentai.v1.ListProcessorVersionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorVersionsRequest) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorVersionsRequest other) { + if (other == com.google.cloud.documentai.v1.ListProcessorVersionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorVersionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorVersionsRequest) + private static final com.google.cloud.documentai.v1.ListProcessorVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorVersionsRequest(); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorVersionsRequest(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.documentai.v1.ListProcessorVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequestOrBuilder.java new file mode 100644 index 00000000000..ee054ed7d27 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of processor versions to return.
+   * If unspecified, at most 10 processor versions will be returned.
+   * The maximum value is 20; values above 20 will be coerced to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponse.java new file mode 100644 index 00000000000..a0057bfdea3 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponse.java @@ -0,0 +1,1150 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for list processors.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorVersionsResponse} + */ +public final class ListProcessorVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorVersionsResponse) + ListProcessorVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorVersionsResponse.newBuilder() to construct. + private ListProcessorVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorVersionsResponse() { + processorVersions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorVersionsResponse( + 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)) { + processorVersions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processorVersions_.add( + input.readMessage( + com.google.cloud.documentai.v1.ProcessorVersion.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processorVersions_ = java.util.Collections.unmodifiableList(processorVersions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorVersionsResponse.class, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse.Builder.class); + } + + public static final int PROCESSOR_VERSIONS_FIELD_NUMBER = 1; + private java.util.List processorVersions_; + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public java.util.List + getProcessorVersionsList() { + return processorVersions_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public java.util.List + getProcessorVersionsOrBuilderList() { + return processorVersions_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public int getProcessorVersionsCount() { + return processorVersions_.size(); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersions(int index) { + return processorVersions_.get(index); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionsOrBuilder( + int index) { + return processorVersions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < processorVersions_.size(); i++) { + output.writeMessage(1, processorVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processorVersions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, processorVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorVersionsResponse other = + (com.google.cloud.documentai.v1.ListProcessorVersionsResponse) obj; + + if (!getProcessorVersionsList().equals(other.getProcessorVersionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProcessorVersionsCount() > 0) { + hash = (37 * hash) + PROCESSOR_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getProcessorVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse 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.documentai.v1.ListProcessorVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse 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.documentai.v1.ListProcessorVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse 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.documentai.v1.ListProcessorVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse 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.documentai.v1.ListProcessorVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse 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.documentai.v1.ListProcessorVersionsResponse 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; + } + /** + * + * + *
+   * Response message for list processors.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorVersionsResponse) + com.google.cloud.documentai.v1.ListProcessorVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorVersionsResponse.class, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorVersionsBuilder_ == null) { + processorVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorVersionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsResponse build() { + com.google.cloud.documentai.v1.ListProcessorVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorVersionsResponse buildPartial() { + com.google.cloud.documentai.v1.ListProcessorVersionsResponse result = + new com.google.cloud.documentai.v1.ListProcessorVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (processorVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processorVersions_ = java.util.Collections.unmodifiableList(processorVersions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processorVersions_ = processorVersions_; + } else { + result.processorVersions_ = processorVersionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorVersionsResponse) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorVersionsResponse other) { + if (other + == com.google.cloud.documentai.v1.ListProcessorVersionsResponse.getDefaultInstance()) + return this; + if (processorVersionsBuilder_ == null) { + if (!other.processorVersions_.isEmpty()) { + if (processorVersions_.isEmpty()) { + processorVersions_ = other.processorVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorVersionsIsMutable(); + processorVersions_.addAll(other.processorVersions_); + } + onChanged(); + } + } else { + if (!other.processorVersions_.isEmpty()) { + if (processorVersionsBuilder_.isEmpty()) { + processorVersionsBuilder_.dispose(); + processorVersionsBuilder_ = null; + processorVersions_ = other.processorVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + processorVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorVersionsFieldBuilder() + : null; + } else { + processorVersionsBuilder_.addAllMessages(other.processorVersions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorVersionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List processorVersions_ = + java.util.Collections.emptyList(); + + private void ensureProcessorVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processorVersions_ = + new java.util.ArrayList( + processorVersions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder> + processorVersionsBuilder_; + + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public java.util.List + getProcessorVersionsList() { + if (processorVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(processorVersions_); + } else { + return processorVersionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public int getProcessorVersionsCount() { + if (processorVersionsBuilder_ == null) { + return processorVersions_.size(); + } else { + return processorVersionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersions(int index) { + if (processorVersionsBuilder_ == null) { + return processorVersions_.get(index); + } else { + return processorVersionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder setProcessorVersions( + int index, com.google.cloud.documentai.v1.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.set(index, value); + onChanged(); + } else { + processorVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder setProcessorVersions( + int index, com.google.cloud.documentai.v1.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder addProcessorVersions(com.google.cloud.documentai.v1.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.add(value); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder addProcessorVersions( + int index, com.google.cloud.documentai.v1.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.add(index, value); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder addProcessorVersions( + com.google.cloud.documentai.v1.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.add(builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder addProcessorVersions( + int index, com.google.cloud.documentai.v1.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder addAllProcessorVersions( + java.lang.Iterable values) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processorVersions_); + onChanged(); + } else { + processorVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder clearProcessorVersions() { + if (processorVersionsBuilder_ == null) { + processorVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorVersionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public Builder removeProcessorVersions(int index) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.remove(index); + onChanged(); + } else { + processorVersionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public com.google.cloud.documentai.v1.ProcessorVersion.Builder getProcessorVersionsBuilder( + int index) { + return getProcessorVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionsOrBuilder( + int index) { + if (processorVersionsBuilder_ == null) { + return processorVersions_.get(index); + } else { + return processorVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public java.util.List + getProcessorVersionsOrBuilderList() { + if (processorVersionsBuilder_ != null) { + return processorVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processorVersions_); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public com.google.cloud.documentai.v1.ProcessorVersion.Builder addProcessorVersionsBuilder() { + return getProcessorVersionsFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public com.google.cloud.documentai.v1.ProcessorVersion.Builder addProcessorVersionsBuilder( + int index) { + return getProcessorVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + public java.util.List + getProcessorVersionsBuilderList() { + return getProcessorVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder> + getProcessorVersionsFieldBuilder() { + if (processorVersionsBuilder_ == null) { + processorVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder>( + processorVersions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + processorVersions_ = null; + } + return processorVersionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorVersionsResponse) + private static final com.google.cloud.documentai.v1.ListProcessorVersionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorVersionsResponse(); + } + + public static com.google.cloud.documentai.v1.ListProcessorVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorVersionsResponse(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.documentai.v1.ListProcessorVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponseOrBuilder.java new file mode 100644 index 00000000000..ae7a9ca80eb --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorVersionsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + java.util.List getProcessorVersionsList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersions(int index); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + int getProcessorVersionsCount(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + java.util.List + getProcessorVersionsOrBuilderList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionsOrBuilder(int index); + + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequest.java new file mode 100644 index 00000000000..f8d9713d2ae --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequest.java @@ -0,0 +1,943 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for list all processors belongs to a project.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorsRequest} + */ +public final class ListProcessorsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorsRequest) + ListProcessorsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorsRequest.newBuilder() to construct. + private ListProcessorsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorsRequest.class, + com.google.cloud.documentai.v1.ListProcessorsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent (project and location) which owns this collection of Processors.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project and location) which owns this collection of Processors.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of processors to return.
+   * If unspecified, at most 50 processors will be returned.
+   * The maximum value is 100; values above 100 will be coerced to 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * We will return the processors sorted by creation time. The page token
+   * will point to the next processor.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * We will return the processors sorted by creation time. The page token
+   * will point to the next processor.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorsRequest other = + (com.google.cloud.documentai.v1.ListProcessorsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest 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.documentai.v1.ListProcessorsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest 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.documentai.v1.ListProcessorsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest 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.documentai.v1.ListProcessorsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest 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.documentai.v1.ListProcessorsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest 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.documentai.v1.ListProcessorsRequest 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; + } + /** + * + * + *
+   * Request message for list all processors belongs to a project.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorsRequest) + com.google.cloud.documentai.v1.ListProcessorsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorsRequest.class, + com.google.cloud.documentai.v1.ListProcessorsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorsRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsRequest build() { + com.google.cloud.documentai.v1.ListProcessorsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsRequest buildPartial() { + com.google.cloud.documentai.v1.ListProcessorsRequest result = + new com.google.cloud.documentai.v1.ListProcessorsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorsRequest) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorsRequest other) { + if (other == com.google.cloud.documentai.v1.ListProcessorsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent (project and location) which owns this collection of Processors.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent (project and location) which owns this collection of Processors.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent (project and location) which owns this collection of Processors.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project and location) which owns this collection of Processors.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project and location) which owns this collection of Processors.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of processors to return.
+     * If unspecified, at most 50 processors will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of processors to return.
+     * If unspecified, at most 50 processors will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of processors to return.
+     * If unspecified, at most 50 processors will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * We will return the processors sorted by creation time. The page token
+     * will point to the next processor.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * We will return the processors sorted by creation time. The page token
+     * will point to the next processor.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * We will return the processors sorted by creation time. The page token
+     * will point to the next processor.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processors sorted by creation time. The page token
+     * will point to the next processor.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processors sorted by creation time. The page token
+     * will point to the next processor.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorsRequest) + private static final com.google.cloud.documentai.v1.ListProcessorsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorsRequest(); + } + + public static com.google.cloud.documentai.v1.ListProcessorsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorsRequest(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.documentai.v1.ListProcessorsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequestOrBuilder.java new file mode 100644 index 00000000000..0e9a96f4ac7 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project and location) which owns this collection of Processors.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project and location) which owns this collection of Processors.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of processors to return.
+   * If unspecified, at most 50 processors will be returned.
+   * The maximum value is 100; values above 100 will be coerced to 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * We will return the processors sorted by creation time. The page token
+   * will point to the next processor.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * We will return the processors sorted by creation time. The page token
+   * will point to the next processor.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponse.java new file mode 100644 index 00000000000..b4e87540de4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponse.java @@ -0,0 +1,1132 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for list processors.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorsResponse} + */ +public final class ListProcessorsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListProcessorsResponse) + ListProcessorsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorsResponse.newBuilder() to construct. + private ListProcessorsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorsResponse() { + processors_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorsResponse( + 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)) { + processors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processors_.add( + input.readMessage( + com.google.cloud.documentai.v1.Processor.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processors_ = java.util.Collections.unmodifiableList(processors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorsResponse.class, + com.google.cloud.documentai.v1.ListProcessorsResponse.Builder.class); + } + + public static final int PROCESSORS_FIELD_NUMBER = 1; + private java.util.List processors_; + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + @java.lang.Override + public java.util.List getProcessorsList() { + return processors_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + @java.lang.Override + public java.util.List + getProcessorsOrBuilderList() { + return processors_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + @java.lang.Override + public int getProcessorsCount() { + return processors_.size(); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Processor getProcessors(int index) { + return processors_.get(index); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorsOrBuilder(int index) { + return processors_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < processors_.size(); i++) { + output.writeMessage(1, processors_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, processors_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.ListProcessorsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListProcessorsResponse other = + (com.google.cloud.documentai.v1.ListProcessorsResponse) obj; + + if (!getProcessorsList().equals(other.getProcessorsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProcessorsCount() > 0) { + hash = (37 * hash) + PROCESSORS_FIELD_NUMBER; + hash = (53 * hash) + getProcessorsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse 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.documentai.v1.ListProcessorsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse 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.documentai.v1.ListProcessorsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse 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.documentai.v1.ListProcessorsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse 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.documentai.v1.ListProcessorsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse 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.documentai.v1.ListProcessorsResponse 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; + } + /** + * + * + *
+   * Response message for list processors.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListProcessorsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListProcessorsResponse) + com.google.cloud.documentai.v1.ListProcessorsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListProcessorsResponse.class, + com.google.cloud.documentai.v1.ListProcessorsResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListProcessorsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorsBuilder_ == null) { + processors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListProcessorsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsResponse build() { + com.google.cloud.documentai.v1.ListProcessorsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListProcessorsResponse buildPartial() { + com.google.cloud.documentai.v1.ListProcessorsResponse result = + new com.google.cloud.documentai.v1.ListProcessorsResponse(this); + int from_bitField0_ = bitField0_; + if (processorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processors_ = java.util.Collections.unmodifiableList(processors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processors_ = processors_; + } else { + result.processors_ = processorsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.ListProcessorsResponse) { + return mergeFrom((com.google.cloud.documentai.v1.ListProcessorsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListProcessorsResponse other) { + if (other == com.google.cloud.documentai.v1.ListProcessorsResponse.getDefaultInstance()) + return this; + if (processorsBuilder_ == null) { + if (!other.processors_.isEmpty()) { + if (processors_.isEmpty()) { + processors_ = other.processors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorsIsMutable(); + processors_.addAll(other.processors_); + } + onChanged(); + } + } else { + if (!other.processors_.isEmpty()) { + if (processorsBuilder_.isEmpty()) { + processorsBuilder_.dispose(); + processorsBuilder_ = null; + processors_ = other.processors_; + bitField0_ = (bitField0_ & ~0x00000001); + processorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorsFieldBuilder() + : null; + } else { + processorsBuilder_.addAllMessages(other.processors_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.ListProcessorsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ListProcessorsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List processors_ = + java.util.Collections.emptyList(); + + private void ensureProcessorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processors_ = + new java.util.ArrayList(processors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + processorsBuilder_; + + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public java.util.List getProcessorsList() { + if (processorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(processors_); + } else { + return processorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public int getProcessorsCount() { + if (processorsBuilder_ == null) { + return processors_.size(); + } else { + return processorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public com.google.cloud.documentai.v1.Processor getProcessors(int index) { + if (processorsBuilder_ == null) { + return processors_.get(index); + } else { + return processorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder setProcessors(int index, com.google.cloud.documentai.v1.Processor value) { + if (processorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorsIsMutable(); + processors_.set(index, value); + onChanged(); + } else { + processorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder setProcessors( + int index, com.google.cloud.documentai.v1.Processor.Builder builderForValue) { + if (processorsBuilder_ == null) { + ensureProcessorsIsMutable(); + processors_.set(index, builderForValue.build()); + onChanged(); + } else { + processorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder addProcessors(com.google.cloud.documentai.v1.Processor value) { + if (processorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorsIsMutable(); + processors_.add(value); + onChanged(); + } else { + processorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder addProcessors(int index, com.google.cloud.documentai.v1.Processor value) { + if (processorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorsIsMutable(); + processors_.add(index, value); + onChanged(); + } else { + processorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder addProcessors(com.google.cloud.documentai.v1.Processor.Builder builderForValue) { + if (processorsBuilder_ == null) { + ensureProcessorsIsMutable(); + processors_.add(builderForValue.build()); + onChanged(); + } else { + processorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder addProcessors( + int index, com.google.cloud.documentai.v1.Processor.Builder builderForValue) { + if (processorsBuilder_ == null) { + ensureProcessorsIsMutable(); + processors_.add(index, builderForValue.build()); + onChanged(); + } else { + processorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder addAllProcessors( + java.lang.Iterable values) { + if (processorsBuilder_ == null) { + ensureProcessorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processors_); + onChanged(); + } else { + processorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder clearProcessors() { + if (processorsBuilder_ == null) { + processors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public Builder removeProcessors(int index) { + if (processorsBuilder_ == null) { + ensureProcessorsIsMutable(); + processors_.remove(index); + onChanged(); + } else { + processorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public com.google.cloud.documentai.v1.Processor.Builder getProcessorsBuilder(int index) { + return getProcessorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorsOrBuilder(int index) { + if (processorsBuilder_ == null) { + return processors_.get(index); + } else { + return processorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public java.util.List + getProcessorsOrBuilderList() { + if (processorsBuilder_ != null) { + return processorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processors_); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public com.google.cloud.documentai.v1.Processor.Builder addProcessorsBuilder() { + return getProcessorsFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.Processor.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public com.google.cloud.documentai.v1.Processor.Builder addProcessorsBuilder(int index) { + return getProcessorsFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.Processor.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + public java.util.List + getProcessorsBuilderList() { + return getProcessorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + getProcessorsFieldBuilder() { + if (processorsBuilder_ == null) { + processorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder>( + processors_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + processors_ = null; + } + return processorsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.ListProcessorsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListProcessorsResponse) + private static final com.google.cloud.documentai.v1.ListProcessorsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListProcessorsResponse(); + } + + public static com.google.cloud.documentai.v1.ListProcessorsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorsResponse(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.documentai.v1.ListProcessorsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponseOrBuilder.java new file mode 100644 index 00000000000..8f0535aac33 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListProcessorsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListProcessorsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListProcessorsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + java.util.List getProcessorsList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + com.google.cloud.documentai.v1.Processor getProcessors(int index); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + int getProcessorsCount(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + java.util.List + getProcessorsOrBuilderList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorsOrBuilder(int index); + + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/LocationName.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/LocationName.java new file mode 100644 index 00000000000..12d6d797701 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/OperationMetadataProto.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/OperationMetadataProto.java index 0adcf579886..8b6c56dfc7d 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/OperationMetadataProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/OperationMetadataProto.java @@ -42,21 +42,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n3google/cloud/documentai/v1/operation_m" + "etadata.proto\022\032google.cloud.documentai.v" - + "1\032\037google/protobuf/timestamp.proto\"\303\002\n\027C" + + "1\032\037google/protobuf/timestamp.proto\"\325\002\n\027C" + "ommonOperationMetadata\022H\n\005state\030\001 \001(\01629." + "google.cloud.documentai.v1.CommonOperati" + "onMetadata.State\022\025\n\rstate_message\030\002 \001(\t\022" - + "/\n\013create_time\030\003 \001(\0132\032.google.protobuf.T" - + "imestamp\022/\n\013update_time\030\004 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"e\n\005State\022\025\n\021STATE_UNSP" - + "ECIFIED\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLING\020\002\022\r" - + "\n\tSUCCEEDED\020\003\022\n\n\006FAILED\020\004\022\r\n\tCANCELLED\020\005" - + "B\332\001\n\036com.google.cloud.documentai.v1B\026Ope" - + "rationMetadataProtoP\001ZDgoogle.golang.org" - + "/genproto/googleapis/cloud/documentai/v1" - + ";documentai\252\002\032Google.Cloud.DocumentAI.V1" - + "\312\002\032Google\\Cloud\\DocumentAI\\V1\352\002\035Google::" - + "Cloud::DocumentAI::V1b\006proto3" + + "\020\n\010resource\030\005 \001(\t\022/\n\013create_time\030\003 \001(\0132\032" + + ".google.protobuf.Timestamp\022/\n\013update_tim" + + "e\030\004 \001(\0132\032.google.protobuf.Timestamp\"e\n\005S" + + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001" + + "\022\016\n\nCANCELLING\020\002\022\r\n\tSUCCEEDED\020\003\022\n\n\006FAILE" + + "D\020\004\022\r\n\tCANCELLED\020\005B\332\001\n\036com.google.cloud." + + "documentai.v1B\026OperationMetadataProtoP\001Z" + + "Dgoogle.golang.org/genproto/googleapis/c" + + "loud/documentai/v1;documentai\252\002\032Google.C" + + "loud.DocumentAI.V1\312\002\032Google\\Cloud\\Docume" + + "ntAI\\V1\352\002\035Google::Cloud::DocumentAI::V1b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -70,7 +71,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_CommonOperationMetadata_descriptor, new java.lang.String[] { - "State", "StateMessage", "CreateTime", "UpdateTime", + "State", "StateMessage", "Resource", "CreateTime", "UpdateTime", }); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequest.java index f91552cc63b..96dc7f9d107 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequest.java @@ -112,6 +112,21 @@ private ProcessRequest( source_ = subBuilder.buildPartial(); } sourceCase_ = 5; + break; + } + case 50: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + break; } default: @@ -305,7 +320,12 @@ public com.google.cloud.documentai.v1.RawDocumentOrBuilder getRawDocumentOrBuild * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -330,7 +350,12 @@ public java.lang.String getName() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -371,6 +396,52 @@ public boolean getSkipHumanReview() { return skipHumanReview_; } + public static final int FIELD_MASK_FIELD_NUMBER = 6; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + @java.lang.Override + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -397,6 +468,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceCase_ == 5) { output.writeMessage(5, (com.google.cloud.documentai.v1.RawDocument) source_); } + if (fieldMask_ != null) { + output.writeMessage(6, getFieldMask()); + } unknownFields.writeTo(output); } @@ -422,6 +496,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 5, (com.google.cloud.documentai.v1.RawDocument) source_); } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFieldMask()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -440,6 +517,10 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getSkipHumanReview() != other.getSkipHumanReview()) return false; + if (hasFieldMask() != other.hasFieldMask()) return false; + if (hasFieldMask()) { + if (!getFieldMask().equals(other.getFieldMask())) return false; + } if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 4: @@ -466,6 +547,10 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + SKIP_HUMAN_REVIEW_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipHumanReview()); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } switch (sourceCase_) { case 4: hash = (37 * hash) + INLINE_DOCUMENT_FIELD_NUMBER; @@ -627,6 +712,12 @@ public Builder clear() { skipHumanReview_ = false; + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } sourceCase_ = 0; source_ = null; return this; @@ -672,6 +763,11 @@ public com.google.cloud.documentai.v1.ProcessRequest buildPartial() { } result.name_ = name_; result.skipHumanReview_ = skipHumanReview_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -729,6 +825,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.ProcessRequest other) { if (other.getSkipHumanReview() != false) { setSkipHumanReview(other.getSkipHumanReview()); } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } switch (other.getSourceCase()) { case INLINE_DOCUMENT: { @@ -1213,7 +1312,12 @@ public com.google.cloud.documentai.v1.RawDocumentOrBuilder getRawDocumentOrBuild * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1237,7 +1341,12 @@ public java.lang.String getName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1261,7 +1370,12 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1284,7 +1398,12 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1303,7 +1422,12 @@ public Builder clearName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1379,6 +1503,185 @@ public Builder clearSkipHumanReview() { return this; } + private com.google.protobuf.FieldMask fieldMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequestOrBuilder.java index e61193ba753..a775775f846 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessRequestOrBuilder.java @@ -97,7 +97,12 @@ public interface ProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -111,7 +116,12 @@ public interface ProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -136,5 +146,40 @@ public interface ProcessRequestOrBuilder */ boolean getSkipHumanReview(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + public com.google.cloud.documentai.v1.ProcessRequest.SourceCase getSourceCase(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Processor.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Processor.java new file mode 100644 index 00000000000..1ae84c6c4f3 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Processor.java @@ -0,0 +1,2307 @@ +/* + * 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/documentai/v1/processor.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The first-class citizen for Document AI. Each processor defines how to
+ * extract structural information from a document.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Processor} + */ +public final class Processor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Processor) + ProcessorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Processor.newBuilder() to construct. + private Processor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Processor() { + name_ = ""; + type_ = ""; + displayName_ = ""; + state_ = 0; + defaultProcessorVersion_ = ""; + processEndpoint_ = ""; + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Processor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Processor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + processEndpoint_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + defaultProcessorVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_Processor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_Processor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Processor.class, + com.google.cloud.documentai.v1.Processor.Builder.class); + } + + /** + * + * + *
+   * The possible states of the processor.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1.Processor.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The processor is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The processor is enabled, i.e., has an enabled version which can
+     * currently serve processing requests and all the feature dependencies have
+     * been successfully initialized.
+     * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+     * The processor is disabled.
+     * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + /** + * + * + *
+     * The processor is being enabled, will become ENABLED if successful.
+     * 
+ * + * ENABLING = 3; + */ + ENABLING(3), + /** + * + * + *
+     * The processor is being disabled, will become DISABLED if successful.
+     * 
+ * + * DISABLING = 4; + */ + DISABLING(4), + /** + * + * + *
+     * The processor is being created, will become either ENABLED (for
+     * successful creation) or FAILED (for failed ones).
+     * Once a processor is in this state, it can then be used for document
+     * processing, but the feature dependencies of the processor might not be
+     * fully created yet.
+     * 
+ * + * CREATING = 5; + */ + CREATING(5), + /** + * + * + *
+     * The processor failed during creation or initialization of feature
+     * dependencies. The user should delete the processor and recreate one as
+     * all the functionalities of the processor are disabled.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * The processor is being deleted, will be removed if successful.
+     * 
+ * + * DELETING = 7; + */ + DELETING(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The processor is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The processor is enabled, i.e., has an enabled version which can
+     * currently serve processing requests and all the feature dependencies have
+     * been successfully initialized.
+     * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + /** + * + * + *
+     * The processor is disabled.
+     * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_VALUE = 2; + /** + * + * + *
+     * The processor is being enabled, will become ENABLED if successful.
+     * 
+ * + * ENABLING = 3; + */ + public static final int ENABLING_VALUE = 3; + /** + * + * + *
+     * The processor is being disabled, will become DISABLED if successful.
+     * 
+ * + * DISABLING = 4; + */ + public static final int DISABLING_VALUE = 4; + /** + * + * + *
+     * The processor is being created, will become either ENABLED (for
+     * successful creation) or FAILED (for failed ones).
+     * Once a processor is in this state, it can then be used for document
+     * processing, but the feature dependencies of the processor might not be
+     * fully created yet.
+     * 
+ * + * CREATING = 5; + */ + public static final int CREATING_VALUE = 5; + /** + * + * + *
+     * The processor failed during creation or initialization of feature
+     * dependencies. The user should delete the processor and recreate one as
+     * all the functionalities of the processor are disabled.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * The processor is being deleted, will be removed if successful.
+     * 
+ * + * DELETING = 7; + */ + public static final int DELETING_VALUE = 7; + + 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 ENABLED; + case 2: + return DISABLED; + case 3: + return ENABLING; + case 4: + return DISABLING; + case 5: + return CREATING; + case 6: + return FAILED; + case 7: + return DELETING; + 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.documentai.v1.Processor.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.documentai.v1.Processor.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Immutable. The resource name of the processor.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The resource name of the processor.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display name of the processor.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the processor.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. The state of the processor.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The state of the processor.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Processor.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.Processor.State result = + com.google.cloud.documentai.v1.Processor.State.valueOf(state_); + return result == null ? com.google.cloud.documentai.v1.Processor.State.UNRECOGNIZED : result; + } + + public static final int DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER = 9; + private volatile java.lang.Object defaultProcessorVersion_; + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The defaultProcessorVersion. + */ + @java.lang.Override + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + 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(); + defaultProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for defaultProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROCESS_ENDPOINT_FIELD_NUMBER = 6; + private volatile java.lang.Object processEndpoint_; + /** + * + * + *
+   * Output only. Immutable. The http endpoint that can be called to invoke processing.
+   * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The processEndpoint. + */ + @java.lang.Override + public java.lang.String getProcessEndpoint() { + java.lang.Object ref = processEndpoint_; + 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(); + processEndpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The http endpoint that can be called to invoke processing.
+   * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for processEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProcessEndpointBytes() { + java.lang.Object ref = processEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 8; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * The KMS key used for encryption/decryption in CMEK scenarios.
+   * See https://cloud.google.com/security-key-management.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key used for encryption/decryption in CMEK scenarios.
+   * See https://cloud.google.com/security-key-management.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (state_ != com.google.cloud.documentai.v1.Processor.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processEndpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, processEndpoint_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, defaultProcessorVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (state_ != com.google.cloud.documentai.v1.Processor.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processEndpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, processEndpoint_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, defaultProcessorVersion_); + } + 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.documentai.v1.Processor)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Processor other = (com.google.cloud.documentai.v1.Processor) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (!getDefaultProcessorVersion().equals(other.getDefaultProcessorVersion())) return false; + if (!getProcessEndpoint().equals(other.getProcessEndpoint())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDefaultProcessorVersion().hashCode(); + hash = (37 * hash) + PROCESS_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getProcessEndpoint().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Processor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Processor 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.documentai.v1.Processor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Processor 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.documentai.v1.Processor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Processor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Processor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Processor 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.documentai.v1.Processor parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Processor 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.documentai.v1.Processor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Processor 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.documentai.v1.Processor 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 first-class citizen for Document AI. Each processor defines how to
+   * extract structural information from a document.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Processor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Processor) + com.google.cloud.documentai.v1.ProcessorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_Processor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_Processor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Processor.class, + com.google.cloud.documentai.v1.Processor.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Processor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = ""; + + displayName_ = ""; + + state_ = 0; + + defaultProcessorVersion_ = ""; + + processEndpoint_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + kmsKeyName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_Processor_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Processor getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Processor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Processor build() { + com.google.cloud.documentai.v1.Processor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Processor buildPartial() { + com.google.cloud.documentai.v1.Processor result = + new com.google.cloud.documentai.v1.Processor(this); + result.name_ = name_; + result.type_ = type_; + result.displayName_ = displayName_; + result.state_ = state_; + result.defaultProcessorVersion_ = defaultProcessorVersion_; + result.processEndpoint_ = processEndpoint_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.kmsKeyName_ = kmsKeyName_; + 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.documentai.v1.Processor) { + return mergeFrom((com.google.cloud.documentai.v1.Processor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Processor other) { + if (other == com.google.cloud.documentai.v1.Processor.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getDefaultProcessorVersion().isEmpty()) { + defaultProcessorVersion_ = other.defaultProcessorVersion_; + onChanged(); + } + if (!other.getProcessEndpoint().isEmpty()) { + processEndpoint_ = other.processEndpoint_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + 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.documentai.v1.Processor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1.Processor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Immutable. The resource name of the processor.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The resource name of the processor.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The resource name of the processor.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The resource name of the processor.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The resource name of the processor.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the processor.
+     * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the processor.
+     * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the processor.
+     * 
+ * + * string display_name = 3; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor.
+     * 
+ * + * string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor.
+     * 
+ * + * string display_name = 3; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Processor.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.Processor.State result = + com.google.cloud.documentai.v1.Processor.State.valueOf(state_); + return result == null ? com.google.cloud.documentai.v1.Processor.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1.Processor.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object defaultProcessorVersion_ = ""; + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The defaultProcessorVersion. + */ + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for defaultProcessorVersion. + */ + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @param value The defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + defaultProcessorVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDefaultProcessorVersion() { + + defaultProcessorVersion_ = getDefaultInstance().getDefaultProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + defaultProcessorVersion_ = value; + onChanged(); + return this; + } + + private java.lang.Object processEndpoint_ = ""; + /** + * + * + *
+     * Output only. Immutable. The http endpoint that can be called to invoke processing.
+     * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The processEndpoint. + */ + public java.lang.String getProcessEndpoint() { + java.lang.Object ref = processEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + processEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The http endpoint that can be called to invoke processing.
+     * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for processEndpoint. + */ + public com.google.protobuf.ByteString getProcessEndpointBytes() { + java.lang.Object ref = processEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The http endpoint that can be called to invoke processing.
+     * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The processEndpoint to set. + * @return This builder for chaining. + */ + public Builder setProcessEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + processEndpoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The http endpoint that can be called to invoke processing.
+     * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearProcessEndpoint() { + + processEndpoint_ = getDefaultInstance().getProcessEndpoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The http endpoint that can be called to invoke processing.
+     * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for processEndpoint to set. + * @return This builder for chaining. + */ + public Builder setProcessEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + processEndpoint_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the processor was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The KMS key used for encryption/decryption in CMEK scenarios.
+     * See https://cloud.google.com/security-key-management.
+     * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key used for encryption/decryption in CMEK scenarios.
+     * See https://cloud.google.com/security-key-management.
+     * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key used for encryption/decryption in CMEK scenarios.
+     * See https://cloud.google.com/security-key-management.
+     * 
+ * + * string kms_key_name = 8; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key used for encryption/decryption in CMEK scenarios.
+     * See https://cloud.google.com/security-key-management.
+     * 
+ * + * string kms_key_name = 8; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key used for encryption/decryption in CMEK scenarios.
+     * See https://cloud.google.com/security-key-management.
+     * 
+ * + * string kms_key_name = 8; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = 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.documentai.v1.Processor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Processor) + private static final com.google.cloud.documentai.v1.Processor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Processor(); + } + + public static com.google.cloud.documentai.v1.Processor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Processor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Processor(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.documentai.v1.Processor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorOrBuilder.java new file mode 100644 index 00000000000..0b1ec7bde9b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorOrBuilder.java @@ -0,0 +1,255 @@ +/* + * 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/documentai/v1/processor.proto + +package com.google.cloud.documentai.v1; + +public interface ProcessorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Processor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. The resource name of the processor.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Immutable. The resource name of the processor.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The display name of the processor.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the processor.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The state of the processor.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The state of the processor.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.documentai.v1.Processor.State getState(); + + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The defaultProcessorVersion. + */ + java.lang.String getDefaultProcessorVersion(); + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for defaultProcessorVersion. + */ + com.google.protobuf.ByteString getDefaultProcessorVersionBytes(); + + /** + * + * + *
+   * Output only. Immutable. The http endpoint that can be called to invoke processing.
+   * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The processEndpoint. + */ + java.lang.String getProcessEndpoint(); + /** + * + * + *
+   * Output only. Immutable. The http endpoint that can be called to invoke processing.
+   * 
+ * + * + * string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for processEndpoint. + */ + com.google.protobuf.ByteString getProcessEndpointBytes(); + + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the processor was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The KMS key used for encryption/decryption in CMEK scenarios.
+   * See https://cloud.google.com/security-key-management.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The KMS key used for encryption/decryption in CMEK scenarios.
+   * See https://cloud.google.com/security-key-management.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorType.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorType.java new file mode 100644 index 00000000000..bd195a12dec --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorType.java @@ -0,0 +1,2464 @@ +/* + * 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/documentai/v1/processor_type.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * A processor type is responsible for performing a certain document
+ * understanding task on a certain type of document.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorType} + */ +public final class ProcessorType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ProcessorType) + ProcessorTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProcessorType.newBuilder() to construct. + private ProcessorType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProcessorType() { + name_ = ""; + type_ = ""; + category_ = ""; + availableLocations_ = java.util.Collections.emptyList(); + launchStage_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProcessorType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProcessorType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + category_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + availableLocations_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.ProcessorType.LocationInfo>(); + mutable_bitField0_ |= 0x00000001; + } + availableLocations_.add( + input.readMessage( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.parser(), + extensionRegistry)); + break; + } + case 48: + { + allowCreation_ = input.readBool(); + break; + } + case 64: + { + int rawValue = input.readEnum(); + + launchStage_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + availableLocations_ = java.util.Collections.unmodifiableList(availableLocations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorType.class, + com.google.cloud.documentai.v1.ProcessorType.Builder.class); + } + + public interface LocationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ProcessorType.LocationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The location id, currently must be one of [us, eu].
+     * 
+ * + * string location_id = 1; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + /** + * + * + *
+     * The location id, currently must be one of [us, eu].
+     * 
+ * + * string location_id = 1; + * + * @return The bytes for locationId. + */ + com.google.protobuf.ByteString getLocationIdBytes(); + } + /** + * + * + *
+   * The location information about where the processor is available.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorType.LocationInfo} + */ + public static final class LocationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ProcessorType.LocationInfo) + LocationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocationInfo.newBuilder() to construct. + private LocationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocationInfo() { + locationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocationInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + locationId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.class, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder.class); + } + + public static final int LOCATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object locationId_; + /** + * + * + *
+     * The location id, currently must be one of [us, eu].
+     * 
+ * + * string location_id = 1; + * + * @return The locationId. + */ + @java.lang.Override + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } + } + /** + * + * + *
+     * The location id, currently must be one of [us, eu].
+     * 
+ * + * string location_id = 1; + * + * @return The bytes for locationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, locationId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, locationId_); + } + 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.documentai.v1.ProcessorType.LocationInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ProcessorType.LocationInfo other = + (com.google.cloud.documentai.v1.ProcessorType.LocationInfo) obj; + + if (!getLocationId().equals(other.getLocationId())) 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) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo 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.documentai.v1.ProcessorType.LocationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo 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.documentai.v1.ProcessorType.LocationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo 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.documentai.v1.ProcessorType.LocationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo 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.documentai.v1.ProcessorType.LocationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo 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.documentai.v1.ProcessorType.LocationInfo 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 location information about where the processor is available.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorType.LocationInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ProcessorType.LocationInfo) + com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.class, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ProcessorType.LocationInfo.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(); + locationId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ProcessorType.LocationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo build() { + com.google.cloud.documentai.v1.ProcessorType.LocationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo buildPartial() { + com.google.cloud.documentai.v1.ProcessorType.LocationInfo result = + new com.google.cloud.documentai.v1.ProcessorType.LocationInfo(this); + result.locationId_ = locationId_; + 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.documentai.v1.ProcessorType.LocationInfo) { + return mergeFrom((com.google.cloud.documentai.v1.ProcessorType.LocationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ProcessorType.LocationInfo other) { + if (other == com.google.cloud.documentai.v1.ProcessorType.LocationInfo.getDefaultInstance()) + return this; + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + 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.documentai.v1.ProcessorType.LocationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ProcessorType.LocationInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object locationId_ = ""; + /** + * + * + *
+       * The location id, currently must be one of [us, eu].
+       * 
+ * + * string location_id = 1; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The location id, currently must be one of [us, eu].
+       * 
+ * + * string location_id = 1; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The location id, currently must be one of [us, eu].
+       * 
+ * + * string location_id = 1; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The location id, currently must be one of [us, eu].
+       * 
+ * + * string location_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + * + * + *
+       * The location id, currently must be one of [us, eu].
+       * 
+ * + * string location_id = 1; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationId_ = value; + onChanged(); + return this; + } + + @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.documentai.v1.ProcessorType.LocationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ProcessorType.LocationInfo) + private static final com.google.cloud.documentai.v1.ProcessorType.LocationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ProcessorType.LocationInfo(); + } + + public static com.google.cloud.documentai.v1.ProcessorType.LocationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationInfo(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.documentai.v1.ProcessorType.LocationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The type of the processor, e.g., "invoice_parsing".
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * The type of the processor, e.g., "invoice_parsing".
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORY_FIELD_NUMBER = 3; + private volatile java.lang.Object category_; + /** + * + * + *
+   * The processor category, used by UI to group processor types.
+   * 
+ * + * string category = 3; + * + * @return The category. + */ + @java.lang.Override + public java.lang.String getCategory() { + java.lang.Object ref = category_; + 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(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * The processor category, used by UI to group processor types.
+   * 
+ * + * string category = 3; + * + * @return The bytes for category. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVAILABLE_LOCATIONS_FIELD_NUMBER = 4; + private java.util.List + availableLocations_; + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public java.util.List + getAvailableLocationsList() { + return availableLocations_; + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder> + getAvailableLocationsOrBuilderList() { + return availableLocations_; + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public int getAvailableLocationsCount() { + return availableLocations_.size(); + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo getAvailableLocations( + int index) { + return availableLocations_.get(index); + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder + getAvailableLocationsOrBuilder(int index) { + return availableLocations_.get(index); + } + + public static final int ALLOW_CREATION_FIELD_NUMBER = 6; + private boolean allowCreation_; + /** + * + * + *
+   * Whether the processor type allows creation. If true, users can create a
+   * processor of this processor type. Otherwise, users need to request access.
+   * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + @java.lang.Override + public boolean getAllowCreation() { + return allowCreation_; + } + + public static final int LAUNCH_STAGE_FIELD_NUMBER = 8; + private int launchStage_; + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + @java.lang.Override + public int getLaunchStageValue() { + return launchStage_; + } + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + @java.lang.Override + public com.google.api.LaunchStage getLaunchStage() { + @SuppressWarnings("deprecation") + com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, category_); + } + for (int i = 0; i < availableLocations_.size(); i++) { + output.writeMessage(4, availableLocations_.get(i)); + } + if (allowCreation_ != false) { + output.writeBool(6, allowCreation_); + } + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, launchStage_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, category_); + } + for (int i = 0; i < availableLocations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, availableLocations_.get(i)); + } + if (allowCreation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowCreation_); + } + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, launchStage_); + } + 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.documentai.v1.ProcessorType)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ProcessorType other = + (com.google.cloud.documentai.v1.ProcessorType) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getCategory().equals(other.getCategory())) return false; + if (!getAvailableLocationsList().equals(other.getAvailableLocationsList())) return false; + if (getAllowCreation() != other.getAllowCreation()) return false; + if (launchStage_ != other.launchStage_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + if (getAvailableLocationsCount() > 0) { + hash = (37 * hash) + AVAILABLE_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAvailableLocationsList().hashCode(); + } + hash = (37 * hash) + ALLOW_CREATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCreation()); + hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER; + hash = (53 * hash) + launchStage_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ProcessorType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType 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.documentai.v1.ProcessorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType 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.documentai.v1.ProcessorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ProcessorType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType 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.documentai.v1.ProcessorType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType 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.documentai.v1.ProcessorType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorType 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.documentai.v1.ProcessorType 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 processor type is responsible for performing a certain document
+   * understanding task on a certain type of document.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ProcessorType) + com.google.cloud.documentai.v1.ProcessorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorType.class, + com.google.cloud.documentai.v1.ProcessorType.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ProcessorType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAvailableLocationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = ""; + + category_ = ""; + + if (availableLocationsBuilder_ == null) { + availableLocations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + availableLocationsBuilder_.clear(); + } + allowCreation_ = false; + + launchStage_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1_ProcessorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType build() { + com.google.cloud.documentai.v1.ProcessorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorType buildPartial() { + com.google.cloud.documentai.v1.ProcessorType result = + new com.google.cloud.documentai.v1.ProcessorType(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.type_ = type_; + result.category_ = category_; + if (availableLocationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + availableLocations_ = java.util.Collections.unmodifiableList(availableLocations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.availableLocations_ = availableLocations_; + } else { + result.availableLocations_ = availableLocationsBuilder_.build(); + } + result.allowCreation_ = allowCreation_; + result.launchStage_ = launchStage_; + 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.documentai.v1.ProcessorType) { + return mergeFrom((com.google.cloud.documentai.v1.ProcessorType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ProcessorType other) { + if (other == com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + onChanged(); + } + if (availableLocationsBuilder_ == null) { + if (!other.availableLocations_.isEmpty()) { + if (availableLocations_.isEmpty()) { + availableLocations_ = other.availableLocations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAvailableLocationsIsMutable(); + availableLocations_.addAll(other.availableLocations_); + } + onChanged(); + } + } else { + if (!other.availableLocations_.isEmpty()) { + if (availableLocationsBuilder_.isEmpty()) { + availableLocationsBuilder_.dispose(); + availableLocationsBuilder_ = null; + availableLocations_ = other.availableLocations_; + bitField0_ = (bitField0_ & ~0x00000001); + availableLocationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAvailableLocationsFieldBuilder() + : null; + } else { + availableLocationsBuilder_.addAllMessages(other.availableLocations_); + } + } + } + if (other.getAllowCreation() != false) { + setAllowCreation(other.getAllowCreation()); + } + if (other.launchStage_ != 0) { + setLaunchStageValue(other.getLaunchStageValue()); + } + 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.documentai.v1.ProcessorType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1.ProcessorType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The type of the processor, e.g., "invoice_parsing".
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of the processor, e.g., "invoice_parsing".
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of the processor, e.g., "invoice_parsing".
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the processor, e.g., "invoice_parsing".
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the processor, e.g., "invoice_parsing".
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * The processor category, used by UI to group processor types.
+     * 
+ * + * string category = 3; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The processor category, used by UI to group processor types.
+     * 
+ * + * string category = 3; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The processor category, used by UI to group processor types.
+     * 
+ * + * string category = 3; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The processor category, used by UI to group processor types.
+     * 
+ * + * string category = 3; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The processor category, used by UI to group processor types.
+     * 
+ * + * string category = 3; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + category_ = value; + onChanged(); + return this; + } + + private java.util.List + availableLocations_ = java.util.Collections.emptyList(); + + private void ensureAvailableLocationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + availableLocations_ = + new java.util.ArrayList( + availableLocations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder> + availableLocationsBuilder_; + + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public java.util.List + getAvailableLocationsList() { + if (availableLocationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(availableLocations_); + } else { + return availableLocationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public int getAvailableLocationsCount() { + if (availableLocationsBuilder_ == null) { + return availableLocations_.size(); + } else { + return availableLocationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo getAvailableLocations( + int index) { + if (availableLocationsBuilder_ == null) { + return availableLocations_.get(index); + } else { + return availableLocationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder setAvailableLocations( + int index, com.google.cloud.documentai.v1.ProcessorType.LocationInfo value) { + if (availableLocationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableLocationsIsMutable(); + availableLocations_.set(index, value); + onChanged(); + } else { + availableLocationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder setAvailableLocations( + int index, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder builderForValue) { + if (availableLocationsBuilder_ == null) { + ensureAvailableLocationsIsMutable(); + availableLocations_.set(index, builderForValue.build()); + onChanged(); + } else { + availableLocationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo value) { + if (availableLocationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableLocationsIsMutable(); + availableLocations_.add(value); + onChanged(); + } else { + availableLocationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + int index, com.google.cloud.documentai.v1.ProcessorType.LocationInfo value) { + if (availableLocationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableLocationsIsMutable(); + availableLocations_.add(index, value); + onChanged(); + } else { + availableLocationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder builderForValue) { + if (availableLocationsBuilder_ == null) { + ensureAvailableLocationsIsMutable(); + availableLocations_.add(builderForValue.build()); + onChanged(); + } else { + availableLocationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + int index, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder builderForValue) { + if (availableLocationsBuilder_ == null) { + ensureAvailableLocationsIsMutable(); + availableLocations_.add(index, builderForValue.build()); + onChanged(); + } else { + availableLocationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAllAvailableLocations( + java.lang.Iterable + values) { + if (availableLocationsBuilder_ == null) { + ensureAvailableLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, availableLocations_); + onChanged(); + } else { + availableLocationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder clearAvailableLocations() { + if (availableLocationsBuilder_ == null) { + availableLocations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + availableLocationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder removeAvailableLocations(int index) { + if (availableLocationsBuilder_ == null) { + ensureAvailableLocationsIsMutable(); + availableLocations_.remove(index); + onChanged(); + } else { + availableLocationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder + getAvailableLocationsBuilder(int index) { + return getAvailableLocationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder + getAvailableLocationsOrBuilder(int index) { + if (availableLocationsBuilder_ == null) { + return availableLocations_.get(index); + } else { + return availableLocationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder> + getAvailableLocationsOrBuilderList() { + if (availableLocationsBuilder_ != null) { + return availableLocationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(availableLocations_); + } + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder + addAvailableLocationsBuilder() { + return getAvailableLocationsFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder + addAvailableLocationsBuilder(int index) { + return getAvailableLocationsFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + public java.util.List + getAvailableLocationsBuilderList() { + return getAvailableLocationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder> + getAvailableLocationsFieldBuilder() { + if (availableLocationsBuilder_ == null) { + availableLocationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder>( + availableLocations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + availableLocations_ = null; + } + return availableLocationsBuilder_; + } + + private boolean allowCreation_; + /** + * + * + *
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
+     * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + @java.lang.Override + public boolean getAllowCreation() { + return allowCreation_; + } + /** + * + * + *
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
+     * 
+ * + * bool allow_creation = 6; + * + * @param value The allowCreation to set. + * @return This builder for chaining. + */ + public Builder setAllowCreation(boolean value) { + + allowCreation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
+     * 
+ * + * bool allow_creation = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllowCreation() { + + allowCreation_ = false; + onChanged(); + return this; + } + + private int launchStage_ = 0; + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + @java.lang.Override + public int getLaunchStageValue() { + return launchStage_; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @param value The enum numeric value on the wire for launchStage to set. + * @return This builder for chaining. + */ + public Builder setLaunchStageValue(int value) { + + launchStage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + @java.lang.Override + public com.google.api.LaunchStage getLaunchStage() { + @SuppressWarnings("deprecation") + com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @param value The launchStage to set. + * @return This builder for chaining. + */ + public Builder setLaunchStage(com.google.api.LaunchStage value) { + if (value == null) { + throw new NullPointerException(); + } + + launchStage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return This builder for chaining. + */ + public Builder clearLaunchStage() { + + launchStage_ = 0; + 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.documentai.v1.ProcessorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ProcessorType) + private static final com.google.cloud.documentai.v1.ProcessorType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ProcessorType(); + } + + public static com.google.cloud.documentai.v1.ProcessorType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProcessorType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProcessorType(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.documentai.v1.ProcessorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeName.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeName.java new file mode 100644 index 00000000000..293904f2549 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProcessorTypeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PROCESSOR_TYPE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/processorTypes/{processor_type}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String processorType; + + @Deprecated + protected ProcessorTypeName() { + project = null; + location = null; + processorType = null; + } + + private ProcessorTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + processorType = Preconditions.checkNotNull(builder.getProcessorType()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessorType() { + return processorType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProcessorTypeName of(String project, String location, String processorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessorType(processorType) + .build(); + } + + public static String format(String project, String location, String processorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessorType(processorType) + .build() + .toString(); + } + + public static ProcessorTypeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PROCESSOR_TYPE.validatedMatch( + formattedString, "ProcessorTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("processor_type")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProcessorTypeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PROCESSOR_TYPE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (processorType != null) { + fieldMapBuilder.put("processor_type", processorType); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PROCESSOR_TYPE.instantiate( + "project", project, "location", location, "processor_type", processorType); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProcessorTypeName that = ((ProcessorTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.processorType, that.processorType); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(processorType); + return h; + } + + /** Builder for projects/{project}/locations/{location}/processorTypes/{processor_type}. */ + public static class Builder { + private String project; + private String location; + private String processorType; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessorType() { + return processorType; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProcessorType(String processorType) { + this.processorType = processorType; + return this; + } + + private Builder(ProcessorTypeName processorTypeName) { + this.project = processorTypeName.project; + this.location = processorTypeName.location; + this.processorType = processorTypeName.processorType; + } + + public ProcessorTypeName build() { + return new ProcessorTypeName(this); + } + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeOrBuilder.java new file mode 100644 index 00000000000..e1f971d545c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorTypeOrBuilder.java @@ -0,0 +1,200 @@ +/* + * 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/documentai/v1/processor_type.proto + +package com.google.cloud.documentai.v1; + +public interface ProcessorTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ProcessorType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the processor, e.g., "invoice_parsing".
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The type of the processor, e.g., "invoice_parsing".
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The processor category, used by UI to group processor types.
+   * 
+ * + * string category = 3; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * The processor category, used by UI to group processor types.
+   * 
+ * + * string category = 3; + * + * @return The bytes for category. + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + java.util.List + getAvailableLocationsList(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + com.google.cloud.documentai.v1.ProcessorType.LocationInfo getAvailableLocations(int index); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + int getAvailableLocationsCount(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + java.util.List + getAvailableLocationsOrBuilderList(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * + */ + com.google.cloud.documentai.v1.ProcessorType.LocationInfoOrBuilder getAvailableLocationsOrBuilder( + int index); + + /** + * + * + *
+   * Whether the processor type allows creation. If true, users can create a
+   * processor of this processor type. Otherwise, users need to request access.
+   * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + boolean getAllowCreation(); + + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + int getLaunchStageValue(); + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + com.google.api.LaunchStage getLaunchStage(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java new file mode 100644 index 00000000000..5a15a51510d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java @@ -0,0 +1,3266 @@ +/* + * 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/documentai/v1/processor.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * A processor version is an implementation of a processor. Each processor
+ * can have multiple versions, pre-trained by Google internally or up-trained
+ * by the customer. At a time, a processor can only have one default version
+ * version. So the processor's behavior (when processing documents) is defined
+ * by a default version
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorVersion} + */ +public final class ProcessorVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ProcessorVersion) + ProcessorVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProcessorVersion.newBuilder() to construct. + private ProcessorVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProcessorVersion() { + name_ = ""; + displayName_ = ""; + state_ = 0; + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProcessorVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProcessorVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyVersionName_ = s; + break; + } + case 88: + { + googleManaged_ = input.readBool(); + break; + } + case 106: + { + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder subBuilder = + null; + if (deprecationInfo_ != null) { + subBuilder = deprecationInfo_.toBuilder(); + } + deprecationInfo_ = + input.readMessage( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deprecationInfo_); + deprecationInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorVersion.class, + com.google.cloud.documentai.v1.ProcessorVersion.Builder.class); + } + + /** + * + * + *
+   * The possible states of the processor version.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1.ProcessorVersion.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The processor version is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The processor version is deployed and can be used for processing.
+     * 
+ * + * DEPLOYED = 1; + */ + DEPLOYED(1), + /** + * + * + *
+     * The processor version is being deployed.
+     * 
+ * + * DEPLOYING = 2; + */ + DEPLOYING(2), + /** + * + * + *
+     * The processor version is not deployed and cannot be used for processing.
+     * 
+ * + * UNDEPLOYED = 3; + */ + UNDEPLOYED(3), + /** + * + * + *
+     * The processor version is being undeployed.
+     * 
+ * + * UNDEPLOYING = 4; + */ + UNDEPLOYING(4), + /** + * + * + *
+     * The processor version is being created.
+     * 
+ * + * CREATING = 5; + */ + CREATING(5), + /** + * + * + *
+     * The processor version is being deleted.
+     * 
+ * + * DELETING = 6; + */ + DELETING(6), + /** + * + * + *
+     * The processor version failed and is in an indeterminate state.
+     * 
+ * + * FAILED = 7; + */ + FAILED(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The processor version is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The processor version is deployed and can be used for processing.
+     * 
+ * + * DEPLOYED = 1; + */ + public static final int DEPLOYED_VALUE = 1; + /** + * + * + *
+     * The processor version is being deployed.
+     * 
+ * + * DEPLOYING = 2; + */ + public static final int DEPLOYING_VALUE = 2; + /** + * + * + *
+     * The processor version is not deployed and cannot be used for processing.
+     * 
+ * + * UNDEPLOYED = 3; + */ + public static final int UNDEPLOYED_VALUE = 3; + /** + * + * + *
+     * The processor version is being undeployed.
+     * 
+ * + * UNDEPLOYING = 4; + */ + public static final int UNDEPLOYING_VALUE = 4; + /** + * + * + *
+     * The processor version is being created.
+     * 
+ * + * CREATING = 5; + */ + public static final int CREATING_VALUE = 5; + /** + * + * + *
+     * The processor version is being deleted.
+     * 
+ * + * DELETING = 6; + */ + public static final int DELETING_VALUE = 6; + /** + * + * + *
+     * The processor version failed and is in an indeterminate state.
+     * 
+ * + * FAILED = 7; + */ + public static final int FAILED_VALUE = 7; + + 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 DEPLOYED; + case 2: + return DEPLOYING; + case 3: + return UNDEPLOYED; + case 4: + return UNDEPLOYING; + case 5: + return CREATING; + case 6: + return DELETING; + case 7: + return FAILED; + 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.documentai.v1.ProcessorVersion.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.documentai.v1.ProcessorVersion.State) + } + + public interface DeprecationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + boolean hasDeprecationTime(); + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + com.google.protobuf.Timestamp getDeprecationTime(); + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder(); + + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + java.lang.String getReplacementProcessorVersion(); + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + com.google.protobuf.ByteString getReplacementProcessorVersionBytes(); + } + /** + * + * + *
+   * Information about the upcoming deprecation of this processor version.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} + */ + public static final class DeprecationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + DeprecationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeprecationInfo.newBuilder() to construct. + private DeprecationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeprecationInfo() { + replacementProcessorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeprecationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeprecationInfo( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (deprecationTime_ != null) { + subBuilder = deprecationTime_.toBuilder(); + } + deprecationTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deprecationTime_); + deprecationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + replacementProcessorVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.class, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder.class); + } + + public static final int DEPRECATION_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp deprecationTime_; + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + @java.lang.Override + public boolean hasDeprecationTime() { + return deprecationTime_ != null; + } + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeprecationTime() { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder() { + return getDeprecationTime(); + } + + public static final int REPLACEMENT_PROCESSOR_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object replacementProcessorVersion_; + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + @java.lang.Override + public java.lang.String getReplacementProcessorVersion() { + java.lang.Object ref = replacementProcessorVersion_; + 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(); + replacementProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplacementProcessorVersionBytes() { + java.lang.Object ref = replacementProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementProcessorVersion_ = 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 (deprecationTime_ != null) { + output.writeMessage(1, getDeprecationTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replacementProcessorVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deprecationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeprecationTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementProcessorVersion_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, replacementProcessorVersion_); + } + 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.documentai.v1.ProcessorVersion.DeprecationInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo other = + (com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) obj; + + if (hasDeprecationTime() != other.hasDeprecationTime()) return false; + if (hasDeprecationTime()) { + if (!getDeprecationTime().equals(other.getDeprecationTime())) return false; + } + if (!getReplacementProcessorVersion().equals(other.getReplacementProcessorVersion())) + 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 (hasDeprecationTime()) { + hash = (37 * hash) + DEPRECATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationTime().hashCode(); + } + hash = (37 * hash) + REPLACEMENT_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getReplacementProcessorVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo 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.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo 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.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo 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.documentai.v1.ProcessorVersion.DeprecationInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + 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.documentai.v1.ProcessorVersion.DeprecationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo 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.documentai.v1.ProcessorVersion.DeprecationInfo 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; + } + /** + * + * + *
+     * Information about the upcoming deprecation of this processor version.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.class, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.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 (deprecationTimeBuilder_ == null) { + deprecationTime_ = null; + } else { + deprecationTime_ = null; + deprecationTimeBuilder_ = null; + } + replacementProcessorVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo build() { + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo buildPartial() { + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo result = + new com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo(this); + if (deprecationTimeBuilder_ == null) { + result.deprecationTime_ = deprecationTime_; + } else { + result.deprecationTime_ = deprecationTimeBuilder_.build(); + } + result.replacementProcessorVersion_ = replacementProcessorVersion_; + 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.documentai.v1.ProcessorVersion.DeprecationInfo) { + return mergeFrom((com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo other) { + if (other + == com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.getDefaultInstance()) + return this; + if (other.hasDeprecationTime()) { + mergeDeprecationTime(other.getDeprecationTime()); + } + if (!other.getReplacementProcessorVersion().isEmpty()) { + replacementProcessorVersion_ = other.replacementProcessorVersion_; + 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.documentai.v1.ProcessorVersion.DeprecationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp deprecationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deprecationTimeBuilder_; + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + public boolean hasDeprecationTime() { + return deprecationTimeBuilder_ != null || deprecationTime_ != null; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + public com.google.protobuf.Timestamp getDeprecationTime() { + if (deprecationTimeBuilder_ == null) { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } else { + return deprecationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder setDeprecationTime(com.google.protobuf.Timestamp value) { + if (deprecationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deprecationTime_ = value; + onChanged(); + } else { + deprecationTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder setDeprecationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deprecationTimeBuilder_ == null) { + deprecationTime_ = builderForValue.build(); + onChanged(); + } else { + deprecationTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder mergeDeprecationTime(com.google.protobuf.Timestamp value) { + if (deprecationTimeBuilder_ == null) { + if (deprecationTime_ != null) { + deprecationTime_ = + com.google.protobuf.Timestamp.newBuilder(deprecationTime_) + .mergeFrom(value) + .buildPartial(); + } else { + deprecationTime_ = value; + } + onChanged(); + } else { + deprecationTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder clearDeprecationTime() { + if (deprecationTimeBuilder_ == null) { + deprecationTime_ = null; + onChanged(); + } else { + deprecationTime_ = null; + deprecationTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getDeprecationTimeBuilder() { + + onChanged(); + return getDeprecationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder() { + if (deprecationTimeBuilder_ != null) { + return deprecationTimeBuilder_.getMessageOrBuilder(); + } else { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeprecationTimeFieldBuilder() { + if (deprecationTimeBuilder_ == null) { + deprecationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeprecationTime(), getParentForChildren(), isClean()); + deprecationTime_ = null; + } + return deprecationTimeBuilder_; + } + + private java.lang.Object replacementProcessorVersion_ = ""; + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + public java.lang.String getReplacementProcessorVersion() { + java.lang.Object ref = replacementProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replacementProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + public com.google.protobuf.ByteString getReplacementProcessorVersionBytes() { + java.lang.Object ref = replacementProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @param value The replacementProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setReplacementProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replacementProcessorVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearReplacementProcessorVersion() { + + replacementProcessorVersion_ = getDefaultInstance().getReplacementProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for replacementProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setReplacementProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replacementProcessorVersion_ = 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.documentai.v1.ProcessorVersion.DeprecationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + private static final com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo(); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeprecationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeprecationInfo(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.documentai.v1.ProcessorVersion.DeprecationInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.ProcessorVersion.State result = + com.google.cloud.documentai.v1.ProcessorVersion.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1.ProcessorVersion.State.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 9; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 10; + private volatile java.lang.Object kmsKeyVersionName_; + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + 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(); + kmsKeyVersionName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GOOGLE_MANAGED_FIELD_NUMBER = 11; + private boolean googleManaged_; + /** + * + * + *
+   * Denotes that this ProcessorVersion is managed by google.
+   * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + @java.lang.Override + public boolean getGoogleManaged() { + return googleManaged_; + } + + public static final int DEPRECATION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecationInfo_; + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + @java.lang.Override + public boolean hasDeprecationInfo() { + return deprecationInfo_ != null; + } + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo getDeprecationInfo() { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.getDefaultInstance() + : deprecationInfo_; + } + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder() { + return getDeprecationInfo(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1.ProcessorVersion.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, kmsKeyVersionName_); + } + if (googleManaged_ != false) { + output.writeBool(11, googleManaged_); + } + if (deprecationInfo_ != null) { + output.writeMessage(13, getDeprecationInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1.ProcessorVersion.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, kmsKeyVersionName_); + } + if (googleManaged_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, googleManaged_); + } + if (deprecationInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getDeprecationInfo()); + } + 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.documentai.v1.ProcessorVersion)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ProcessorVersion other = + (com.google.cloud.documentai.v1.ProcessorVersion) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (getGoogleManaged() != other.getGoogleManaged()) return false; + if (hasDeprecationInfo() != other.hasDeprecationInfo()) return false; + if (hasDeprecationInfo()) { + if (!getDeprecationInfo().equals(other.getDeprecationInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (37 * hash) + GOOGLE_MANAGED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGoogleManaged()); + if (hasDeprecationInfo()) { + hash = (37 * hash) + DEPRECATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ProcessorVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion 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.documentai.v1.ProcessorVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion 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.documentai.v1.ProcessorVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion 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.documentai.v1.ProcessorVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion 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.documentai.v1.ProcessorVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion 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.documentai.v1.ProcessorVersion 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 processor version is an implementation of a processor. Each processor
+   * can have multiple versions, pre-trained by Google internally or up-trained
+   * by the customer. At a time, a processor can only have one default version
+   * version. So the processor's behavior (when processing documents) is defined
+   * by a default version
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ProcessorVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ProcessorVersion) + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ProcessorVersion.class, + com.google.cloud.documentai.v1.ProcessorVersion.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ProcessorVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + kmsKeyName_ = ""; + + kmsKeyVersionName_ = ""; + + googleManaged_ = false; + + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = null; + } else { + deprecationInfo_ = null; + deprecationInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion build() { + com.google.cloud.documentai.v1.ProcessorVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion buildPartial() { + com.google.cloud.documentai.v1.ProcessorVersion result = + new com.google.cloud.documentai.v1.ProcessorVersion(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.kmsKeyName_ = kmsKeyName_; + result.kmsKeyVersionName_ = kmsKeyVersionName_; + result.googleManaged_ = googleManaged_; + if (deprecationInfoBuilder_ == null) { + result.deprecationInfo_ = deprecationInfo_; + } else { + result.deprecationInfo_ = deprecationInfoBuilder_.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.documentai.v1.ProcessorVersion) { + return mergeFrom((com.google.cloud.documentai.v1.ProcessorVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ProcessorVersion other) { + if (other == com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + onChanged(); + } + if (other.getGoogleManaged() != false) { + setGoogleManaged(other.getGoogleManaged()); + } + if (other.hasDeprecationInfo()) { + mergeDeprecationInfo(other.getDeprecationInfo()); + } + 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.documentai.v1.ProcessorVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1.ProcessorVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @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 processor version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.ProcessorVersion.State result = + com.google.cloud.documentai.v1.ProcessorVersion.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1.ProcessorVersion.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1.ProcessorVersion.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersionName_ = ""; + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + + private boolean googleManaged_; + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + @java.lang.Override + public boolean getGoogleManaged() { + return googleManaged_; + } + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @param value The googleManaged to set. + * @return This builder for chaining. + */ + public Builder setGoogleManaged(boolean value) { + + googleManaged_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @return This builder for chaining. + */ + public Builder clearGoogleManaged() { + + googleManaged_ = false; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder> + deprecationInfoBuilder_; + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + public boolean hasDeprecationInfo() { + return deprecationInfoBuilder_ != null || deprecationInfo_ != null; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo getDeprecationInfo() { + if (deprecationInfoBuilder_ == null) { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.getDefaultInstance() + : deprecationInfo_; + } else { + return deprecationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder setDeprecationInfo( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo value) { + if (deprecationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deprecationInfo_ = value; + onChanged(); + } else { + deprecationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder setDeprecationInfo( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder builderForValue) { + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = builderForValue.build(); + onChanged(); + } else { + deprecationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder mergeDeprecationInfo( + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo value) { + if (deprecationInfoBuilder_ == null) { + if (deprecationInfo_ != null) { + deprecationInfo_ = + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.newBuilder( + deprecationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + deprecationInfo_ = value; + } + onChanged(); + } else { + deprecationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder clearDeprecationInfo() { + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = null; + onChanged(); + } else { + deprecationInfo_ = null; + deprecationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder + getDeprecationInfoBuilder() { + + onChanged(); + return getDeprecationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder() { + if (deprecationInfoBuilder_ != null) { + return deprecationInfoBuilder_.getMessageOrBuilder(); + } else { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.getDefaultInstance() + : deprecationInfo_; + } + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder> + getDeprecationInfoFieldBuilder() { + if (deprecationInfoBuilder_ == null) { + deprecationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder>( + getDeprecationInfo(), getParentForChildren(), isClean()); + deprecationInfo_ = null; + } + return deprecationInfoBuilder_; + } + + @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.documentai.v1.ProcessorVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ProcessorVersion) + private static final com.google.cloud.documentai.v1.ProcessorVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ProcessorVersion(); + } + + public static com.google.cloud.documentai.v1.ProcessorVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProcessorVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProcessorVersion(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.documentai.v1.ProcessorVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionName.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionName.java new file mode 100644 index 00000000000..677624b97f2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProcessorVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String processor; + private final String processorVersion; + + @Deprecated + protected ProcessorVersionName() { + project = null; + location = null; + processor = null; + processorVersion = null; + } + + private ProcessorVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + processor = Preconditions.checkNotNull(builder.getProcessor()); + processorVersion = Preconditions.checkNotNull(builder.getProcessorVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProcessorVersionName of( + String project, String location, String processor, String processorVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .build(); + } + + public static String format( + String project, String location, String processor, String processorVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .build() + .toString(); + } + + public static ProcessorVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.validatedMatch( + formattedString, "ProcessorVersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("processor"), + matchMap.get("processor_version")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProcessorVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (processor != null) { + fieldMapBuilder.put("processor", processor); + } + if (processorVersion != null) { + fieldMapBuilder.put("processor_version", processorVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.instantiate( + "project", + project, + "location", + location, + "processor", + processor, + "processor_version", + processorVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProcessorVersionName that = ((ProcessorVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.processor, that.processor) + && Objects.equals(this.processorVersion, that.processorVersion); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(processor); + h *= 1000003; + h ^= Objects.hashCode(processorVersion); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}. + */ + public static class Builder { + private String project; + private String location; + private String processor; + private String processorVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProcessor(String processor) { + this.processor = processor; + return this; + } + + public Builder setProcessorVersion(String processorVersion) { + this.processorVersion = processorVersion; + return this; + } + + private Builder(ProcessorVersionName processorVersionName) { + this.project = processorVersionName.project; + this.location = processorVersionName.location; + this.processor = processorVersionName.processor; + this.processorVersion = processorVersionName.processorVersion; + } + + public ProcessorVersionName build() { + return new ProcessorVersionName(this); + } + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java new file mode 100644 index 00000000000..4b9187f4cb9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java @@ -0,0 +1,241 @@ +/* + * 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/documentai/v1/processor.proto + +package com.google.cloud.documentai.v1; + +public interface ProcessorVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ProcessorVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * + * @return The state. + */ + com.google.cloud.documentai.v1.ProcessorVersion.State getState(); + + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); + + /** + * + * + *
+   * Denotes that this ProcessorVersion is managed by google.
+   * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + boolean getGoogleManaged(); + + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + boolean hasDeprecationInfo(); + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo getDeprecationInfo(); + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadata.java index 7f971b530ef..27f10e8df48 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadata.java @@ -186,7 +186,7 @@ public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata( * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -209,7 +209,7 @@ public java.lang.String getQuestionId() { * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -773,7 +773,7 @@ public Builder clearCommonMetadata() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -795,7 +795,7 @@ public java.lang.String getQuestionId() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -817,7 +817,7 @@ public com.google.protobuf.ByteString getQuestionIdBytes() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -838,7 +838,7 @@ public Builder setQuestionId(java.lang.String value) { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -855,7 +855,7 @@ public Builder clearQuestionId() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadataOrBuilder.java index f15debfa7c5..4945a529f8c 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadataOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentOperationMetadataOrBuilder.java @@ -62,7 +62,7 @@ public interface ReviewDocumentOperationMetadataOrBuilder * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -74,7 +74,7 @@ public interface ReviewDocumentOperationMetadataOrBuilder * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequest.java index 3018a6ca64f..fb73b7bd1ab 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequest.java @@ -104,6 +104,22 @@ private ReviewDocumentRequest( int rawValue = input.readEnum(); priority_ = rawValue; + break; + } + case 50: + { + com.google.cloud.documentai.v1.DocumentSchema.Builder subBuilder = null; + if (documentSchema_ != null) { + subBuilder = documentSchema_.toBuilder(); + } + documentSchema_ = + input.readMessage( + com.google.cloud.documentai.v1.DocumentSchema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentSchema_); + documentSchema_ = subBuilder.buildPartial(); + } + break; } default: @@ -487,6 +503,54 @@ public com.google.cloud.documentai.v1.ReviewDocumentRequest.Priority getPriority : result; } + public static final int DOCUMENT_SCHEMA_FIELD_NUMBER = 6; + private com.google.cloud.documentai.v1.DocumentSchema documentSchema_; + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + @java.lang.Override + public boolean hasDocumentSchema() { + return documentSchema_ != null; + } + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema() { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + return getDocumentSchema(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -514,6 +578,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.documentai.v1.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { output.writeEnum(5, priority_); } + if (documentSchema_ != null) { + output.writeMessage(6, getDocumentSchema()); + } unknownFields.writeTo(output); } @@ -538,6 +605,9 @@ public int getSerializedSize() { != com.google.cloud.documentai.v1.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, priority_); } + if (documentSchema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDocumentSchema()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -557,6 +627,10 @@ public boolean equals(final java.lang.Object obj) { if (!getHumanReviewConfig().equals(other.getHumanReviewConfig())) return false; if (getEnableSchemaValidation() != other.getEnableSchemaValidation()) return false; if (priority_ != other.priority_) return false; + if (hasDocumentSchema() != other.hasDocumentSchema()) return false; + if (hasDocumentSchema()) { + if (!getDocumentSchema().equals(other.getDocumentSchema())) return false; + } if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 4: @@ -582,6 +656,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSchemaValidation()); hash = (37 * hash) + PRIORITY_FIELD_NUMBER; hash = (53 * hash) + priority_; + if (hasDocumentSchema()) { + hash = (37 * hash) + DOCUMENT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchema().hashCode(); + } switch (sourceCase_) { case 4: hash = (37 * hash) + INLINE_DOCUMENT_FIELD_NUMBER; @@ -741,6 +819,12 @@ public Builder clear() { priority_ = 0; + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } sourceCase_ = 0; source_ = null; return this; @@ -780,6 +864,11 @@ public com.google.cloud.documentai.v1.ReviewDocumentRequest buildPartial() { result.humanReviewConfig_ = humanReviewConfig_; result.enableSchemaValidation_ = enableSchemaValidation_; result.priority_ = priority_; + if (documentSchemaBuilder_ == null) { + result.documentSchema_ = documentSchema_; + } else { + result.documentSchema_ = documentSchemaBuilder_.build(); + } result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -841,6 +930,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.ReviewDocumentRequest ot if (other.priority_ != 0) { setPriorityValue(other.getPriorityValue()); } + if (other.hasDocumentSchema()) { + mergeDocumentSchema(other.getDocumentSchema()); + } switch (other.getSourceCase()) { case INLINE_DOCUMENT: { @@ -1373,6 +1465,192 @@ public Builder clearPriority() { return this; } + private com.google.cloud.documentai.v1.DocumentSchema documentSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder> + documentSchemaBuilder_; + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + public boolean hasDocumentSchema() { + return documentSchemaBuilder_ != null || documentSchema_ != null; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + public com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema() { + if (documentSchemaBuilder_ == null) { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } else { + return documentSchemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public Builder setDocumentSchema(com.google.cloud.documentai.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentSchema_ = value; + onChanged(); + } else { + documentSchemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public Builder setDocumentSchema( + com.google.cloud.documentai.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemaBuilder_ == null) { + documentSchema_ = builderForValue.build(); + onChanged(); + } else { + documentSchemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public Builder mergeDocumentSchema(com.google.cloud.documentai.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (documentSchema_ != null) { + documentSchema_ = + com.google.cloud.documentai.v1.DocumentSchema.newBuilder(documentSchema_) + .mergeFrom(value) + .buildPartial(); + } else { + documentSchema_ = value; + } + onChanged(); + } else { + documentSchemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public Builder clearDocumentSchema() { + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + onChanged(); + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public com.google.cloud.documentai.v1.DocumentSchema.Builder getDocumentSchemaBuilder() { + + onChanged(); + return getDocumentSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + public com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + if (documentSchemaBuilder_ != null) { + return documentSchemaBuilder_.getMessageOrBuilder(); + } else { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder> + getDocumentSchemaFieldBuilder() { + if (documentSchemaBuilder_ == null) { + documentSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder>( + getDocumentSchema(), getParentForChildren(), isClean()); + documentSchema_ = null; + } + return documentSchemaBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequestOrBuilder.java index 21080f661cf..8e01bf40060 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentRequestOrBuilder.java @@ -127,5 +127,40 @@ public interface ReviewDocumentRequestOrBuilder */ com.google.cloud.documentai.v1.ReviewDocumentRequest.Priority getPriority(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + boolean hasDocumentSchema(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder(); + public com.google.cloud.documentai.v1.ReviewDocumentRequest.SourceCase getSourceCase(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponse.java index 0b3e058222f..1a67925c6c3 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponse.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponse.java @@ -39,6 +39,8 @@ private ReviewDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder private ReviewDocumentResponse() { gcsDestination_ = ""; + state_ = 0; + rejectionReason_ = ""; } @java.lang.Override @@ -77,6 +79,20 @@ private ReviewDocumentResponse( gcsDestination_ = s; break; } + case 16: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + rejectionReason_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -113,13 +129,173 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1.ReviewDocumentResponse.Builder.class); } + /** + * + * + *
+   * Possible states of the review operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1.ReviewDocumentResponse.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The review operation is rejected by the reviewer.
+     * 
+ * + * REJECTED = 1; + */ + REJECTED(1), + /** + * + * + *
+     * The review operation is succeeded.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The review operation is rejected by the reviewer.
+     * 
+ * + * REJECTED = 1; + */ + public static final int REJECTED_VALUE = 1; + /** + * + * + *
+     * The review operation is succeeded.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + + 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 REJECTED; + case 2: + return SUCCEEDED; + 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.documentai.v1.ReviewDocumentResponse.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.documentai.v1.ReviewDocumentResponse.State) + } + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; private volatile java.lang.Object gcsDestination_; /** * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -142,7 +318,8 @@ public java.lang.String getGcsDestination() { * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -162,6 +339,93 @@ public com.google.protobuf.ByteString getGcsDestinationBytes() { } } + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ReviewDocumentResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.ReviewDocumentResponse.State result = + com.google.cloud.documentai.v1.ReviewDocumentResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1.ReviewDocumentResponse.State.UNRECOGNIZED + : result; + } + + public static final int REJECTION_REASON_FIELD_NUMBER = 3; + private volatile java.lang.Object rejectionReason_; + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + @java.lang.Override + public java.lang.String getRejectionReason() { + java.lang.Object ref = rejectionReason_; + 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(); + rejectionReason_ = s; + return s; + } + } + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRejectionReasonBytes() { + java.lang.Object ref = rejectionReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rejectionReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -179,6 +443,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsDestination_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsDestination_); } + if (state_ + != com.google.cloud.documentai.v1.ReviewDocumentResponse.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rejectionReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rejectionReason_); + } unknownFields.writeTo(output); } @@ -191,6 +463,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsDestination_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsDestination_); } + if (state_ + != com.google.cloud.documentai.v1.ReviewDocumentResponse.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rejectionReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rejectionReason_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -208,6 +488,8 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.documentai.v1.ReviewDocumentResponse) obj; if (!getGcsDestination().equals(other.getGcsDestination())) return false; + if (state_ != other.state_) return false; + if (!getRejectionReason().equals(other.getRejectionReason())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -221,6 +503,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; hash = (53 * hash) + getGcsDestination().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + REJECTION_REASON_FIELD_NUMBER; + hash = (53 * hash) + getRejectionReason().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -369,6 +655,10 @@ public Builder clear() { super.clear(); gcsDestination_ = ""; + state_ = 0; + + rejectionReason_ = ""; + return this; } @@ -397,6 +687,8 @@ public com.google.cloud.documentai.v1.ReviewDocumentResponse buildPartial() { com.google.cloud.documentai.v1.ReviewDocumentResponse result = new com.google.cloud.documentai.v1.ReviewDocumentResponse(this); result.gcsDestination_ = gcsDestination_; + result.state_ = state_; + result.rejectionReason_ = rejectionReason_; onBuilt(); return result; } @@ -451,6 +743,13 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.ReviewDocumentResponse o gcsDestination_ = other.gcsDestination_; onChanged(); } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getRejectionReason().isEmpty()) { + rejectionReason_ = other.rejectionReason_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -486,7 +785,8 @@ public Builder mergeFrom( * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -508,7 +808,8 @@ public java.lang.String getGcsDestination() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -530,7 +831,8 @@ public com.google.protobuf.ByteString getGcsDestinationBytes() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -551,7 +853,8 @@ public Builder setGcsDestination(java.lang.String value) { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -568,7 +871,8 @@ public Builder clearGcsDestination() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -587,6 +891,205 @@ public Builder setGcsDestinationBytes(com.google.protobuf.ByteString value) { return this; } + private int state_ = 0; + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @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 review operation.
+     * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ReviewDocumentResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1.ReviewDocumentResponse.State result = + com.google.cloud.documentai.v1.ReviewDocumentResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1.ReviewDocumentResponse.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1.ReviewDocumentResponse.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object rejectionReason_ = ""; + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + public java.lang.String getRejectionReason() { + java.lang.Object ref = rejectionReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rejectionReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + public com.google.protobuf.ByteString getRejectionReasonBytes() { + java.lang.Object ref = rejectionReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rejectionReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @param value The rejectionReason to set. + * @return This builder for chaining. + */ + public Builder setRejectionReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rejectionReason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return This builder for chaining. + */ + public Builder clearRejectionReason() { + + rejectionReason_ = getDefaultInstance().getRejectionReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @param value The bytes for rejectionReason to set. + * @return This builder for chaining. + */ + public Builder setRejectionReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rejectionReason_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponseOrBuilder.java index be4bb1c2179..a8e76e97114 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponseOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ReviewDocumentResponseOrBuilder.java @@ -27,7 +27,8 @@ public interface ReviewDocumentResponseOrBuilder * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -39,7 +40,8 @@ public interface ReviewDocumentResponseOrBuilder * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -47,4 +49,54 @@ public interface ReviewDocumentResponseOrBuilder * @return The bytes for gcsDestination. */ com.google.protobuf.ByteString getGcsDestinationBytes(); + + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + com.google.cloud.documentai.v1.ReviewDocumentResponse.State getState(); + + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + java.lang.String getRejectionReason(); + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + com.google.protobuf.ByteString getRejectionReasonBytes(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadata.java new file mode 100644 index 00000000000..af278ead0bd --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadata.java @@ -0,0 +1,754 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for set default processor version
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} + */ +public final class SetDefaultProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + SetDefaultProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionMetadata.newBuilder() to construct. + private SetDefaultProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionMetadata( + 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.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1.SetDefaultProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata 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.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata 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.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata 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.documentai.v1.SetDefaultProcessorVersionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + 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.documentai.v1.SetDefaultProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata 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.documentai.v1.SetDefaultProcessorVersionMetadata 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 long running operation metadata for set default processor version
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.SetDefaultProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.SetDefaultProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.SetDefaultProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionMetadata(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.documentai.v1.SetDefaultProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..53d2c85ed7f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface SetDefaultProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequest.java new file mode 100644 index 00000000000..a83f84df283 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequest.java @@ -0,0 +1,868 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the set default processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} + */ +public final class SetDefaultProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + SetDefaultProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionRequest.newBuilder() to construct. + private SetDefaultProcessorVersionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionRequest() { + processor_ = ""; + defaultProcessorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + processor_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + defaultProcessorVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.Builder.class); + } + + public static final int PROCESSOR_FIELD_NUMBER = 1; + private volatile java.lang.Object processor_; + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + @java.lang.Override + public java.lang.String getProcessor() { + java.lang.Object ref = processor_; + 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(); + processor_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProcessorBytes() { + java.lang.Object ref = processor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object defaultProcessorVersion_; + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + @java.lang.Override + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + 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(); + defaultProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, processor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultProcessorVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, processor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultProcessorVersion_); + } + 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.documentai.v1.SetDefaultProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest other = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) obj; + + if (!getProcessor().equals(other.getProcessor())) return false; + if (!getDefaultProcessorVersion().equals(other.getDefaultProcessorVersion())) 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) + PROCESSOR_FIELD_NUMBER; + hash = (53 * hash) + getProcessor().hashCode(); + hash = (37 * hash) + DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDefaultProcessorVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest 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.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest 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.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest 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.documentai.v1.SetDefaultProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest 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.documentai.v1.SetDefaultProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest 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.documentai.v1.SetDefaultProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the set default processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.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(); + processor_ = ""; + + defaultProcessorVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest build() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest result = + new com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest(this); + result.processor_ = processor_; + result.defaultProcessorVersion_ = defaultProcessorVersion_; + 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.documentai.v1.SetDefaultProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getProcessor().isEmpty()) { + processor_ = other.processor_; + onChanged(); + } + if (!other.getDefaultProcessorVersion().isEmpty()) { + defaultProcessorVersion_ = other.defaultProcessorVersion_; + 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.documentai.v1.SetDefaultProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object processor_ = ""; + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + public java.lang.String getProcessor() { + java.lang.Object ref = processor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + processor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + public com.google.protobuf.ByteString getProcessorBytes() { + java.lang.Object ref = processor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The processor to set. + * @return This builder for chaining. + */ + public Builder setProcessor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + processor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProcessor() { + + processor_ = getDefaultInstance().getProcessor(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for processor to set. + * @return This builder for chaining. + */ + public Builder setProcessorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + processor_ = value; + onChanged(); + return this; + } + + private java.lang.Object defaultProcessorVersion_ = ""; + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + defaultProcessorVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDefaultProcessorVersion() { + + defaultProcessorVersion_ = getDefaultInstance().getDefaultProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + defaultProcessorVersion_ = 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.documentai.v1.SetDefaultProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionRequest(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.documentai.v1.SetDefaultProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..57fe522438f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface SetDefaultProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + java.lang.String getProcessor(); + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + com.google.protobuf.ByteString getProcessorBytes(); + + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + java.lang.String getDefaultProcessorVersion(); + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + com.google.protobuf.ByteString getDefaultProcessorVersionBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponse.java new file mode 100644 index 00000000000..29b18b511e5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponse.java @@ -0,0 +1,469 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for set default processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} + */ +public final class SetDefaultProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + SetDefaultProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionResponse.newBuilder() to construct. + private SetDefaultProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1.SetDefaultProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse other = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse 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.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse 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.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse 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.documentai.v1.SetDefaultProcessorVersionResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + 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.documentai.v1.SetDefaultProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse 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.documentai.v1.SetDefaultProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for set default processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.class, + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse build() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse result = + new com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse(this); + 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.documentai.v1.SetDefaultProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.getDefaultInstance()) + return this; + 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.documentai.v1.SetDefaultProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1.SetDefaultProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionResponse(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.documentai.v1.SetDefaultProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..11236239a98 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/SetDefaultProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface SetDefaultProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadata.java new file mode 100644 index 00000000000..00081e4dcec --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadata.java @@ -0,0 +1,752 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long running operation metadata for the undeploy processor version
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionMetadata} + */ +public final class UndeployProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + UndeployProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionMetadata.newBuilder() to construct. + private UndeployProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionMetadata( + 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.documentai.v1.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1.UndeployProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata 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.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata 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.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata 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.documentai.v1.UndeployProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata 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.documentai.v1.UndeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata 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.documentai.v1.UndeployProcessorVersionMetadata 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 long running operation metadata for the undeploy processor version
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1.UndeployProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1.UndeployProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder(commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1.UndeployProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionMetadata(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.documentai.v1.UndeployProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..7001efed0f1 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface UndeployProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequest.java new file mode 100644 index 00000000000..29b05ca85f8 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequest.java @@ -0,0 +1,660 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the undeploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionRequest} + */ +public final class UndeployProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.UndeployProcessorVersionRequest) + UndeployProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionRequest.newBuilder() to construct. + private UndeployProcessorVersionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.UndeployProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest other = + (com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest 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.documentai.v1.UndeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest 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.documentai.v1.UndeployProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest 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.documentai.v1.UndeployProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest 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.documentai.v1.UndeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest 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.documentai.v1.UndeployProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the undeploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.UndeployProcessorVersionRequest) + com.google.cloud.documentai.v1.UndeployProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionRequest build() { + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest result = + new com.google.cloud.documentai.v1.UndeployProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.UndeployProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.UndeployProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.UndeployProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.UndeployProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.UndeployProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionRequest(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.documentai.v1.UndeployProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..651afabbb93 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface UndeployProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.UndeployProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponse.java new file mode 100644 index 00000000000..898047d696e --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponse.java @@ -0,0 +1,467 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the undeploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionResponse} + */ +public final class UndeployProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.UndeployProcessorVersionResponse) + UndeployProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionResponse.newBuilder() to construct. + private UndeployProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1.UndeployProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse other = + (com.google.cloud.documentai.v1.UndeployProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse 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.documentai.v1.UndeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse 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.documentai.v1.UndeployProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse 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.documentai.v1.UndeployProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse 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.documentai.v1.UndeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse 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.documentai.v1.UndeployProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for the undeploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.UndeployProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.UndeployProcessorVersionResponse) + com.google.cloud.documentai.v1.UndeployProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionResponse build() { + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.UndeployProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse result = + new com.google.cloud.documentai.v1.UndeployProcessorVersionResponse(this); + 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.documentai.v1.UndeployProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.UndeployProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.UndeployProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.UndeployProcessorVersionResponse.getDefaultInstance()) + return this; + 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.documentai.v1.UndeployProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1.UndeployProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1.UndeployProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.UndeployProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.UndeployProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.UndeployProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.UndeployProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionResponse(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.documentai.v1.UndeployProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..48fa03e1a8f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/UndeployProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface UndeployProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.UndeployProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/barcode.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/barcode.proto new file mode 100644 index 00000000000..28e588d6c6e --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/barcode.proto @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai"; +option java_multiple_files = true; +option java_outer_classname = "BarcodeProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Encodes the detailed information of a barcode. +message Barcode { + // Format of a barcode. + // The supported formats are: + // CODE_128: Code 128 type. + // CODE_39: Code 39 type. + // CODE_93: Code 93 type. + // CODABAR: Codabar type. + // DATA_MATRIX: 2D Data Matrix type. + // ITF: ITF type. + // EAN_13: EAN-13 type. + // EAN_8: EAN-8 type. + // QR_CODE: 2D QR code type. + // UPC_A: UPC-A type. + // UPC_E: UPC-E type. + // PDF417: PDF417 type. + // AZTEC: 2D Aztec code type. + // DATABAR: GS1 DataBar code type. + string format = 1; + + // Value format describes the format of the value that a barcode + // encodes. + // The supported formats are: + // CONTACT_INFO: Contact information. + // EMAIL: Email address. + // ISBN: ISBN identifier. + // PHONE: Phone number. + // PRODUCT: Product. + // SMS: SMS message. + // TEXT: Text string. + // URL: URL address. + // WIFI: Wifi information. + // GEO: Geo-localization. + // CALENDAR_EVENT: Calendar event. + // DRIVER_LICENSE: Driver's license. + string value_format = 2; + + // Raw value encoded in the barcode. + // For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. + string raw_value = 3; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto index 4512affa5d2..d8bbf6b574d 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.documentai.v1; import "google/api/field_behavior.proto"; +import "google/cloud/documentai/v1/barcode.proto"; import "google/cloud/documentai/v1/geometry.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -34,11 +35,10 @@ option java_package = "com.google.cloud.documentai.v1"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; option ruby_package = "Google::Cloud::DocumentAI::V1"; -// Document represents the canonical document resource in Document Understanding -// AI. -// It is an interchange format that provides insights into documents and allows -// for collaboration between users and Document Understanding AI to iterate and -// optimize for quality. +// Document represents the canonical document resource in Document AI. It is an +// interchange format that provides insights into documents and allows for +// collaboration between users and Document AI to iterate and optimize for +// quality. message Document { // For a large document, sharding may be performed to produce several // document shards. Each document shard contains this field to detail which @@ -50,8 +50,7 @@ message Document { // Total number of shards. int64 shard_count = 2; - // The index of the first character in - // [Document.text][google.cloud.documentai.v1.Document.text] in the overall + // The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall // document global text. int64 text_offset = 3; } @@ -68,8 +67,7 @@ message Document { string unit = 2; } - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1; // Text color. @@ -166,31 +164,25 @@ message Document { PAGE_LEFT = 4; } - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1; - // Confidence of the current - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - // context of the object this layout is for. e.g. confidence can be for a - // single token, a table, a visual element, etc. depending on context. - // Range [0, 1]. + // Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this + // layout is for. e.g. confidence can be for a single token, a table, + // a visual element, etc. depending on context. Range [0, 1]. float confidence = 2; - // The bounding polygon for the - // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + // The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. BoundingPoly bounding_poly = 3; - // Detected orientation for the - // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + // Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. Orientation orientation = 4; } // A block has a set of lines (collected into paragraphs) that have a // common line-spacing and orientation. message Block { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Block][google.cloud.documentai.v1.Document.Page.Block]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. Layout layout = 1; // A list of detected languages together with confidence. @@ -202,8 +194,7 @@ message Document { // A collection of lines that a human would perceive as a paragraph. message Paragraph { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. Layout layout = 1; // A list of detected languages together with confidence. @@ -216,8 +207,7 @@ message Document { // A collection of tokens that a human would perceive as a line. // Does not cross column boundaries, can be horizontal, vertical, etc. message Line { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Line][google.cloud.documentai.v1.Document.Page.Line]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. Layout layout = 1; // A list of detected languages together with confidence. @@ -229,8 +219,7 @@ message Document { // A detected token. message Token { - // Detected break at the end of a - // [Token][google.cloud.documentai.v1.Document.Page.Token]. + // Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. message DetectedBreak { // Enum to denote the type of break found. enum Type { @@ -251,12 +240,10 @@ message Document { Type type = 1; } - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1.Document.Page.Token]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. Layout layout = 1; - // Detected break at the end of a - // [Token][google.cloud.documentai.v1.Document.Page.Token]. + // Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. DetectedBreak detected_break = 2; // A list of detected languages together with confidence. @@ -268,8 +255,7 @@ message Document { // A detected symbol. message Symbol { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. Layout layout = 1; // A list of detected languages together with confidence. @@ -279,12 +265,10 @@ message Document { // Detected non-text visual elements e.g. checkbox, signature etc. on the // page. message VisualElement { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. Layout layout = 1; - // Type of the - // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + // Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. string type = 2; // A list of detected languages together with confidence. @@ -301,8 +285,7 @@ message Document { // A cell representation inside the table. message TableCell { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. Layout layout = 1; // How many rows this cell spans. @@ -315,8 +298,7 @@ message Document { repeated DetectedLanguage detected_languages = 4; } - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Table][google.cloud.documentai.v1.Document.Page.Table]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. Layout layout = 1; // Header rows of the table. @@ -331,13 +313,11 @@ message Document { // A form field detected on the page. message FormField { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - // e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, + // `Grand total`, `Phone number`, etc. Layout field_name = 1; - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. Layout field_value = 2; // A list of detected languages for name together with confidence. @@ -353,10 +333,29 @@ message Document { // - "filled_checkbox" string value_type = 5; + // Created for Labeling UI to export key text. + // If corrections were made to the text identified by the + // `field_name.text_anchor`, this field will contain the correction. + string corrected_key_text = 6; + + // Created for Labeling UI to export value text. + // If corrections were made to the text identified by the + // `field_value.text_anchor`, this field will contain the correction. + string corrected_value_text = 7; + // The history of this annotation. Provenance provenance = 8; } + // A detected barcode. + message DetectedBarcode { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + Layout layout = 1; + + // Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + Barcode barcode = 2; + } + // Detected language for a structural component. message DetectedLanguage { // The BCP-47 language code, such as "en-US" or "sr-Latn". For more @@ -368,11 +367,9 @@ message Document { float confidence = 2; } - // 1-based index for current - // [Page][google.cloud.documentai.v1.Document.Page] in a parent - // [Document][google.cloud.documentai.v1.Document]. Useful when a page is - // taken out of a [Document][google.cloud.documentai.v1.Document] for - // individual processing. + // 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. + // Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual + // processing. int32 page_number = 1; // Rendered image for this page. This image is preprocessed to remove any @@ -422,6 +419,9 @@ message Document { // A list of visually detected symbols on the page. repeated Symbol symbols = 12; + // A list of detected barcodes. + repeated DetectedBarcode detected_barcodes = 15; + // The history of this page. Provenance provenance = 16; } @@ -456,6 +456,12 @@ message Document { // Boolean value. Can be used for entities with binary values, or for // checkboxes. bool boolean_value = 6; + + // Integer value. + int32 integer_value = 7; + + // Float value. + float float_value = 8; } // Optional. An optional field to store a normalized string. @@ -472,15 +478,14 @@ message Document { } // Optional. Provenance of the entity. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Entity type from a schema e.g. `Address`. string type = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If - // the entity is not present in the document, this field will be empty. + // Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity + // is not present in the document, this field will be empty. string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Deprecated. Use `id` field instead. @@ -489,35 +494,32 @@ message Document { // Optional. Confidence of detected Schema entity. Range [0, 1]. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Represents the provenance of this entity wrt. the location on - // the page where it was found. + // Optional. Represents the provenance of this entity wrt. the location on the + // page where it was found. PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Canonical id. This will be a unique value in the entity list // for this document. string id = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Normalized entity value. Absent if the extracted value could - // not be converted or the type (e.g. address) is not supported for certain + // Optional. Normalized entity value. Absent if the extracted value could not be + // converted or the type (e.g. address) is not supported for certain // parsers. This field is also only populated for certain supported document // types. - NormalizedValue normalized_value = 9 - [(google.api.field_behavior) = OPTIONAL]; + NormalizedValue normalized_value = 9 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Entities can be nested to form a hierarchical data structure - // representing the content in the document. + // Optional. Entities can be nested to form a hierarchical data structure representing + // the content in the document. repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. The history of this annotation. Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Whether the entity will be redacted for de-identification - // purposes. + // Optional. Whether the entity will be redacted for de-identification purposes. bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; } - // Relationship between - // [Entities][google.cloud.documentai.v1.Document.Entity]. + // Relationship between [Entities][google.cloud.documentai.v1.Document.Entity]. message EntityRelation { // Subject entity id. string subject_id = 1; @@ -529,28 +531,21 @@ message Document { string relation = 3; } - // Text reference indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // Text reference indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. message TextAnchor { - // A text segment in the - // [Document.text][google.cloud.documentai.v1.Document.text]. The indices - // may be out of bounds which indicate that the text extends into another - // document shard for large sharded documents. See - // [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] + // A text segment in the [Document.text][google.cloud.documentai.v1.Document.text]. The indices may be out of bounds + // which indicate that the text extends into another document shard for + // large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] message TextSegment { - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - // start UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. int64 start_index = 1; - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - // half open end UTF-8 char index in the + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the // [Document.text][google.cloud.documentai.v1.Document.text]. int64 end_index = 2; } - // The text segments from the - // [Document.text][google.cloud.documentai.v1.Document.text]. + // The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. repeated TextSegment text_segments = 1; // Contains the content of the text span so that users do @@ -559,10 +554,9 @@ message Document { string content = 2; } - // Referencing the visual context of the entity in the - // [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors - // can be cross-page, consist of multiple bounding polygons and optionally - // reference specific layout element types. + // Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1.Document.pages]. + // Page anchors can be cross-page, consist of multiple bounding polygons and + // optionally reference specific layout element types. message PageAnchor { // Represents a weak reference to a page element within a document. message PageRef { @@ -571,65 +565,47 @@ message Document { // Layout Unspecified. LAYOUT_TYPE_UNSPECIFIED = 0; - // References a - // [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] - // element. + // References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element. BLOCK = 1; - // References a - // [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] - // element. + // References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element. PARAGRAPH = 2; - // References a - // [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. + // References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. LINE = 3; - // References a - // [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] - // element. + // References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element. TOKEN = 4; - // References a - // [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] - // element. + // References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element. VISUAL_ELEMENT = 5; - // Refrrences a - // [Page.tables][google.cloud.documentai.v1.Document.Page.tables] - // element. + // Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element. TABLE = 6; - // References a - // [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] - // element. + // References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element. FORM_FIELD = 7; } - // Required. Index into the - // [Document.pages][google.cloud.documentai.v1.Document.pages] element, - // for example using [Document.pages][page_refs.page] to locate the - // related page element. This field is skipped when its value is the - // default 0. See + // Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using + // [Document.pages][page_refs.page] to locate the related page element. + // This field is skipped when its value is the default 0. See // https://developers.google.com/protocol-buffers/docs/proto3#json. int64 page = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The type of the layout element that is being referenced if - // any. + // Optional. The type of the layout element that is being referenced if any. LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Deprecated. Use - // [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - // instead. - string layout_id = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + // Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. + string layout_id = 3 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; - // Optional. Identifies the bounding polygon of a layout element on the - // page. + // Optional. Identifies the bounding polygon of a layout element on the page. BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Confidence of detected page element, if applicable. Range [0, - // 1]. + // Optional. Confidence of detected page element, if applicable. Range [0, 1]. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -723,7 +699,12 @@ message Document { // The revisions that this revision is based on. This can include one or // more parent (when documents are merged.) This field represents the // index into the `revisions` field. - repeated int32 parent = 2; + repeated int32 parent = 2 [deprecated = true]; + + // The revisions that this revision is based on. Must include all the ids + // that have anything to do with this revision - eg. there are + // `provenance.parent.revision` fields that index into this field. + repeated string parent_ids = 7; // The time that the revision was created. google.protobuf.Timestamp create_time = 3; @@ -735,9 +716,8 @@ message Document { // This message is used for text changes aka. OCR corrections. message TextChange { // Provenance of the correction. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. There can - // only be a single `TextAnchor.text_segments` element. If the start and + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a + // single `TextAnchor.text_segments` element. If the start and // end index of the text segment are the same, the text change is inserted // before that index. TextAnchor text_anchor = 1; @@ -772,24 +752,22 @@ message Document { // Optional. UTF-8 encoded text in reading order from the document. string text = 4 [(google.api.field_behavior) = OPTIONAL]; - // Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + // Placeholder. Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. repeated Style text_styles = 5; // Visual page layout for the [Document][google.cloud.documentai.v1.Document]. repeated Page pages = 6; - // A list of entities detected on - // [Document.text][google.cloud.documentai.v1.Document.text]. For document - // shards, entities in this list may cross shard boundaries. + // A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, + // entities in this list may cross shard boundaries. repeated Entity entities = 7; - // Relationship among - // [Document.entities][google.cloud.documentai.v1.Document.entities]. + // Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. repeated EntityRelation entity_relations = 8; - // A list of text corrections made to [Document.text]. This is usually - // used for annotating corrections to OCR mistakes. Text changes for a given - // revision may not overlap with each other. + // Placeholder. A list of text corrections made to [Document.text]. This is + // usually used for annotating corrections to OCR mistakes. Text changes for + // a given revision may not overlap with each other. repeated TextChange text_changes = 14; // Information about the sharding if this document is sharded part of a larger @@ -799,6 +777,6 @@ message Document { // Any error that occurred while processing this document. google.rpc.Status error = 10; - // Revision history of this document. + // Placeholder. Revision history of this document. repeated Revision revisions = 13; } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_io.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_io.proto index 281a379fab6..17630a03592 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_io.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_io.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto index d0c21feb2a3..9c944f259a0 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,8 +22,12 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/documentai/v1/document.proto"; import "google/cloud/documentai/v1/document_io.proto"; +import "google/cloud/documentai/v1/document_schema.proto"; import "google/cloud/documentai/v1/operation_metadata.proto"; +import "google/cloud/documentai/v1/processor.proto"; +import "google/cloud/documentai/v1/processor_type.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -34,18 +38,14 @@ option java_outer_classname = "DocumentAiProcessorService"; option java_package = "com.google.cloud.documentai.v1"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; option ruby_package = "Google::Cloud::DocumentAI::V1"; -option (google.api.resource_definition) = { - type: "documentai.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; -option (google.api.resource_definition) = { - type: "documentai.googleapis.com/Processor" - pattern: "projects/{project}/locations/{location}/processors/{processor}" -}; option (google.api.resource_definition) = { type: "documentai.googleapis.com/HumanReviewConfig" pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig" }; +option (google.api.resource_definition) = { + type: "documentai.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; // Service to call Cloud DocumentAI to process documents according to the // processor's definition. Processors are built using state-of-the-art Google @@ -60,6 +60,10 @@ service DocumentProcessorService { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*}:process" body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process" + body: "*" + } }; option (google.api.method_signature) = "name"; } @@ -70,6 +74,10 @@ service DocumentProcessorService { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess" body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess" + body: "*" + } }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { @@ -78,6 +86,155 @@ service DocumentProcessorService { }; } + // Fetches processor types. Note that we do not use ListProcessorTypes here + // because it is not paginated. + rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the processor types that exist. + rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/processorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all processors which belong to this project. + rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/processors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a processor detail. + rpc GetProcessor(GetProcessorRequest) returns (Processor) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a processor version detail. + rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all versions of a processor. + rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the processor version, all artifacts under the processor version + // will be deleted. + rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteProcessorVersionMetadata" + }; + } + + // Deploys the processor version. + rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeployProcessorVersionResponse" + metadata_type: "DeployProcessorVersionMetadata" + }; + } + + // Undeploys the processor version. + rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UndeployProcessorVersionResponse" + metadata_type: "UndeployProcessorVersionMetadata" + }; + } + + // Creates a processor from the type processor that the user chose. + // The processor will be at "ENABLED" state by default after its creation. + rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/processors" + body: "processor" + }; + option (google.api.method_signature) = "parent,processor"; + } + + // Deletes the processor, unloads all deployed model artifacts if it was + // enabled and then deletes all artifacts associated with this processor. + rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteProcessorMetadata" + }; + } + + // Enables a processor + rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:enable" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "EnableProcessorResponse" + metadata_type: "EnableProcessorMetadata" + }; + } + + // Disables a processor + rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:disable" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DisableProcessorResponse" + metadata_type: "DisableProcessorMetadata" + }; + } + + // Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "SetDefaultProcessorVersionResponse" + metadata_type: "SetDefaultProcessorVersionMetadata" + }; + } + // Send a document for Human Review. The input document should be processed by // the specified processor. rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { @@ -104,17 +261,25 @@ message ProcessRequest { RawDocument raw_document = 5; } - // Required. The processor resource name. + // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + // to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use + // its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: + // `projects/{project}/locations/{location}/processors/{processor}`, or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" + type: "*" } ]; // Whether Human Review feature should be skipped for this request. Default to // false. bool skip_human_review = 3; + + // Specifies which fields to include in ProcessResponse's document. + google.protobuf.FieldMask field_mask = 6; } // The status of human review on a processed document. @@ -165,11 +330,15 @@ message ProcessResponse { // Request message for batch process document method. message BatchProcessRequest { - // Required. The processor resource name. + // Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" + type: "*" } ]; @@ -199,10 +368,10 @@ message BatchProcessMetadata { // document during the process. string input_gcs_source = 1; - // The status of the processing of the document. + // The status processing the document. google.rpc.Status status = 2; - // The output_gcs_destination (in the request as 'output_gcs_destination') + // The output_gcs_destination (in the request as `output_gcs_destination`) // of the processed document if it was successful, otherwise empty. string output_gcs_destination = 3; @@ -251,10 +420,315 @@ message BatchProcessMetadata { repeated IndividualProcessStatus individual_process_statuses = 5; } +// Request message for fetch processor types. +message FetchProcessorTypesRequest { + // Required. The project of processor type to list. + // The available processor types may depend on the allow-listing on projects. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorType" + } + ]; +} + +// Response message for fetch processor types. +message FetchProcessorTypesResponse { + // The list of processor types. + repeated ProcessorType processor_types = 1; +} + +// Request message for list processor types. +message ListProcessorTypesRequest { + // Required. The location of processor type to list. + // The available processor types may depend on the allow-listing on projects. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorType" + } + ]; + + // The maximum number of processor types to return. + // If unspecified, at most 100 processor types will be returned. + // The maximum value is 500; values above 500 will be coerced to 500. + int32 page_size = 2; + + // Used to retrieve the next page of results, empty if at the end of the list. + string page_token = 3; +} + +// Response message for list processor types. +message ListProcessorTypesResponse { + // The processor types. + repeated ProcessorType processor_types = 1; + + // Points to the next page, otherwise empty. + string next_page_token = 2; +} + +// Request message for list all processors belongs to a project. +message ListProcessorsRequest { + // Required. The parent (project and location) which owns this collection of Processors. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/Processor" + } + ]; + + // The maximum number of processors to return. + // If unspecified, at most 50 processors will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // We will return the processors sorted by creation time. The page token + // will point to the next processor. + string page_token = 3; +} + +// Response message for list processors. +message ListProcessorsResponse { + // The list of processors. + repeated Processor processors = 1; + + // Points to the next processor, otherwise empty. + string next_page_token = 2; +} + +// Request message for get processor. +message GetProcessorRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Request message for get processor version. +message GetProcessorVersionRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Request message for list all processor versions belongs to a processor. +message ListProcessorVersionsRequest { + // Required. The parent (project, location and processor) to list all versions. + // Format: `projects/{project}/locations/{location}/processors/{processor}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // The maximum number of processor versions to return. + // If unspecified, at most 10 processor versions will be returned. + // The maximum value is 20; values above 20 will be coerced to 20. + int32 page_size = 2; + + // We will return the processor versions sorted by creation time. The page + // token will point to the next processor version. + string page_token = 3; +} + +// Response message for list processors. +message ListProcessorVersionsResponse { + // The list of processors. + repeated ProcessorVersion processor_versions = 1; + + // Points to the next processor, otherwise empty. + string next_page_token = 2; +} + +// Request message for the delete processor version method. +message DeleteProcessorVersionRequest { + // Required. The processor version resource name to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// The long running operation metadata for delete processor version method. +message DeleteProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the deploy processor version method. +message DeployProcessorVersionRequest { + // Required. The processor version resource name to be deployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the deploy processor version method. +message DeployProcessorVersionResponse { + +} + +// The long running operation metadata for deploy processor version method. +message DeployProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the undeploy processor version method. +message UndeployProcessorVersionRequest { + // Required. The processor version resource name to be undeployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the undeploy processor version method. +message UndeployProcessorVersionResponse { + +} + +// The long running operation metadata for the undeploy processor version +// method. +message UndeployProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for create a processor. Notice this request is sent to +// a regionalized backend service, and if the processor type is not available +// on that region, the creation will fail. +message CreateProcessorRequest { + // Required. The parent (project and location) under which to create the processor. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The processor to be created, requires [processor_type] and [display_name] + // to be set. Also, the processor is under CMEK if CMEK fields are set. + Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the delete processor method. +message DeleteProcessorRequest { + // Required. The processor resource name to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// The long running operation metadata for delete processor method. +message DeleteProcessorMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the enable processor method. +message EnableProcessorRequest { + // Required. The processor resource name to be enabled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Response message for the enable processor method. +// Intentionally empty proto for adding fields in future. +message EnableProcessorResponse { + +} + +// The long running operation metadata for enable processor method. +message EnableProcessorMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the disable processor method. +message DisableProcessorRequest { + // Required. The processor resource name to be disabled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Response message for the disable processor method. +// Intentionally empty proto for adding fields in future. +message DisableProcessorResponse { + +} + +// The long running operation metadata for disable processor method. +message DisableProcessorMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the set default processor version method. +message SetDefaultProcessorVersionRequest { + // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + string processor = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + string default_processor_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for set default processor version method. +message SetDefaultProcessorVersionResponse { + +} + +// The long running operation metadata for set default processor version +// method. +message SetDefaultProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + // Request message for review document method. message ReviewDocumentRequest { - reserved 2; - // The priority level of the human review task. enum Priority { // The default priority level. @@ -285,12 +759,34 @@ message ReviewDocumentRequest { // The priority of the human review task. Priority priority = 5; + + // The document schema of the human review task. + DocumentSchema document_schema = 6; } // Response message for review document method. message ReviewDocumentResponse { - // The Cloud Storage uri for the human reviewed document. + // Possible states of the review operation. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The review operation is rejected by the reviewer. + REJECTED = 1; + + // The review operation is succeeded. + SUCCEEDED = 2; + } + + // The Cloud Storage uri for the human reviewed document if the review is + // succeeded. string gcs_destination = 1; + + // The state of the review operation. + State state = 2; + + // The reason why the review is rejected by reviewer. + string rejection_reason = 3; } // The long running operation metadata for review document method. @@ -298,6 +794,6 @@ message ReviewDocumentOperationMetadata { // The basic metadata of the long running operation. CommonOperationMetadata common_metadata = 5; - // The question ID. + // The Crowd Compute question ID. string question_id = 6; } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto new file mode 100644 index 00000000000..24bd42285d9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto @@ -0,0 +1,140 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiDocumentSchema"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// The schema defines the output of the processed document by a processor. +message DocumentSchema { + // EntityType is the wrapper of a label of the corresponding model with + // detailed attributes and limitations for entity-based processors. Multiple + // types can also compose a dependency tree to represent nested types. + message EntityType { + // Defines the a list of enum values. + message EnumValues { + // The individual values that this enum values type can include. + repeated string values = 1; + } + + // Defines properties that can be part of the entity type. + message Property { + // Types of occurrences of the entity type in the document. Note: this + // represents the number of instances of an entity types, not number of + // mentions of a given entity instance. + enum OccurrenceType { + // Unspecified occurrence type. + OCCURRENCE_TYPE_UNSPECIFIED = 0; + + // There will be zero or one instance of this entity type. + OPTIONAL_ONCE = 1; + + // The entity type will appear zero or multiple times. + OPTIONAL_MULTIPLE = 2; + + // The entity type will only appear exactly once. + REQUIRED_ONCE = 3; + + // The entity type will appear once or more times. + REQUIRED_MULTIPLE = 4; + } + + // The name of the property. Follows the same guidelines as the + // EntityType name. + string name = 1; + + // A reference to the value type of the property. This type is subject + // to the same conventions as the `Entity.base_types` field. + string value_type = 2; + + // Occurrence type limits the number of instances an entity type appears + // in the document. + OccurrenceType occurrence_type = 3; + } + + oneof value_source { + // If specified, lists all the possible values for this entity. This + // should not be more than a handful of values. If the number of values + // is >10 or could change frequently use the `EntityType.value_ontology` + // field and specify a list of all possible values in a value ontology + // file. + EnumValues enum_values = 14; + } + + // User defined name for the type. + string display_name = 13; + + // Name of the type. It must be unique within the schema file and + // cannot be a 'Common Type'. Besides that we use the following naming + // conventions: + // - *use snake_casing* + // - name matching is case-insensitive + // - Maximum 64 characters. + // - Must start with a letter. + // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + // compatibility internal infrastructure and tooling can handle any ascii + // character) + // - The '/' is sometimes used to denote a property of a type. For example + // line_item/amount. This convention is deprecated, but will still be + // honored for backward compatibility. + string name = 1; + + // The entity type that this type is derived from. For now, one and only + // one should be set. + repeated string base_types = 2; + + // Describing the nested structure, or composition of an entity. + repeated Property properties = 6; + } + + // Metadata for global schema behavior. + message Metadata { + // If true, a `document` entity type can be applied to subdocument ( + // splitting). Otherwise, it can only be applied to the entire document + // (classification). + bool document_splitter = 1; + + // If true, on a given page, there can be multiple `document` annotations + // covering it. + bool document_allow_multiple_labels = 2; + + // If set, all the nested entities must be prefixed with the parents. + bool prefixed_naming_on_properties = 6; + + // If set, we will skip the naming format validation in the schema. So the + // string values in `DocumentSchema.EntityType.name` and + // `DocumentSchema.EntityType.Property.name` will not be checked. + bool skip_naming_validation = 7; + } + + // Display name to show to users. + string display_name = 1; + + // Description of the schema. + string description = 2; + + // Entity types of the schema. + repeated EntityType entity_types = 3; + + // Metadata of the schema. + Metadata metadata = 4; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/geometry.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/geometry.proto index 6f83ee7beb0..7471ef01247 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/geometry.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/operation_metadata.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/operation_metadata.proto index 773222439ed..5698b0a4f3c 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/operation_metadata.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/operation_metadata.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -55,6 +55,9 @@ message CommonOperationMetadata { // A message providing more details about the current state of processing. string state_message = 2; + // A related resource to this operation. + string resource = 5; + // The creation time of the operation. google.protobuf.Timestamp create_time = 3; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto new file mode 100644 index 00000000000..b7eb95ef3f5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto @@ -0,0 +1,185 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessor"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// A processor version is an implementation of a processor. Each processor +// can have multiple versions, pre-trained by Google internally or up-trained +// by the customer. At a time, a processor can only have one default version +// version. So the processor's behavior (when processing documents) is defined +// by a default version +message ProcessorVersion { + option (google.api.resource) = { + type: "documentai.googleapis.com/ProcessorVersion" + pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" + }; + + // Information about the upcoming deprecation of this processor version. + message DeprecationInfo { + // The time at which this processor version will be deprecated. + google.protobuf.Timestamp deprecation_time = 1; + + // If set, the processor version that will be used as a replacement. + string replacement_processor_version = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + } + + // The possible states of the processor version. + enum State { + // The processor version is in an unspecified state. + STATE_UNSPECIFIED = 0; + + // The processor version is deployed and can be used for processing. + DEPLOYED = 1; + + // The processor version is being deployed. + DEPLOYING = 2; + + // The processor version is not deployed and cannot be used for processing. + UNDEPLOYED = 3; + + // The processor version is being undeployed. + UNDEPLOYING = 4; + + // The processor version is being created. + CREATING = 5; + + // The processor version is being deleted. + DELETING = 6; + + // The processor version failed and is in an indeterminate state. + FAILED = 7; + } + + // The resource name of the processor version. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + string name = 1; + + // The display name of the processor version. + string display_name = 2; + + // The state of the processor version. + State state = 6; + + // The time the processor version was created. + google.protobuf.Timestamp create_time = 7; + + // The KMS key name used for encryption. + string kms_key_name = 9; + + // The KMS key version with which data is encrypted. + string kms_key_version_name = 10; + + // Denotes that this ProcessorVersion is managed by google. + bool google_managed = 11; + + // If set, information about the eventual deprecation of this version. + DeprecationInfo deprecation_info = 13; +} + +// The first-class citizen for Document AI. Each processor defines how to +// extract structural information from a document. +message Processor { + option (google.api.resource) = { + type: "documentai.googleapis.com/Processor" + pattern: "projects/{project}/locations/{location}/processors/{processor}" + }; + + // The possible states of the processor. + enum State { + // The processor is in an unspecified state. + STATE_UNSPECIFIED = 0; + + // The processor is enabled, i.e., has an enabled version which can + // currently serve processing requests and all the feature dependencies have + // been successfully initialized. + ENABLED = 1; + + // The processor is disabled. + DISABLED = 2; + + // The processor is being enabled, will become ENABLED if successful. + ENABLING = 3; + + // The processor is being disabled, will become DISABLED if successful. + DISABLING = 4; + + // The processor is being created, will become either ENABLED (for + // successful creation) or FAILED (for failed ones). + // Once a processor is in this state, it can then be used for document + // processing, but the feature dependencies of the processor might not be + // fully created yet. + CREATING = 5; + + // The processor failed during creation or initialization of feature + // dependencies. The user should delete the processor and recreate one as + // all the functionalities of the processor are disabled. + FAILED = 6; + + // The processor is being deleted, will be removed if successful. + DELETING = 7; + } + + // Output only. Immutable. The resource name of the processor. + // Format: `projects/{project}/locations/{location}/processors/{processor}` + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc. + // To get a list of processors types, see + // [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + string type = 2; + + // The display name of the processor. + string display_name = 3; + + // Output only. The state of the processor. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default processor version. + string default_processor_version = 9 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + + // Output only. Immutable. The http endpoint that can be called to invoke processing. + string process_endpoint = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The time the processor was created. + google.protobuf.Timestamp create_time = 7; + + // The KMS key used for encryption/decryption in CMEK scenarios. + // See https://cloud.google.com/security-key-management. + string kms_key_name = 8; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor_type.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor_type.proto new file mode 100644 index 00000000000..dd5ef470011 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor_type.proto @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1; + +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorType"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// A processor type is responsible for performing a certain document +// understanding task on a certain type of document. +message ProcessorType { + option (google.api.resource) = { + type: "documentai.googleapis.com/ProcessorType" + pattern: "projects/{project}/locations/{location}/processorTypes/{processor_type}" + }; + + // The location information about where the processor is available. + message LocationInfo { + // The location id, currently must be one of [us, eu]. + string location_id = 1; + } + + // The resource name of the processor type. + // Format: projects/{project}/processorTypes/{processor_type} + string name = 1; + + // The type of the processor, e.g., "invoice_parsing". + string type = 2; + + // The processor category, used by UI to group processor types. + string category = 3; + + // The locations in which this processor is available. + repeated LocationInfo available_locations = 4; + + // Whether the processor type allows creation. If true, users can create a + // processor of this processor type. Otherwise, users need to request access. + bool allow_creation = 6; + + // Launch stage of the processor type + google.api.LaunchStage launch_stage = 8; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Barcode.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Barcode.java new file mode 100644 index 00000000000..b9bd0566e65 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Barcode.java @@ -0,0 +1,1204 @@ +/* + * 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/documentai/v1beta3/barcode.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Encodes the detailed information of a barcode.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Barcode} + */ +public final class Barcode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Barcode) + BarcodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Barcode.newBuilder() to construct. + private Barcode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Barcode() { + format_ = ""; + valueFormat_ = ""; + rawValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Barcode(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Barcode( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + valueFormat_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + rawValue_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.BarcodeProto + .internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.BarcodeProto + .internal_static_google_cloud_documentai_v1beta3_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Barcode.class, + com.google.cloud.documentai.v1beta3.Barcode.Builder.class); + } + + public static final int FORMAT_FIELD_NUMBER = 1; + private volatile java.lang.Object format_; + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + @java.lang.Override + public java.lang.String getFormat() { + java.lang.Object ref = format_; + 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(); + format_ = s; + return s; + } + } + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FORMAT_FIELD_NUMBER = 2; + private volatile java.lang.Object valueFormat_; + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + @java.lang.Override + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + 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(); + valueFormat_ = s; + return s; + } + } + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAW_VALUE_FIELD_NUMBER = 3; + private volatile java.lang.Object rawValue_; + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + @java.lang.Override + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + 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(); + rawValue_ = s; + return s; + } + } + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rawValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rawValue_); + } + 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.documentai.v1beta3.Barcode)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.Barcode other = + (com.google.cloud.documentai.v1beta3.Barcode) obj; + + if (!getFormat().equals(other.getFormat())) return false; + if (!getValueFormat().equals(other.getValueFormat())) return false; + if (!getRawValue().equals(other.getRawValue())) 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) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + VALUE_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getValueFormat().hashCode(); + hash = (37 * hash) + RAW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRawValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.Barcode parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Barcode 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.documentai.v1beta3.Barcode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Barcode 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.documentai.v1beta3.Barcode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Barcode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.Barcode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Barcode 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.documentai.v1beta3.Barcode parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Barcode 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.documentai.v1beta3.Barcode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Barcode 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.documentai.v1beta3.Barcode 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; + } + /** + * + * + *
+   * Encodes the detailed information of a barcode.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Barcode} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Barcode) + com.google.cloud.documentai.v1beta3.BarcodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.BarcodeProto + .internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.BarcodeProto + .internal_static_google_cloud_documentai_v1beta3_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Barcode.class, + com.google.cloud.documentai.v1beta3.Barcode.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.Barcode.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(); + format_ = ""; + + valueFormat_ = ""; + + rawValue_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.BarcodeProto + .internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Barcode getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.Barcode.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Barcode build() { + com.google.cloud.documentai.v1beta3.Barcode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Barcode buildPartial() { + com.google.cloud.documentai.v1beta3.Barcode result = + new com.google.cloud.documentai.v1beta3.Barcode(this); + result.format_ = format_; + result.valueFormat_ = valueFormat_; + result.rawValue_ = rawValue_; + 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.documentai.v1beta3.Barcode) { + return mergeFrom((com.google.cloud.documentai.v1beta3.Barcode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Barcode other) { + if (other == com.google.cloud.documentai.v1beta3.Barcode.getDefaultInstance()) return this; + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (!other.getValueFormat().isEmpty()) { + valueFormat_ = other.valueFormat_; + onChanged(); + } + if (!other.getRawValue().isEmpty()) { + rawValue_ = other.rawValue_; + 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.documentai.v1beta3.Barcode parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1beta3.Barcode) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object format_ = ""; + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The format. + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *   CODE_128: Code 128 type.
+     *   CODE_39: Code 39 type.
+     *   CODE_93: Code 93 type.
+     *   CODABAR: Codabar type.
+     *   DATA_MATRIX: 2D Data Matrix type.
+     *   ITF: ITF type.
+     *   EAN_13: EAN-13 type.
+     *   EAN_8: EAN-8 type.
+     *   QR_CODE: 2D QR code type.
+     *   UPC_A: UPC-A type.
+     *   UPC_E: UPC-E type.
+     *   PDF417: PDF417 type.
+     *   AZTEC: 2D Aztec code type.
+     *   DATABAR: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The bytes for format to set. + * @return This builder for chaining. + */ + public Builder setFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private java.lang.Object valueFormat_ = ""; + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueFormat_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueFormat_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return This builder for chaining. + */ + public Builder clearValueFormat() { + + valueFormat_ = getDefaultInstance().getValueFormat(); + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *   CONTACT_INFO: Contact information.
+     *   EMAIL: Email address.
+     *   ISBN: ISBN identifier.
+     *   PHONE: Phone number.
+     *   PRODUCT: Product.
+     *   SMS: SMS message.
+     *   TEXT: Text string.
+     *   URL: URL address.
+     *   WIFI: Wifi information.
+     *   GEO: Geo-localization.
+     *   CALENDAR_EVENT: Calendar event.
+     *   DRIVER_LICENSE: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The bytes for valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueFormat_ = value; + onChanged(); + return this; + } + + private java.lang.Object rawValue_ = ""; + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @param value The rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rawValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearRawValue() { + + rawValue_ = getDefaultInstance().getRawValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+     * 
+ * + * string raw_value = 3; + * + * @param value The bytes for rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rawValue_ = 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.documentai.v1beta3.Barcode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Barcode) + private static final com.google.cloud.documentai.v1beta3.Barcode DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Barcode(); + } + + public static com.google.cloud.documentai.v1beta3.Barcode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Barcode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Barcode(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.documentai.v1beta3.Barcode getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeOrBuilder.java new file mode 100644 index 00000000000..89bd490c913 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeOrBuilder.java @@ -0,0 +1,160 @@ +/* + * 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/documentai/v1beta3/barcode.proto + +package com.google.cloud.documentai.v1beta3; + +public interface BarcodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Barcode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + java.lang.String getFormat(); + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *   CODE_128: Code 128 type.
+   *   CODE_39: Code 39 type.
+   *   CODE_93: Code 93 type.
+   *   CODABAR: Codabar type.
+   *   DATA_MATRIX: 2D Data Matrix type.
+   *   ITF: ITF type.
+   *   EAN_13: EAN-13 type.
+   *   EAN_8: EAN-8 type.
+   *   QR_CODE: 2D QR code type.
+   *   UPC_A: UPC-A type.
+   *   UPC_E: UPC-E type.
+   *   PDF417: PDF417 type.
+   *   AZTEC: 2D Aztec code type.
+   *   DATABAR: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + com.google.protobuf.ByteString getFormatBytes(); + + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + java.lang.String getValueFormat(); + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *   CONTACT_INFO: Contact information.
+   *   EMAIL: Email address.
+   *   ISBN: ISBN identifier.
+   *   PHONE: Phone number.
+   *   PRODUCT: Product.
+   *   SMS: SMS message.
+   *   TEXT: Text string.
+   *   URL: URL address.
+   *   WIFI: Wifi information.
+   *   GEO: Geo-localization.
+   *   CALENDAR_EVENT: Calendar event.
+   *   DRIVER_LICENSE: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + com.google.protobuf.ByteString getValueFormatBytes(); + + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + java.lang.String getRawValue(); + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + com.google.protobuf.ByteString getRawValueBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeProto.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeProto.java new file mode 100644 index 00000000000..0fd83ea0b7c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BarcodeProto.java @@ -0,0 +1,68 @@ +/* + * 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/documentai/v1beta3/barcode.proto + +package com.google.cloud.documentai.v1beta3; + +public final class BarcodeProto { + private BarcodeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_Barcode_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/documentai/v1beta3/barcod" + + "e.proto\022\037google.cloud.documentai.v1beta3" + + "\"B\n\007Barcode\022\016\n\006format\030\001 \001(\t\022\024\n\014value_for" + + "mat\030\002 \001(\t\022\021\n\traw_value\030\003 \001(\tB\351\001\n#com.goo" + + "gle.cloud.documentai.v1beta3B\014BarcodePro" + + "toP\001ZIgoogle.golang.org/genproto/googlea" + + "pis/cloud/documentai/v1beta3;documentai\252" + + "\002\037Google.Cloud.DocumentAI.V1Beta3\312\002\037Goog" + + "le\\Cloud\\DocumentAI\\V1beta3\352\002\"Google::Cl" + + "oud::DocumentAI::V1beta3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1beta3_Barcode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_Barcode_descriptor, + new java.lang.String[] { + "Format", "ValueFormat", "RawValue", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessMetadata.java index 42013b2bb15..e7cd32dbe20 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessMetadata.java @@ -460,7 +460,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -472,7 +472,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -484,7 +484,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -495,7 +495,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -508,7 +508,7 @@ public interface IndividualProcessStatusOrBuilder * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -532,7 +532,7 @@ public interface IndividualProcessStatusOrBuilder * * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation - * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The humanReviewOperation. */ @java.lang.Deprecated @@ -551,7 +551,7 @@ public interface IndividualProcessStatusOrBuilder * * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation - * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The bytes for humanReviewOperation. */ @java.lang.Deprecated @@ -798,7 +798,7 @@ public com.google.protobuf.ByteString getInputGcsSourceBytes() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -813,7 +813,7 @@ public boolean hasStatus() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -828,7 +828,7 @@ public com.google.rpc.Status getStatus() { * * *
-     * The status of the processing of the document.
+     * The status processing the document.
      * 
* * .google.rpc.Status status = 2; @@ -844,7 +844,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -868,7 +868,7 @@ public java.lang.String getOutputGcsDestination() { * * *
-     * The output_gcs_destination (in the request as 'output_gcs_destination')
+     * The output_gcs_destination (in the request as `output_gcs_destination`)
      * of the processed document if it was successful, otherwise empty.
      * 
* @@ -905,7 +905,7 @@ public com.google.protobuf.ByteString getOutputGcsDestinationBytes() { * * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation - * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The humanReviewOperation. */ @java.lang.Override @@ -935,7 +935,7 @@ public java.lang.String getHumanReviewOperation() { * * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation - * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * is deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The bytes for humanReviewOperation. */ @java.lang.Override @@ -1568,7 +1568,7 @@ public Builder setInputGcsSourceBytes(com.google.protobuf.ByteString value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1582,7 +1582,7 @@ public boolean hasStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1600,7 +1600,7 @@ public com.google.rpc.Status getStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1622,7 +1622,7 @@ public Builder setStatus(com.google.rpc.Status value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1641,7 +1641,7 @@ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1664,7 +1664,7 @@ public Builder mergeStatus(com.google.rpc.Status value) { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1684,7 +1684,7 @@ public Builder clearStatus() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1698,7 +1698,7 @@ public com.google.rpc.Status.Builder getStatusBuilder() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1714,7 +1714,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-       * The status of the processing of the document.
+       * The status processing the document.
        * 
* * .google.rpc.Status status = 2; @@ -1738,7 +1738,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1761,7 +1761,7 @@ public java.lang.String getOutputGcsDestination() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1784,7 +1784,7 @@ public com.google.protobuf.ByteString getOutputGcsDestinationBytes() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1806,7 +1806,7 @@ public Builder setOutputGcsDestination(java.lang.String value) { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1824,7 +1824,7 @@ public Builder clearOutputGcsDestination() { * * *
-       * The output_gcs_destination (in the request as 'output_gcs_destination')
+       * The output_gcs_destination (in the request as `output_gcs_destination`)
        * of the processed document if it was successful, otherwise empty.
        * 
* @@ -1860,7 +1860,7 @@ public Builder setOutputGcsDestinationBytes(com.google.protobuf.ByteString value * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation * is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The humanReviewOperation. */ @java.lang.Deprecated @@ -1890,7 +1890,7 @@ public java.lang.String getHumanReviewOperation() { * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation * is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return The bytes for humanReviewOperation. */ @java.lang.Deprecated @@ -1920,7 +1920,7 @@ public com.google.protobuf.ByteString getHumanReviewOperationBytes() { * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation * is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @param value The humanReviewOperation to set. * @return This builder for chaining. */ @@ -1949,7 +1949,7 @@ public Builder setHumanReviewOperation(java.lang.String value) { * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation * is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1974,7 +1974,7 @@ public Builder clearHumanReviewOperation() { * @deprecated * google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.human_review_operation * is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=315 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=417 * @param value The bytes for humanReviewOperation to set. * @return This builder for chaining. */ diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequest.java index 9183f829b9a..535756ea87a 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequest.java @@ -1782,7 +1782,11 @@ public com.google.protobuf.Parser getParserForType() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -1807,7 +1811,11 @@ public java.lang.String getName() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -1933,7 +1941,7 @@ public com.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig * * * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return Whether the outputConfig field is set. */ @java.lang.Override @@ -1953,7 +1961,7 @@ public boolean hasOutputConfig() { *
* * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return The outputConfig. */ @java.lang.Override @@ -2582,7 +2590,11 @@ public Builder mergeFrom( * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -2606,7 +2618,11 @@ public java.lang.String getName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -2630,7 +2646,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -2653,7 +2673,11 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -2672,7 +2696,11 @@ public Builder clearName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -3142,7 +3170,7 @@ public Builder removeInputConfigs(int index) { * * * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return Whether the outputConfig field is set. */ @java.lang.Deprecated @@ -3161,7 +3189,7 @@ public boolean hasOutputConfig() { *
* * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return The outputConfig. */ @java.lang.Deprecated diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequestOrBuilder.java index 0db0dbde18c..85de93de517 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/BatchProcessRequestOrBuilder.java @@ -27,7 +27,11 @@ public interface BatchProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -41,7 +45,11 @@ public interface BatchProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -136,7 +144,7 @@ com.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig getInpu * * * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return Whether the outputConfig field is set. */ @java.lang.Deprecated @@ -153,7 +161,7 @@ com.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig getInpu *
* * @deprecated google.cloud.documentai.v1beta3.BatchProcessRequest.output_config is deprecated. - * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=276 + * See google/cloud/documentai/v1beta3/document_processor_service.proto;l=378 * @return The outputConfig. */ @java.lang.Deprecated diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadata.java index 058ba1c4461..771b396c567 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadata.java @@ -40,6 +40,7 @@ private CommonOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder + * A related resource to this operation. + * + * + * string resource = 5; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + 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(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int CREATE_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp createTime_; /** @@ -583,6 +640,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateTime_ != null) { output.writeMessage(4, getUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resource_); + } unknownFields.writeTo(output); } @@ -606,6 +666,9 @@ public int getSerializedSize() { if (updateTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resource_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -624,6 +687,7 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (!getStateMessage().equals(other.getStateMessage())) return false; + if (!getResource().equals(other.getResource())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -647,6 +711,8 @@ public int hashCode() { hash = (53 * hash) + state_; hash = (37 * hash) + STATE_MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getStateMessage().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -805,6 +871,8 @@ public Builder clear() { stateMessage_ = ""; + resource_ = ""; + if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -846,6 +914,7 @@ public com.google.cloud.documentai.v1beta3.CommonOperationMetadata buildPartial( new com.google.cloud.documentai.v1beta3.CommonOperationMetadata(this); result.state_ = state_; result.stateMessage_ = stateMessage_; + result.resource_ = resource_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -913,6 +982,10 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.CommonOperationMeta stateMessage_ = other.stateMessage_; onChanged(); } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -1149,6 +1222,112 @@ public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadataOrBuilder.java index 1bfd2435f4e..55c66acea73 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadataOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CommonOperationMetadataOrBuilder.java @@ -73,6 +73,31 @@ public interface CommonOperationMetadataOrBuilder */ com.google.protobuf.ByteString getStateMessageBytes(); + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + /** * * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java index 377856b9ef9..6f8873f6af3 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java @@ -138,7 +138,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The parent (project and location) under which to create the processor.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -164,7 +164,7 @@ public java.lang.String getParent() { * *
    * Required. The parent (project and location) under which to create the processor.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -598,7 +598,7 @@ public Builder mergeFrom( * *
      * Required. The parent (project and location) under which to create the processor.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -623,7 +623,7 @@ public java.lang.String getParent() { * *
      * Required. The parent (project and location) under which to create the processor.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -648,7 +648,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The parent (project and location) under which to create the processor.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -672,7 +672,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The parent (project and location) under which to create the processor.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -692,7 +692,7 @@ public Builder clearParent() { * *
      * Required. The parent (project and location) under which to create the processor.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java index b6447d19262..5e4aee48e01 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateProcessorRequestOrBuilder * *
    * Required. The parent (project and location) under which to create the processor.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -43,7 +43,7 @@ public interface CreateProcessorRequestOrBuilder * *
    * Required. The parent (project and location) under which to create the processor.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadata.java new file mode 100644 index 00000000000..3e951ae10c9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadata.java @@ -0,0 +1,756 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for delete processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} + */ +public final class DeleteProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + DeleteProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionMetadata.newBuilder() to construct. + private DeleteProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorVersionMetadata( + 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.documentai.v1beta3.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1beta3.DeleteProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata other = + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata 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.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata 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.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata 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.documentai.v1beta3.DeleteProcessorVersionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + 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.documentai.v1beta3.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata 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.documentai.v1beta3.DeleteProcessorVersionMetadata 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 long running operation metadata for delete processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata build() { + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata result = + new com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1beta3.DeleteProcessorVersionMetadata) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + .getDefaultInstance()) return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1beta3.DeleteProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.newBuilder( + commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1beta3.DeleteProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorVersionMetadata(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.documentai.v1beta3.DeleteProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..efa884e3fe2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeleteProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequest.java new file mode 100644 index 00000000000..37f2e7e63ce --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequest.java @@ -0,0 +1,662 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for the delete processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} + */ +public final class DeleteProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + DeleteProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionRequest.newBuilder() to construct. + private DeleteProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest other = + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest 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.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest 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.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest 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.documentai.v1beta3.DeleteProcessorVersionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + 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.documentai.v1beta3.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest 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.documentai.v1beta3.DeleteProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the delete processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest build() { + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest result = + new com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + private static final com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProcessorVersionRequest(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.documentai.v1beta3.DeleteProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..40ab438e906 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeleteProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadata.java new file mode 100644 index 00000000000..06b78c4aa8d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadata.java @@ -0,0 +1,756 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} + */ +public final class DeployProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + DeployProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionMetadata.newBuilder() to construct. + private DeployProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionMetadata( + 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.documentai.v1beta3.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1beta3.DeployProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata other = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata 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.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata 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.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata 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.documentai.v1beta3.DeployProcessorVersionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + 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.documentai.v1beta3.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata 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.documentai.v1beta3.DeployProcessorVersionMetadata 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 long running operation metadata for deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata build() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata result = + new com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1beta3.DeployProcessorVersionMetadata) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + .getDefaultInstance()) return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1beta3.DeployProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.newBuilder( + commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1beta3.DeployProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionMetadata(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.documentai.v1beta3.DeployProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..966cb159ec9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeployProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequest.java new file mode 100644 index 00000000000..0aaf79e14b1 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequest.java @@ -0,0 +1,662 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for the deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} + */ +public final class DeployProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + DeployProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionRequest.newBuilder() to construct. + private DeployProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest other = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest 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.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest 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.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest 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.documentai.v1beta3.DeployProcessorVersionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + 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.documentai.v1beta3.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest 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.documentai.v1beta3.DeployProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest build() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest result = + new com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + private static final com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionRequest(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.documentai.v1beta3.DeployProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..1f227a61e14 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeployProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponse.java new file mode 100644 index 00000000000..6403054eafd --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponse.java @@ -0,0 +1,471 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Response message for the deploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} + */ +public final class DeployProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + DeployProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionResponse.newBuilder() to construct. + private DeployProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1beta3.DeployProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse other = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse 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.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse 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.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse 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.documentai.v1beta3.DeployProcessorVersionResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + 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.documentai.v1beta3.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse 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.documentai.v1beta3.DeployProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for the deploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse build() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse result = + new com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse(this); + 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.documentai.v1beta3.DeployProcessorVersionResponse) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + .getDefaultInstance()) return this; + 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.documentai.v1beta3.DeployProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1beta3.DeployProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + private static final com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployProcessorVersionResponse(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.documentai.v1beta3.DeployProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..a37dfd116b2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeployProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeployProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java index dec028e9f2d..fcaceb3ae5f 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java @@ -23,6 +23,7 @@ * *
  * Response message for the disable processor method.
+ * Intentionally empty proto for adding fields in future.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorResponse} @@ -260,6 +261,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Response message for the disable processor method.
+   * Intentionally empty proto for adding fields in future.
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorResponse} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java index b66fd9abfa7..a3339fce9fb 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java @@ -22,11 +22,10 @@ * * *
- * Document represents the canonical document resource in Document Understanding
- * AI.
- * It is an interchange format that provides insights into documents and allows
- * for collaboration between users and Document Understanding AI to iterate and
- * optimize for quality.
+ * Document represents the canonical document resource in Document AI. It is an
+ * interchange format that provides insights into documents and allows for
+ * collaboration between users and Document AI to iterate and optimize for
+ * quality.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document} @@ -310,9 +309,8 @@ public interface ShardInfoOrBuilder * * *
-     * The index of the first character in
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
-     * overall document global text.
+     * The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall
+     * document global text.
      * 
* * int64 text_offset = 3; @@ -466,9 +464,8 @@ public long getShardCount() { * * *
-     * The index of the first character in
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
-     * overall document global text.
+     * The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall
+     * document global text.
      * 
* * int64 text_offset = 3; @@ -943,9 +940,8 @@ public Builder clearShardCount() { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
-       * overall document global text.
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall
+       * document global text.
        * 
* * int64 text_offset = 3; @@ -960,9 +956,8 @@ public long getTextOffset() { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
-       * overall document global text.
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall
+       * document global text.
        * 
* * int64 text_offset = 3; @@ -980,9 +975,8 @@ public Builder setTextOffset(long value) { * * *
-       * The index of the first character in
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
-       * overall document global text.
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall
+       * document global text.
        * 
* * int64 text_offset = 3; @@ -1057,8 +1051,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -1070,8 +1063,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -1083,8 +1075,7 @@ public interface StyleOrBuilder * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -2228,8 +2219,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -2244,8 +2234,7 @@ public boolean hasTextAnchor() { * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -2262,8 +2251,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * * *
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3049,8 +3037,7 @@ public Builder mergeFrom( * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3064,8 +3051,7 @@ public boolean hasTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3085,8 +3071,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3108,8 +3093,7 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1beta3.Document.TextAn * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3129,8 +3113,7 @@ public Builder setTextAnchor( * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3157,8 +3140,7 @@ public Builder mergeTextAnchor( * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3178,8 +3160,7 @@ public Builder clearTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3194,8 +3175,7 @@ public Builder clearTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -3214,8 +3194,7 @@ public Builder clearTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -4178,11 +4157,9 @@ public interface PageOrBuilder * * *
-     * 1-based index for current
-     * [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent
-     * [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page
-     * is taken out of a [Document][google.cloud.documentai.v1beta3.Document]
-     * for individual processing.
+     * 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
+     * Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
+     * processing.
      * 
* * int32 page_number = 1; @@ -4237,8 +4214,7 @@ public interface PageOrBuilder * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -4249,8 +4225,7 @@ public interface PageOrBuilder * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -4261,8 +4236,7 @@ public interface PageOrBuilder * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -4273,8 +4247,7 @@ public interface PageOrBuilder * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -4286,8 +4259,7 @@ public interface PageOrBuilder * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -4334,8 +4306,7 @@ com.google.cloud.documentai.v1beta3.Document.Page.MatrixOrBuilder getTransformsO * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -4347,8 +4318,7 @@ com.google.cloud.documentai.v1beta3.Document.Page.MatrixOrBuilder getTransformsO * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -4360,8 +4330,7 @@ com.google.cloud.documentai.v1beta3.Document.Page.MatrixOrBuilder getTransformsO * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -4901,6 +4870,72 @@ com.google.cloud.documentai.v1beta3.Document.Page.FormFieldOrBuilder getFormFiel com.google.cloud.documentai.v1beta3.Document.Page.SymbolOrBuilder getSymbolsOrBuilder( int index); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + java.util.List + getDetectedBarcodesList(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode getDetectedBarcodes( + int index); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + int getDetectedBarcodesCount(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + java.util.List< + ? extends com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesOrBuilderList(); + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index); + /** * * @@ -4966,6 +5001,7 @@ private Page() { tables_ = java.util.Collections.emptyList(); formFields_ = java.util.Collections.emptyList(); symbols_ = java.util.Collections.emptyList(); + detectedBarcodes_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -5195,6 +5231,20 @@ private Page( extensionRegistry)); break; } + case 122: + { + if (!((mutable_bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode>(); + mutable_bitField0_ |= 0x00000400; + } + detectedBarcodes_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.parser(), + extensionRegistry)); + break; + } case 130: { com.google.cloud.documentai.v1beta3.Document.Provenance.Builder subBuilder = null; @@ -5258,6 +5308,9 @@ private Page( if (((mutable_bitField0_ & 0x00000001) != 0)) { transforms_ = java.util.Collections.unmodifiableList(transforms_); } + if (((mutable_bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = java.util.Collections.unmodifiableList(detectedBarcodes_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -8015,8 +8068,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8028,8 +8080,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8041,8 +8092,7 @@ public interface LayoutOrBuilder * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8053,11 +8103,9 @@ public interface LayoutOrBuilder * * *
-       * Confidence of the current
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within
-       * context of the object this layout is for. e.g. confidence can be for a
-       * single token, a table, a visual element, etc. depending on context.
-       * Range [0, 1].
+       * Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
+       * layout is for. e.g. confidence can be for a single token, a table,
+       * a visual element, etc. depending on context. Range [0, 1].
        * 
* * float confidence = 2; @@ -8070,8 +8118,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8083,8 +8130,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8096,8 +8142,7 @@ public interface LayoutOrBuilder * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8108,8 +8153,7 @@ public interface LayoutOrBuilder * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -8122,8 +8166,7 @@ public interface LayoutOrBuilder * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -8486,8 +8529,7 @@ private Orientation(int value) { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8502,8 +8544,7 @@ public boolean hasTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8520,8 +8561,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * * *
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -8538,11 +8578,9 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * * *
-       * Confidence of the current
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within
-       * context of the object this layout is for. e.g. confidence can be for a
-       * single token, a table, a visual element, etc. depending on context.
-       * Range [0, 1].
+       * Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
+       * layout is for. e.g. confidence can be for a single token, a table,
+       * a visual element, etc. depending on context. Range [0, 1].
        * 
* * float confidence = 2; @@ -8560,8 +8598,7 @@ public float getConfidence() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8576,8 +8613,7 @@ public boolean hasBoundingPoly() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8594,8 +8630,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly getBoundingPoly() { * * *
-       * The bounding polygon for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -8611,8 +8646,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPolyOrBuilder getBoundingPoly * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -8628,8 +8662,7 @@ public int getOrientationValue() { * * *
-       * Detected orientation for the
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+       * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9060,8 +9093,7 @@ public Builder mergeFrom( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9075,8 +9107,7 @@ public boolean hasTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9096,8 +9127,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9120,8 +9150,7 @@ public Builder setTextAnchor( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9141,8 +9170,7 @@ public Builder setTextAnchor( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9169,8 +9197,7 @@ public Builder mergeTextAnchor( * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9190,8 +9217,7 @@ public Builder clearTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9206,8 +9232,7 @@ public Builder clearTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9226,8 +9251,7 @@ public Builder clearTextAnchor() { * * *
-         * Text anchor indexing into the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -9254,11 +9278,9 @@ public Builder clearTextAnchor() { * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9273,11 +9295,9 @@ public float getConfidence() { * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9295,11 +9315,9 @@ public Builder setConfidence(float value) { * * *
-         * Confidence of the current
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within
-         * context of the object this layout is for. e.g. confidence can be for a
-         * single token, a table, a visual element, etc. depending on context.
-         * Range [0, 1].
+         * Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
+         * layout is for. e.g. confidence can be for a single token, a table,
+         * a visual element, etc. depending on context. Range [0, 1].
          * 
* * float confidence = 2; @@ -9323,8 +9341,7 @@ public Builder clearConfidence() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9338,8 +9355,7 @@ public boolean hasBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9359,8 +9375,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly getBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9382,8 +9397,7 @@ public Builder setBoundingPoly(com.google.cloud.documentai.v1beta3.BoundingPoly * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9403,8 +9417,7 @@ public Builder setBoundingPoly( * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9430,8 +9443,7 @@ public Builder mergeBoundingPoly(com.google.cloud.documentai.v1beta3.BoundingPol * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9451,8 +9463,7 @@ public Builder clearBoundingPoly() { * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9466,8 +9477,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9486,8 +9496,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * The bounding polygon for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.BoundingPoly bounding_poly = 3; @@ -9514,8 +9523,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9531,8 +9539,7 @@ public int getOrientationValue() { * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9551,8 +9558,7 @@ public Builder setOrientationValue(int value) { * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9575,8 +9581,7 @@ public Builder setOrientationValue(int value) { * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9599,8 +9604,7 @@ public Builder setOrientation( * * *
-         * Detected orientation for the
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
+         * Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation orientation = 4; @@ -9677,8 +9681,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -9690,8 +9693,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -9703,8 +9705,7 @@ public interface BlockOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -9962,8 +9963,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -9978,8 +9978,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -9996,8 +9995,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10575,8 +10573,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10590,8 +10587,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10611,8 +10607,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10634,8 +10629,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10655,8 +10649,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10682,8 +10675,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10703,8 +10695,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10718,8 +10709,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -10738,8 +10728,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11428,8 +11417,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11441,8 +11429,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11454,8 +11441,7 @@ public interface ParagraphOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11712,8 +11698,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11728,8 +11713,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -11746,8 +11730,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12328,8 +12311,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12343,8 +12325,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12364,8 +12345,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12387,8 +12367,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12408,8 +12387,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12435,8 +12413,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12456,8 +12433,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12471,8 +12447,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -12491,8 +12466,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13184,8 +13158,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13197,8 +13170,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13210,8 +13182,7 @@ public interface LineOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13469,8 +13440,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13485,8 +13455,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -13503,8 +13472,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14082,8 +14050,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14097,8 +14064,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14118,8 +14084,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14141,8 +14106,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14162,8 +14126,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14189,8 +14152,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14210,8 +14172,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14225,8 +14186,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14245,8 +14205,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14935,8 +14894,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14948,8 +14906,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14961,8 +14918,7 @@ public interface TokenOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -14973,8 +14929,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -14988,8 +14943,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -15003,8 +14957,7 @@ public interface TokenOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -15313,8 +15266,7 @@ public interface DetectedBreakOrBuilder * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak} @@ -15817,8 +15769,7 @@ protected Builder newBuilderForType( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak} @@ -16151,8 +16102,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16167,8 +16117,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16185,8 +16134,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16203,8 +16151,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -16221,8 +16168,7 @@ public boolean hasDetectedBreak() { * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -16243,8 +16189,7 @@ public boolean hasDetectedBreak() { * * *
-       * Detected break at the end of a
-       * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+       * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
        * 
* * @@ -16851,8 +16796,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16866,8 +16810,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16887,8 +16830,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16910,8 +16852,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16931,8 +16872,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16958,8 +16898,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16979,8 +16918,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -16994,8 +16932,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -17014,8 +16951,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -17048,8 +16984,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17065,8 +17000,7 @@ public boolean hasDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17090,8 +17024,7 @@ public boolean hasDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17116,8 +17049,7 @@ public Builder setDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17140,8 +17072,7 @@ public Builder setDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17171,8 +17102,7 @@ public Builder mergeDetectedBreak( * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17194,8 +17124,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17212,8 +17141,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17235,8 +17163,7 @@ public Builder clearDetectedBreak() { * * *
-         * Detected break at the end of a
-         * [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
+         * Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token].
          * 
* * @@ -17927,8 +17854,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -17940,8 +17866,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -17953,8 +17878,7 @@ public interface SymbolOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18159,8 +18083,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18175,8 +18098,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18193,8 +18115,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18696,8 +18617,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18711,8 +18631,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18732,8 +18651,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18755,8 +18673,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18776,8 +18693,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18803,8 +18719,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18824,8 +18739,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18839,8 +18753,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -18859,8 +18772,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19360,8 +19272,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19373,8 +19284,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19386,8 +19296,7 @@ public interface VisualElementOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19398,8 +19307,7 @@ public interface VisualElementOrBuilder * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19411,8 +19319,7 @@ public interface VisualElementOrBuilder * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19628,8 +19535,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19644,8 +19550,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19662,8 +19567,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -19680,8 +19584,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -19704,8 +19607,7 @@ public java.lang.String getType() { * * *
-       * Type of the
-       * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+       * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
        * 
* * string type = 2; @@ -20240,8 +20142,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20255,8 +20156,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20276,8 +20176,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20299,8 +20198,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20320,8 +20218,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20347,8 +20244,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20368,8 +20264,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20383,8 +20278,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20403,8 +20297,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -20431,8 +20324,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20454,8 +20346,7 @@ public java.lang.String getType() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20477,8 +20368,7 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20499,8 +20389,7 @@ public Builder setType(java.lang.String value) { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -20517,8 +20406,7 @@ public Builder clearType() { * * *
-         * Type of the
-         * [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
+         * Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement].
          * 
* * string type = 2; @@ -21017,8 +20905,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -21030,8 +20917,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -21043,8 +20929,7 @@ public interface TableOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22511,8 +22396,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22524,8 +22408,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22537,8 +22420,7 @@ public interface TableCellOrBuilder * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22780,8 +22662,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22796,8 +22677,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -22814,8 +22694,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23396,8 +23275,7 @@ public Builder mergeFrom( * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23411,8 +23289,7 @@ public boolean hasLayout() { * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23432,8 +23309,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23455,8 +23331,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23476,8 +23351,7 @@ public Builder setLayout( * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23504,8 +23378,7 @@ public Builder mergeLayout( * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23525,8 +23398,7 @@ public Builder clearLayout() { * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23541,8 +23413,7 @@ public Builder clearLayout() { * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -23561,8 +23432,7 @@ public Builder clearLayout() { * * *
-           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-           * [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
+           * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell].
            * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -24166,8 +24036,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -24182,8 +24051,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -24200,8 +24068,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-       * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -24972,8 +24839,7 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -24987,8 +24853,7 @@ public boolean hasLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25008,8 +24873,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25031,8 +24895,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25052,8 +24915,7 @@ public Builder setLayout( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25079,8 +24941,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25100,8 +24961,7 @@ public Builder clearLayout() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25115,8 +24975,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -25135,8 +24994,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for
-         * [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table].
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; @@ -26460,9 +26318,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26474,9 +26331,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26488,9 +26344,8 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26501,9 +26356,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -26515,9 +26368,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -26529,9 +26380,7 @@ public interface FormFieldOrBuilder * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -26703,6 +26552,64 @@ com.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage getValueDetec */ com.google.protobuf.ByteString getValueTypeBytes(); + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + java.lang.String getCorrectedKeyText(); + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + com.google.protobuf.ByteString getCorrectedKeyTextBytes(); + + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + java.lang.String getCorrectedValueText(); + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + com.google.protobuf.ByteString getCorrectedValueTextBytes(); + /** * * @@ -26761,6 +26668,8 @@ private FormField() { nameDetectedLanguages_ = java.util.Collections.emptyList(); valueDetectedLanguages_ = java.util.Collections.emptyList(); valueType_ = ""; + correctedKeyText_ = ""; + correctedValueText_ = ""; } @java.lang.Override @@ -26866,6 +26775,20 @@ private FormField( valueType_ = s; break; } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedKeyText_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedValueText_ = s; + break; + } case 66: { com.google.cloud.documentai.v1beta3.Document.Provenance.Builder subBuilder = null; @@ -26933,9 +26856,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26950,9 +26872,8 @@ public boolean hasFieldName() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26969,9 +26890,8 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getFieldName() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+       * `Grand total`, `Phone number`, etc.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -26988,9 +26908,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getFieldName() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -27005,9 +26923,7 @@ public boolean hasFieldValue() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -27024,9 +26940,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getFieldValue() * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-       * value.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -27262,6 +27176,112 @@ public com.google.protobuf.ByteString getValueTypeBytes() { } } + public static final int CORRECTED_KEY_TEXT_FIELD_NUMBER = 6; + private volatile java.lang.Object correctedKeyText_; + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + @java.lang.Override + public java.lang.String getCorrectedKeyText() { + java.lang.Object ref = correctedKeyText_; + 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(); + correctedKeyText_ = s; + return s; + } + } + /** + * + * + *
+       * Created for Labeling UI to export key text.
+       * If corrections were made to the text identified by the
+       * `field_name.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedKeyTextBytes() { + java.lang.Object ref = correctedKeyText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedKeyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CORRECTED_VALUE_TEXT_FIELD_NUMBER = 7; + private volatile java.lang.Object correctedValueText_; + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + @java.lang.Override + public java.lang.String getCorrectedValueText() { + java.lang.Object ref = correctedValueText_; + 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(); + correctedValueText_ = s; + return s; + } + } + /** + * + * + *
+       * Created for Labeling UI to export value text.
+       * If corrections were made to the text identified by the
+       * `field_value.text_anchor`, this field will contain the correction.
+       * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedValueTextBytes() { + java.lang.Object ref = correctedValueText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedValueText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int PROVENANCE_FIELD_NUMBER = 8; private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; /** @@ -27340,6 +27360,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedKeyText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, correctedKeyText_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedValueText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, correctedValueText_); + } if (provenance_ != null) { output.writeMessage(8, getProvenance()); } @@ -27371,6 +27397,12 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueType_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedKeyText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, correctedKeyText_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedValueText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, correctedValueText_); + } if (provenance_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getProvenance()); } @@ -27403,6 +27435,8 @@ public boolean equals(final java.lang.Object obj) { if (!getValueDetectedLanguagesList().equals(other.getValueDetectedLanguagesList())) return false; if (!getValueType().equals(other.getValueType())) return false; + if (!getCorrectedKeyText().equals(other.getCorrectedKeyText())) return false; + if (!getCorrectedValueText().equals(other.getCorrectedValueText())) return false; if (hasProvenance() != other.hasProvenance()) return false; if (hasProvenance()) { if (!getProvenance().equals(other.getProvenance())) return false; @@ -27436,6 +27470,10 @@ public int hashCode() { } hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + getValueType().hashCode(); + hash = (37 * hash) + CORRECTED_KEY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedKeyText().hashCode(); + hash = (37 * hash) + CORRECTED_VALUE_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedValueText().hashCode(); if (hasProvenance()) { hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; hash = (53 * hash) + getProvenance().hashCode(); @@ -27617,6 +27655,10 @@ public Builder clear() { } valueType_ = ""; + correctedKeyText_ = ""; + + correctedValueText_ = ""; + if (provenanceBuilder_ == null) { provenance_ = null; } else { @@ -27683,6 +27725,8 @@ public com.google.cloud.documentai.v1beta3.Document.Page.FormField buildPartial( result.valueDetectedLanguages_ = valueDetectedLanguagesBuilder_.build(); } result.valueType_ = valueType_; + result.correctedKeyText_ = correctedKeyText_; + result.correctedValueText_ = correctedValueText_; if (provenanceBuilder_ == null) { result.provenance_ = provenance_; } else { @@ -27806,6 +27850,14 @@ public Builder mergeFrom( valueType_ = other.valueType_; onChanged(); } + if (!other.getCorrectedKeyText().isEmpty()) { + correctedKeyText_ = other.correctedKeyText_; + onChanged(); + } + if (!other.getCorrectedValueText().isEmpty()) { + correctedValueText_ = other.correctedValueText_; + onChanged(); + } if (other.hasProvenance()) { mergeProvenance(other.getProvenance()); } @@ -27852,9 +27904,8 @@ public Builder mergeFrom( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27868,9 +27919,8 @@ public boolean hasFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27890,9 +27940,8 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27915,9 +27964,8 @@ public Builder setFieldName( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27937,9 +27985,8 @@ public Builder setFieldName( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27966,9 +28013,8 @@ public Builder mergeFieldName( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -27988,9 +28034,8 @@ public Builder clearFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -28005,9 +28050,8 @@ public Builder clearFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -28026,9 +28070,8 @@ public Builder clearFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`,
+         * `Grand total`, `Phone number`, etc.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_name = 1; @@ -28060,9 +28103,7 @@ public Builder clearFieldName() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28076,9 +28117,7 @@ public boolean hasFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28098,9 +28137,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getFieldValue() * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28123,9 +28160,7 @@ public Builder setFieldValue( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28145,9 +28180,7 @@ public Builder setFieldValue( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28174,9 +28207,7 @@ public Builder mergeFieldValue( * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28196,9 +28227,7 @@ public Builder clearFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28213,9 +28242,7 @@ public Builder clearFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -28234,9 +28261,7 @@ public Builder clearFieldValue() { * * *
-         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-         * [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField]
-         * value.
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value.
          * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout field_value = 2; @@ -29216,6 +29241,238 @@ public Builder setValueTypeBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object correctedKeyText_ = ""; + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return The correctedKeyText. + */ + public java.lang.String getCorrectedKeyText() { + java.lang.Object ref = correctedKeyText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedKeyText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return The bytes for correctedKeyText. + */ + public com.google.protobuf.ByteString getCorrectedKeyTextBytes() { + java.lang.Object ref = correctedKeyText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedKeyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @param value The correctedKeyText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedKeyText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedKeyText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedKeyText() { + + correctedKeyText_ = getDefaultInstance().getCorrectedKeyText(); + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export key text.
+         * If corrections were made to the text identified by the
+         * `field_name.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_key_text = 6; + * + * @param value The bytes for correctedKeyText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedKeyTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedKeyText_ = value; + onChanged(); + return this; + } + + private java.lang.Object correctedValueText_ = ""; + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return The correctedValueText. + */ + public java.lang.String getCorrectedValueText() { + java.lang.Object ref = correctedValueText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedValueText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return The bytes for correctedValueText. + */ + public com.google.protobuf.ByteString getCorrectedValueTextBytes() { + java.lang.Object ref = correctedValueText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedValueText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @param value The correctedValueText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedValueText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedValueText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedValueText() { + + correctedValueText_ = getDefaultInstance().getCorrectedValueText(); + onChanged(); + return this; + } + /** + * + * + *
+         * Created for Labeling UI to export value text.
+         * If corrections were made to the text identified by the
+         * `field_value.text_anchor`, this field will contain the correction.
+         * 
+ * + * string corrected_value_text = 7; + * + * @param value The bytes for correctedValueText to set. + * @return This builder for chaining. + */ + public Builder setCorrectedValueTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedValueText_ = value; + onChanged(); + return this; + } + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.documentai.v1beta3.Document.Provenance, @@ -29461,6 +29718,1099 @@ public com.google.protobuf.Parser getParserForType() { } } + public interface DetectedBarcodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + boolean hasLayout(); + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout(); + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder getLayoutOrBuilder(); + + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + boolean hasBarcode(); + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return The barcode. + */ + com.google.cloud.documentai.v1beta3.Barcode getBarcode(); + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + com.google.cloud.documentai.v1beta3.BarcodeOrBuilder getBarcodeOrBuilder(); + } + /** + * + * + *
+     * A detected barcode.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} + */ + public static final class DetectedBarcode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + DetectedBarcodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectedBarcode.newBuilder() to construct. + private DetectedBarcode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DetectedBarcode() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectedBarcode(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DetectedBarcode( + 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.documentai.v1beta3.Document.Page.Layout.Builder subBuilder = + null; + if (layout_ != null) { + subBuilder = layout_.toBuilder(); + } + layout_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.Document.Page.Layout.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(layout_); + layout_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.documentai.v1beta3.Barcode.Builder subBuilder = null; + if (barcode_ != null) { + subBuilder = barcode_.toBuilder(); + } + barcode_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.Barcode.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(barcode_); + barcode_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentProto + .internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentProto + .internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.class, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder.class); + } + + public static final int LAYOUT_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1beta3.Document.Page.Layout layout_; + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + @java.lang.Override + public boolean hasLayout() { + return layout_ != null; + } + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { + return layout_ == null + ? com.google.cloud.documentai.v1beta3.Document.Page.Layout.getDefaultInstance() + : layout_; + } + /** + * + * + *
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder + getLayoutOrBuilder() { + return getLayout(); + } + + public static final int BARCODE_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1beta3.Barcode barcode_; + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + @java.lang.Override + public boolean hasBarcode() { + return barcode_ != null; + } + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return The barcode. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Barcode getBarcode() { + return barcode_ == null + ? com.google.cloud.documentai.v1beta3.Barcode.getDefaultInstance() + : barcode_; + } + /** + * + * + *
+       * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+       * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.BarcodeOrBuilder getBarcodeOrBuilder() { + return getBarcode(); + } + + 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 (layout_ != null) { + output.writeMessage(1, getLayout()); + } + if (barcode_ != null) { + output.writeMessage(2, getBarcode()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (layout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLayout()); + } + if (barcode_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBarcode()); + } + 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.documentai.v1beta3.Document.Page.DetectedBarcode)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode other = + (com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) obj; + + if (hasLayout() != other.hasLayout()) return false; + if (hasLayout()) { + if (!getLayout().equals(other.getLayout())) return false; + } + if (hasBarcode() != other.hasBarcode()) return false; + if (hasBarcode()) { + if (!getBarcode().equals(other.getBarcode())) 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 (hasLayout()) { + hash = (37 * hash) + LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getLayout().hashCode(); + } + if (hasBarcode()) { + hash = (37 * hash) + BARCODE_FIELD_NUMBER; + hash = (53 * hash) + getBarcode().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode 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.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode 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.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode 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.documentai.v1beta3.Document.Page.DetectedBarcode + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + 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.documentai.v1beta3.Document.Page.DetectedBarcode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode 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.documentai.v1beta3.Document.Page.DetectedBarcode 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 detected barcode.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentProto + .internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentProto + .internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.class, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.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 (layoutBuilder_ == null) { + layout_ = null; + } else { + layout_ = null; + layoutBuilder_ = null; + } + if (barcodeBuilder_ == null) { + barcode_ = null; + } else { + barcode_ = null; + barcodeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentProto + .internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode build() { + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode buildPartial() { + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode result = + new com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode(this); + if (layoutBuilder_ == null) { + result.layout_ = layout_; + } else { + result.layout_ = layoutBuilder_.build(); + } + if (barcodeBuilder_ == null) { + result.barcode_ = barcode_; + } else { + result.barcode_ = barcodeBuilder_.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.documentai.v1beta3.Document.Page.DetectedBarcode) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode other) { + if (other + == com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + .getDefaultInstance()) return this; + if (other.hasLayout()) { + mergeLayout(other.getLayout()); + } + if (other.hasBarcode()) { + mergeBarcode(other.getBarcode()); + } + 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.documentai.v1beta3.Document.Page.DetectedBarcode parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1beta3.Document.Page.Layout layout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.Layout, + com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder> + layoutBuilder_; + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. + */ + public boolean hasLayout() { + return layoutBuilder_ != null || layout_ != null; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + * + * @return The layout. + */ + public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { + if (layoutBuilder_ == null) { + return layout_ == null + ? com.google.cloud.documentai.v1beta3.Document.Page.Layout.getDefaultInstance() + : layout_; + } else { + return layoutBuilder_.getMessage(); + } + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + layout_ = value; + onChanged(); + } else { + layoutBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public Builder setLayout( + com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + layout_ = builderForValue.build(); + onChanged(); + } else { + layoutBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layout value) { + if (layoutBuilder_ == null) { + if (layout_ != null) { + layout_ = + com.google.cloud.documentai.v1beta3.Document.Page.Layout.newBuilder(layout_) + .mergeFrom(value) + .buildPartial(); + } else { + layout_ = value; + } + onChanged(); + } else { + layoutBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public Builder clearLayout() { + if (layoutBuilder_ == null) { + layout_ = null; + onChanged(); + } else { + layout_ = null; + layoutBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayoutBuilder() { + + onChanged(); + return getLayoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + public com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder + getLayoutOrBuilder() { + if (layoutBuilder_ != null) { + return layoutBuilder_.getMessageOrBuilder(); + } else { + return layout_ == null + ? com.google.cloud.documentai.v1beta3.Document.Page.Layout.getDefaultInstance() + : layout_; + } + } + /** + * + * + *
+         * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.Layout, + com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder> + getLayoutFieldBuilder() { + if (layoutBuilder_ == null) { + layoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.Layout, + com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.LayoutOrBuilder>( + getLayout(), getParentForChildren(), isClean()); + layout_ = null; + } + return layoutBuilder_; + } + + private com.google.cloud.documentai.v1beta3.Barcode barcode_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Barcode, + com.google.cloud.documentai.v1beta3.Barcode.Builder, + com.google.cloud.documentai.v1beta3.BarcodeOrBuilder> + barcodeBuilder_; + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return Whether the barcode field is set. + */ + public boolean hasBarcode() { + return barcodeBuilder_ != null || barcode_ != null; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + * + * @return The barcode. + */ + public com.google.cloud.documentai.v1beta3.Barcode getBarcode() { + if (barcodeBuilder_ == null) { + return barcode_ == null + ? com.google.cloud.documentai.v1beta3.Barcode.getDefaultInstance() + : barcode_; + } else { + return barcodeBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public Builder setBarcode(com.google.cloud.documentai.v1beta3.Barcode value) { + if (barcodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + barcode_ = value; + onChanged(); + } else { + barcodeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public Builder setBarcode( + com.google.cloud.documentai.v1beta3.Barcode.Builder builderForValue) { + if (barcodeBuilder_ == null) { + barcode_ = builderForValue.build(); + onChanged(); + } else { + barcodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public Builder mergeBarcode(com.google.cloud.documentai.v1beta3.Barcode value) { + if (barcodeBuilder_ == null) { + if (barcode_ != null) { + barcode_ = + com.google.cloud.documentai.v1beta3.Barcode.newBuilder(barcode_) + .mergeFrom(value) + .buildPartial(); + } else { + barcode_ = value; + } + onChanged(); + } else { + barcodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public Builder clearBarcode() { + if (barcodeBuilder_ == null) { + barcode_ = null; + onChanged(); + } else { + barcode_ = null; + barcodeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public com.google.cloud.documentai.v1beta3.Barcode.Builder getBarcodeBuilder() { + + onChanged(); + return getBarcodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + public com.google.cloud.documentai.v1beta3.BarcodeOrBuilder getBarcodeOrBuilder() { + if (barcodeBuilder_ != null) { + return barcodeBuilder_.getMessageOrBuilder(); + } else { + return barcode_ == null + ? com.google.cloud.documentai.v1beta3.Barcode.getDefaultInstance() + : barcode_; + } + } + /** + * + * + *
+         * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode].
+         * 
+ * + * .google.cloud.documentai.v1beta3.Barcode barcode = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Barcode, + com.google.cloud.documentai.v1beta3.Barcode.Builder, + com.google.cloud.documentai.v1beta3.BarcodeOrBuilder> + getBarcodeFieldBuilder() { + if (barcodeBuilder_ == null) { + barcodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Barcode, + com.google.cloud.documentai.v1beta3.Barcode.Builder, + com.google.cloud.documentai.v1beta3.BarcodeOrBuilder>( + getBarcode(), getParentForChildren(), isClean()); + barcode_ = null; + } + return barcodeBuilder_; + } + + @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.documentai.v1beta3.Document.Page.DetectedBarcode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + private static final com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode(); + } + + public static com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DetectedBarcode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectedBarcode(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.documentai.v1beta3.Document.Page.DetectedBarcode + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public interface DetectedLanguageOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage) @@ -30258,11 +31608,9 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * 1-based index for current
-     * [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent
-     * [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page
-     * is taken out of a [Document][google.cloud.documentai.v1beta3.Document]
-     * for individual processing.
+     * 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
+     * Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
+     * processing.
      * 
* * int32 page_number = 1; @@ -30335,8 +31683,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.ImageOrBuilder getImage * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -30351,8 +31698,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.ImageOrBuilder getImage * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -30368,8 +31714,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.ImageOrBuilder getImage * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -30383,8 +31728,7 @@ public int getTransformsCount() { * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -30398,8 +31742,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix getTransforms(in * *
      * Transformation matrices that were applied to the original document image
-     * to produce
-     * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+     * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -30465,8 +31808,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Dimension getDimension( * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -30481,8 +31823,7 @@ public boolean hasLayout() { * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -30499,8 +31840,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-     * page.
+     * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
      * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -31212,6 +32552,90 @@ public com.google.cloud.documentai.v1beta3.Document.Page.SymbolOrBuilder getSymb return symbols_.get(index); } + public static final int DETECTED_BARCODES_FIELD_NUMBER = 15; + private java.util.List + detectedBarcodes_; + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public java.util.List + getDetectedBarcodesList() { + return detectedBarcodes_; + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesOrBuilderList() { + return detectedBarcodes_; + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public int getDetectedBarcodesCount() { + return detectedBarcodes_.size(); + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode getDetectedBarcodes( + int index) { + return detectedBarcodes_.get(index); + } + /** + * + * + *
+     * A list of detected barcodes.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index) { + return detectedBarcodes_.get(index); + } + public static final int PROVENANCE_FIELD_NUMBER = 16; private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; /** @@ -31317,6 +32741,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < transforms_.size(); i++) { output.writeMessage(14, transforms_.get(i)); } + for (int i = 0; i < detectedBarcodes_.size(); i++) { + output.writeMessage(15, detectedBarcodes_.get(i)); + } if (provenance_ != null) { output.writeMessage(16, getProvenance()); } @@ -31372,6 +32799,10 @@ public int getSerializedSize() { for (int i = 0; i < transforms_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, transforms_.get(i)); } + for (int i = 0; i < detectedBarcodes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(15, detectedBarcodes_.get(i)); + } if (provenance_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getProvenance()); } @@ -31414,6 +32845,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTablesList().equals(other.getTablesList())) return false; if (!getFormFieldsList().equals(other.getFormFieldsList())) return false; if (!getSymbolsList().equals(other.getSymbolsList())) return false; + if (!getDetectedBarcodesList().equals(other.getDetectedBarcodesList())) return false; if (hasProvenance() != other.hasProvenance()) return false; if (hasProvenance()) { if (!getProvenance().equals(other.getProvenance())) return false; @@ -31483,6 +32915,10 @@ public int hashCode() { hash = (37 * hash) + SYMBOLS_FIELD_NUMBER; hash = (53 * hash) + getSymbolsList().hashCode(); } + if (getDetectedBarcodesCount() > 0) { + hash = (37 * hash) + DETECTED_BARCODES_FIELD_NUMBER; + hash = (53 * hash) + getDetectedBarcodesList().hashCode(); + } if (hasProvenance()) { hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; hash = (53 * hash) + getProvenance().hashCode(); @@ -31639,6 +33075,7 @@ private void maybeForceBuilderInitialization() { getTablesFieldBuilder(); getFormFieldsFieldBuilder(); getSymbolsFieldBuilder(); + getDetectedBarcodesFieldBuilder(); } } @@ -31725,6 +33162,12 @@ public Builder clear() { } else { symbolsBuilder_.clear(); } + if (detectedBarcodesBuilder_ == null) { + detectedBarcodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + } else { + detectedBarcodesBuilder_.clear(); + } if (provenanceBuilder_ == null) { provenance_ = null; } else { @@ -31865,6 +33308,15 @@ public com.google.cloud.documentai.v1beta3.Document.Page buildPartial() { } else { result.symbols_ = symbolsBuilder_.build(); } + if (detectedBarcodesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = java.util.Collections.unmodifiableList(detectedBarcodes_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.detectedBarcodes_ = detectedBarcodes_; + } else { + result.detectedBarcodes_ = detectedBarcodesBuilder_.build(); + } if (provenanceBuilder_ == null) { result.provenance_ = provenance_; } else { @@ -32204,6 +33656,33 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Document.Page other } } } + if (detectedBarcodesBuilder_ == null) { + if (!other.detectedBarcodes_.isEmpty()) { + if (detectedBarcodes_.isEmpty()) { + detectedBarcodes_ = other.detectedBarcodes_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.addAll(other.detectedBarcodes_); + } + onChanged(); + } + } else { + if (!other.detectedBarcodes_.isEmpty()) { + if (detectedBarcodesBuilder_.isEmpty()) { + detectedBarcodesBuilder_.dispose(); + detectedBarcodesBuilder_ = null; + detectedBarcodes_ = other.detectedBarcodes_; + bitField0_ = (bitField0_ & ~0x00000400); + detectedBarcodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetectedBarcodesFieldBuilder() + : null; + } else { + detectedBarcodesBuilder_.addAllMessages(other.detectedBarcodes_); + } + } + } if (other.hasProvenance()) { mergeProvenance(other.getProvenance()); } @@ -32244,11 +33723,9 @@ public Builder mergeFrom( * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page
-       * is taken out of a [Document][google.cloud.documentai.v1beta3.Document]
-       * for individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -32263,11 +33740,9 @@ public int getPageNumber() { * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page
-       * is taken out of a [Document][google.cloud.documentai.v1beta3.Document]
-       * for individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -32285,11 +33760,9 @@ public Builder setPageNumber(int value) { * * *
-       * 1-based index for current
-       * [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent
-       * [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page
-       * is taken out of a [Document][google.cloud.documentai.v1beta3.Document]
-       * for individual processing.
+       * 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
+       * Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
+       * processing.
        * 
* * int32 page_number = 1; @@ -32530,8 +34003,7 @@ private void ensureTransformsIsMutable() { * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32550,8 +34022,7 @@ private void ensureTransformsIsMutable() { * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32569,8 +34040,7 @@ public int getTransformsCount() { * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32588,8 +34058,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix getTransforms(in * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32614,8 +34083,7 @@ public Builder setTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32638,8 +34106,7 @@ public Builder setTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32663,8 +34130,7 @@ public Builder addTransforms(com.google.cloud.documentai.v1beta3.Document.Page.M * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32689,8 +34155,7 @@ public Builder addTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32712,8 +34177,7 @@ public Builder addTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32736,8 +34200,7 @@ public Builder addTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32760,8 +34223,7 @@ public Builder addAllTransforms( * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32782,8 +34244,7 @@ public Builder clearTransforms() { * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32804,8 +34265,7 @@ public Builder removeTransforms(int index) { * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32820,8 +34280,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix.Builder getTrans * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32840,8 +34299,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix.Builder getTrans * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32861,8 +34319,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix.Builder getTrans * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32879,8 +34336,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix.Builder getTrans * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -32898,8 +34354,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Matrix.Builder addTrans * *
        * Transformation matrices that were applied to the original document image
-       * to produce
-       * [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
+       * to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image].
        * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page.Matrix transforms = 14; @@ -33127,8 +34582,7 @@ public Builder clearDimension() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33142,8 +34596,7 @@ public boolean hasLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33163,8 +34616,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout getLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33186,8 +34638,7 @@ public Builder setLayout(com.google.cloud.documentai.v1beta3.Document.Page.Layou * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33207,8 +34658,7 @@ public Builder setLayout( * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33234,8 +34684,7 @@ public Builder mergeLayout(com.google.cloud.documentai.v1beta3.Document.Page.Lay * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33255,8 +34704,7 @@ public Builder clearLayout() { * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33270,8 +34718,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -33290,8 +34737,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Layout.Builder getLayou * * *
-       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the
-       * page.
+       * [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page.
        * 
* * .google.cloud.documentai.v1beta3.Document.Page.Layout layout = 3; @@ -36821,6 +38267,421 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Symbol.Builder addSymbo return symbolsBuilder_; } + private java.util.List + detectedBarcodes_ = java.util.Collections.emptyList(); + + private void ensureDetectedBarcodesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + detectedBarcodes_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode>( + detectedBarcodes_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder> + detectedBarcodesBuilder_; + + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List + getDetectedBarcodesList() { + if (detectedBarcodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(detectedBarcodes_); + } else { + return detectedBarcodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public int getDetectedBarcodesCount() { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.size(); + } else { + return detectedBarcodesBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode getDetectedBarcodes( + int index) { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.get(index); + } else { + return detectedBarcodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder setDetectedBarcodes( + int index, com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.set(index, value); + onChanged(); + } else { + detectedBarcodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder setDetectedBarcodes( + int index, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.set(index, builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(value); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + int index, com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode value) { + if (detectedBarcodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(index, value); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addDetectedBarcodes( + int index, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + builderForValue) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.add(index, builderForValue.build()); + onChanged(); + } else { + detectedBarcodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder addAllDetectedBarcodes( + java.lang.Iterable< + ? extends com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode> + values) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, detectedBarcodes_); + onChanged(); + } else { + detectedBarcodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder clearDetectedBarcodes() { + if (detectedBarcodesBuilder_ == null) { + detectedBarcodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + detectedBarcodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public Builder removeDetectedBarcodes(int index) { + if (detectedBarcodesBuilder_ == null) { + ensureDetectedBarcodesIsMutable(); + detectedBarcodes_.remove(index); + onChanged(); + } else { + detectedBarcodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + getDetectedBarcodesBuilder(int index) { + return getDetectedBarcodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder + getDetectedBarcodesOrBuilder(int index) { + if (detectedBarcodesBuilder_ == null) { + return detectedBarcodes_.get(index); + } else { + return detectedBarcodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesOrBuilderList() { + if (detectedBarcodesBuilder_ != null) { + return detectedBarcodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(detectedBarcodes_); + } + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + addDetectedBarcodesBuilder() { + return getDetectedBarcodesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder + addDetectedBarcodesBuilder(int index) { + return getDetectedBarcodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of detected barcodes.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode detected_barcodes = 15; + * + */ + public java.util.List< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder> + getDetectedBarcodesBuilderList() { + return getDetectedBarcodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder> + getDetectedBarcodesFieldBuilder() { + if (detectedBarcodesBuilder_ == null) { + detectedBarcodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.Builder, + com.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcodeOrBuilder>( + detectedBarcodes_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + detectedBarcodes_ = null; + } + return detectedBarcodesBuilder_; + } + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.documentai.v1beta3.Document.Provenance, @@ -37072,8 +38933,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -37088,8 +38948,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -37104,8 +38963,7 @@ public interface EntityOrBuilder * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -37143,8 +39001,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -37156,8 +39014,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -37208,8 +39066,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -37223,8 +39081,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -37238,8 +39096,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -37279,8 +39137,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -37296,8 +39154,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -37313,8 +39171,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -37330,8 +39188,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -37343,8 +39201,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -37356,8 +39214,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -37369,8 +39227,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -37383,8 +39241,8 @@ public interface EntityOrBuilder * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -37438,8 +39296,7 @@ public interface EntityOrBuilder * * *
-     * Optional. Whether the entity will be redacted for de-identification
-     * purposes.
+     * Optional. Whether the entity will be redacted for de-identification purposes.
      * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -37852,6 +39709,56 @@ public interface NormalizedValueOrBuilder */ boolean getBooleanValue(); + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + boolean hasIntegerValue(); + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + int getIntegerValue(); + + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + boolean hasFloatValue(); + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + float getFloatValue(); + /** * * @@ -38021,6 +39928,18 @@ private NormalizedValue( structuredValueCase_ = 6; break; } + case 56: + { + structuredValue_ = input.readInt32(); + structuredValueCase_ = 7; + break; + } + case 69: + { + structuredValue_ = input.readFloat(); + structuredValueCase_ = 8; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -38070,6 +39989,8 @@ public enum StructuredValueCase DATETIME_VALUE(4), ADDRESS_VALUE(5), BOOLEAN_VALUE(6), + INTEGER_VALUE(7), + FLOAT_VALUE(8), STRUCTUREDVALUE_NOT_SET(0); private final int value; @@ -38098,6 +40019,10 @@ public static StructuredValueCase forNumber(int value) { return ADDRESS_VALUE; case 6: return BOOLEAN_VALUE; + case 7: + return INTEGER_VALUE; + case 8: + return FLOAT_VALUE; case 0: return STRUCTUREDVALUE_NOT_SET; default: @@ -38367,6 +40292,76 @@ public boolean getBooleanValue() { return false; } + public static final int INTEGER_VALUE_FIELD_NUMBER = 7; + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + @java.lang.Override + public boolean hasIntegerValue() { + return structuredValueCase_ == 7; + } + /** + * + * + *
+       * Integer value.
+       * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + @java.lang.Override + public int getIntegerValue() { + if (structuredValueCase_ == 7) { + return (java.lang.Integer) structuredValue_; + } + return 0; + } + + public static final int FLOAT_VALUE_FIELD_NUMBER = 8; + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + @java.lang.Override + public boolean hasFloatValue() { + return structuredValueCase_ == 8; + } + /** + * + * + *
+       * Float value.
+       * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + @java.lang.Override + public float getFloatValue() { + if (structuredValueCase_ == 8) { + return (java.lang.Float) structuredValue_; + } + return 0F; + } + public static final int TEXT_FIELD_NUMBER = 1; private volatile java.lang.Object text_; /** @@ -38464,6 +40459,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (structuredValueCase_ == 6) { output.writeBool(6, (boolean) ((java.lang.Boolean) structuredValue_)); } + if (structuredValueCase_ == 7) { + output.writeInt32(7, (int) ((java.lang.Integer) structuredValue_)); + } + if (structuredValueCase_ == 8) { + output.writeFloat(8, (float) ((java.lang.Float) structuredValue_)); + } unknownFields.writeTo(output); } @@ -38501,6 +40502,16 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 6, (boolean) ((java.lang.Boolean) structuredValue_)); } + if (structuredValueCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 7, (int) ((java.lang.Integer) structuredValue_)); + } + if (structuredValueCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 8, (float) ((java.lang.Float) structuredValue_)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -38535,6 +40546,13 @@ public boolean equals(final java.lang.Object obj) { case 6: if (getBooleanValue() != other.getBooleanValue()) return false; break; + case 7: + if (getIntegerValue() != other.getIntegerValue()) return false; + break; + case 8: + if (java.lang.Float.floatToIntBits(getFloatValue()) + != java.lang.Float.floatToIntBits(other.getFloatValue())) return false; + break; case 0: default: } @@ -38572,6 +40590,14 @@ public int hashCode() { hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBooleanValue()); break; + case 7: + hash = (37 * hash) + INTEGER_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getIntegerValue(); + break; + case 8: + hash = (37 * hash) + FLOAT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFloatValue()); + break; case 0: default: } @@ -38792,6 +40818,12 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue build if (structuredValueCase_ == 6) { result.structuredValue_ = structuredValue_; } + if (structuredValueCase_ == 7) { + result.structuredValue_ = structuredValue_; + } + if (structuredValueCase_ == 8) { + result.structuredValue_ = structuredValue_; + } result.text_ = text_; result.structuredValueCase_ = structuredValueCase_; onBuilt(); @@ -38880,6 +40912,16 @@ public Builder mergeFrom( setBooleanValue(other.getBooleanValue()); break; } + case INTEGER_VALUE: + { + setIntegerValue(other.getIntegerValue()); + break; + } + case FLOAT_VALUE: + { + setFloatValue(other.getFloatValue()); + break; + } case STRUCTUREDVALUE_NOT_SET: { break; @@ -39862,6 +41904,144 @@ public Builder clearBooleanValue() { return this; } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return Whether the integerValue field is set. + */ + public boolean hasIntegerValue() { + return structuredValueCase_ == 7; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return The integerValue. + */ + public int getIntegerValue() { + if (structuredValueCase_ == 7) { + return (java.lang.Integer) structuredValue_; + } + return 0; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @param value The integerValue to set. + * @return This builder for chaining. + */ + public Builder setIntegerValue(int value) { + structuredValueCase_ = 7; + structuredValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Integer value.
+         * 
+ * + * int32 integer_value = 7; + * + * @return This builder for chaining. + */ + public Builder clearIntegerValue() { + if (structuredValueCase_ == 7) { + structuredValueCase_ = 0; + structuredValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return Whether the floatValue field is set. + */ + public boolean hasFloatValue() { + return structuredValueCase_ == 8; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return The floatValue. + */ + public float getFloatValue() { + if (structuredValueCase_ == 8) { + return (java.lang.Float) structuredValue_; + } + return 0F; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @param value The floatValue to set. + * @return This builder for chaining. + */ + public Builder setFloatValue(float value) { + structuredValueCase_ = 8; + structuredValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Float value.
+         * 
+ * + * float float_value = 8; + * + * @return This builder for chaining. + */ + public Builder clearFloatValue() { + if (structuredValueCase_ == 8) { + structuredValueCase_ = 0; + structuredValue_ = null; + onChanged(); + } + return this; + } + private java.lang.Object text_ = ""; /** * @@ -40071,8 +42251,7 @@ public com.google.protobuf.Parser getParserForType() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -40090,8 +42269,7 @@ public boolean hasTextAnchor() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -40111,8 +42289,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * *
      * Optional. Provenance of the entity.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -40180,8 +42357,8 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -40204,8 +42381,8 @@ public java.lang.String getMentionText() { * * *
-     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-     * the entity is not present in the document, this field will be empty.
+     * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+     * is not present in the document, this field will be empty.
      * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -40298,8 +42475,8 @@ public float getConfidence() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -40316,8 +42493,8 @@ public boolean hasPageAnchor() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -40336,8 +42513,8 @@ public com.google.cloud.documentai.v1beta3.Document.PageAnchor getPageAnchor() { * * *
-     * Optional. Represents the provenance of this entity wrt. the location on
-     * the page where it was found.
+     * Optional. Represents the provenance of this entity wrt. the location on the
+     * page where it was found.
      * 
* * @@ -40407,8 +42584,8 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -40427,8 +42604,8 @@ public boolean hasNormalizedValue() { * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -40450,8 +42627,8 @@ public boolean hasNormalizedValue() { * * *
-     * Optional. Normalized entity value. Absent if the extracted value could
-     * not be converted or the type (e.g. address) is not supported for certain
+     * Optional. Normalized entity value. Absent if the extracted value could not be
+     * converted or the type (e.g. address) is not supported for certain
      * parsers. This field is also only populated for certain supported document
      * types.
      * 
@@ -40472,8 +42649,8 @@ public boolean hasNormalizedValue() { * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40488,8 +42665,8 @@ public java.util.List getPr * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40505,8 +42682,8 @@ public java.util.List getPr * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40521,8 +42698,8 @@ public int getPropertiesCount() { * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40537,8 +42714,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity getProperties(int ind * * *
-     * Optional. Entities can be nested to form a hierarchical data structure
-     * representing the content in the document.
+     * Optional. Entities can be nested to form a hierarchical data structure representing
+     * the content in the document.
      * 
* * @@ -40612,8 +42789,7 @@ public com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance() { * * *
-     * Optional. Whether the entity will be redacted for de-identification
-     * purposes.
+     * Optional. Whether the entity will be redacted for de-identification purposes.
      * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -41210,8 +43386,7 @@ public Builder mergeFrom( * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41228,8 +43403,7 @@ public boolean hasTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41252,8 +43426,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41278,8 +43451,7 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1beta3.Document.TextAn * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41302,8 +43474,7 @@ public Builder setTextAnchor( * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41333,8 +43504,7 @@ public Builder mergeTextAnchor( * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41357,8 +43527,7 @@ public Builder clearTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41376,8 +43545,7 @@ public Builder clearTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41399,8 +43567,7 @@ public Builder clearTextAnchor() { * *
        * Optional. Provenance of the entity.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -41535,8 +43702,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41558,8 +43725,8 @@ public java.lang.String getMentionText() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41581,8 +43748,8 @@ public com.google.protobuf.ByteString getMentionTextBytes() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41603,8 +43770,8 @@ public Builder setMentionText(java.lang.String value) { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41621,8 +43788,8 @@ public Builder clearMentionText() { * * *
-       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
-       * the entity is not present in the document, this field will be empty.
+       * Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
+       * is not present in the document, this field will be empty.
        * 
* * string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -41809,8 +43976,8 @@ public Builder clearConfidence() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41826,8 +43993,8 @@ public boolean hasPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41849,8 +44016,8 @@ public com.google.cloud.documentai.v1beta3.Document.PageAnchor getPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41874,8 +44041,8 @@ public Builder setPageAnchor(com.google.cloud.documentai.v1beta3.Document.PageAn * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41897,8 +44064,8 @@ public Builder setPageAnchor( * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41927,8 +44094,8 @@ public Builder mergePageAnchor( * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41950,8 +44117,8 @@ public Builder clearPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41968,8 +44135,8 @@ public Builder clearPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -41990,8 +44157,8 @@ public Builder clearPageAnchor() { * * *
-       * Optional. Represents the provenance of this entity wrt. the location on
-       * the page where it was found.
+       * Optional. Represents the provenance of this entity wrt. the location on the
+       * page where it was found.
        * 
* * @@ -42136,8 +44303,8 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42155,8 +44322,8 @@ public boolean hasNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42182,8 +44349,8 @@ public boolean hasNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42210,8 +44377,8 @@ public Builder setNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42236,8 +44403,8 @@ public Builder setNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42269,8 +44436,8 @@ public Builder mergeNormalizedValue( * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42294,8 +44461,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42314,8 +44481,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42339,8 +44506,8 @@ public Builder clearNormalizedValue() { * * *
-       * Optional. Normalized entity value. Absent if the extracted value could
-       * not be converted or the type (e.g. address) is not supported for certain
+       * Optional. Normalized entity value. Absent if the extracted value could not be
+       * converted or the type (e.g. address) is not supported for certain
        * parsers. This field is also only populated for certain supported document
        * types.
        * 
@@ -42388,8 +44555,8 @@ private void ensurePropertiesIsMutable() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42408,8 +44575,8 @@ private void ensurePropertiesIsMutable() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42427,8 +44594,8 @@ public int getPropertiesCount() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42446,8 +44613,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity getProperties(int ind * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42472,8 +44639,8 @@ public Builder setProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42495,8 +44662,8 @@ public Builder setProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42520,8 +44687,8 @@ public Builder addProperties(com.google.cloud.documentai.v1beta3.Document.Entity * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42546,8 +44713,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42569,8 +44736,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42592,8 +44759,8 @@ public Builder addProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42616,8 +44783,8 @@ public Builder addAllProperties( * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42638,8 +44805,8 @@ public Builder clearProperties() { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42660,8 +44827,8 @@ public Builder removeProperties(int index) { * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42676,8 +44843,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder getProperties * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42696,8 +44863,8 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getPropertie * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42716,8 +44883,8 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getPropertie * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42732,8 +44899,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder addProperties * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42750,8 +44917,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder addProperties * * *
-       * Optional. Entities can be nested to form a hierarchical data structure
-       * representing the content in the document.
+       * Optional. Entities can be nested to form a hierarchical data structure representing
+       * the content in the document.
        * 
* * @@ -42992,8 +45159,7 @@ public Builder clearProvenance() { * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -43008,8 +45174,7 @@ public boolean getRedacted() { * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -43027,8 +45192,7 @@ public Builder setRedacted(boolean value) { * * *
-       * Optional. Whether the entity will be redacted for de-identification
-       * purposes.
+       * Optional. Whether the entity will be redacted for de-identification purposes.
        * 
* * bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; @@ -43178,8 +45342,7 @@ public interface EntityRelationOrBuilder * * *
-   * Relationship between
-   * [Entities][google.cloud.documentai.v1beta3.Document.Entity].
+   * Relationship between [Entities][google.cloud.documentai.v1beta3.Document.Entity].
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.EntityRelation} @@ -43616,8 +45779,7 @@ protected Builder newBuilderForType( * * *
-     * Relationship between
-     * [Entities][google.cloud.documentai.v1beta3.Document.Entity].
+     * Relationship between [Entities][google.cloud.documentai.v1beta3.Document.Entity].
      * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.EntityRelation} @@ -44172,8 +46334,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -44186,8 +46347,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -44199,8 +46359,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -44212,8 +46371,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -44227,8 +46385,7 @@ public interface TextAnchorOrBuilder * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -44271,8 +46428,7 @@ public interface TextAnchorOrBuilder * * *
-   * Text reference indexing into the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Text reference indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.TextAnchor} @@ -44392,9 +46548,7 @@ public interface TextSegmentOrBuilder * * *
-       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-       * start UTF-8 char index in the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * int64 start_index = 1; @@ -44407,8 +46561,7 @@ public interface TextSegmentOrBuilder * * *
-       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-       * half open end UTF-8 char index in the
+       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
        * [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* @@ -44422,11 +46575,9 @@ public interface TextSegmentOrBuilder * * *
-     * A text segment in the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. The
-     * indices may be out of bounds which indicate that the text extends into
-     * another document shard for large sharded documents. See
-     * [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset]
+     * A text segment in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. The indices may be out of bounds
+     * which indicate that the text extends into another document shard for
+     * large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset]
      * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} @@ -44525,9 +46676,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-       * start UTF-8 char index in the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * int64 start_index = 1; @@ -44545,8 +46694,7 @@ public long getStartIndex() { * * *
-       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-       * half open end UTF-8 char index in the
+       * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
        * [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* @@ -44735,11 +46883,9 @@ protected Builder newBuilderForType( * * *
-       * A text segment in the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text]. The
-       * indices may be out of bounds which indicate that the text extends into
-       * another document shard for large sharded documents. See
-       * [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset]
+       * A text segment in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. The indices may be out of bounds
+       * which indicate that the text extends into another document shard for
+       * large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset]
        * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} @@ -44917,9 +47063,7 @@ public Builder mergeFrom( * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * int64 start_index = 1; @@ -44934,9 +47078,7 @@ public long getStartIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * int64 start_index = 1; @@ -44954,9 +47096,7 @@ public Builder setStartIndex(long value) { * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * start UTF-8 char index in the
-         * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* * int64 start_index = 1; @@ -44975,8 +47115,7 @@ public Builder clearStartIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* @@ -44992,8 +47131,7 @@ public long getEndIndex() { * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* @@ -45012,8 +47150,7 @@ public Builder setEndIndex(long value) { * * *
-         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment]
-         * half open end UTF-8 char index in the
+         * [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the
          * [Document.text][google.cloud.documentai.v1beta3.Document.text].
          * 
* @@ -45091,8 +47228,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -45108,8 +47244,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -45126,8 +47261,7 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -45142,8 +47276,7 @@ public int getTextSegmentsCount() { * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -45159,8 +47292,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment getTe * * *
-     * The text segments from the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * @@ -45402,8 +47534,7 @@ protected Builder newBuilderForType( * * *
-     * Text reference indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Text reference indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document.TextAnchor} @@ -45631,8 +47762,7 @@ private void ensureTextSegmentsIsMutable() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45651,8 +47781,7 @@ private void ensureTextSegmentsIsMutable() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45670,8 +47799,7 @@ public int getTextSegmentsCount() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45690,8 +47818,7 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment getTe * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45716,8 +47843,7 @@ public Builder setTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45741,8 +47867,7 @@ public Builder setTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45767,8 +47892,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45793,8 +47917,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45817,8 +47940,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45842,8 +47964,7 @@ public Builder addTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45867,8 +47988,7 @@ public Builder addAllTextSegments( * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45889,8 +48009,7 @@ public Builder clearTextSegments() { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45911,8 +48030,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45927,8 +48045,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45947,8 +48064,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45969,8 +48085,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -45988,8 +48103,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -46008,8 +48122,7 @@ public Builder removeTextSegments(int index) { * * *
-       * The text segments from the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+       * The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text].
        * 
* * @@ -46279,9 +48392,8 @@ com.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRefOrBuilder getPage * * *
-   * Referencing the visual context of the entity in the
-   * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page
-   * anchors can be cross-page, consist of multiple bounding polygons and
+   * Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1beta3.Document.pages].
+   * Page anchors can be cross-page, consist of multiple bounding polygons and
    * optionally reference specific layout element types.
    * 
* @@ -46393,11 +48505,9 @@ public interface PageRefOrBuilder * * *
-       * Required. Index into the
-       * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]
-       * element, for example using [Document.pages][page_refs.page] to locate
-       * the related page element. This field is skipped when its value is the
-       * default 0. See
+       * Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using
+       * [Document.pages][page_refs.page] to locate the related page element.
+       * This field is skipped when its value is the default 0. See
        * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* @@ -46411,8 +48521,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -46426,8 +48535,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -46442,16 +48550,14 @@ public interface PageRefOrBuilder * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The layoutId. */ @java.lang.Deprecated @@ -46460,16 +48566,14 @@ public interface PageRefOrBuilder * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Deprecated @@ -46479,8 +48583,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46494,8 +48597,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46509,8 +48611,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -46523,8 +48624,7 @@ public interface PageRefOrBuilder * * *
-       * Optional. Confidence of detected page element, if applicable. Range [0,
-       * 1].
+       * Optional. Confidence of detected page element, if applicable. Range [0, 1].
        * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -46689,9 +48789,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks]
-         * element.
+         * References a [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] element.
          * 
* * BLOCK = 1; @@ -46701,9 +48799,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs]
-         * element.
+         * References a [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] element.
          * 
* * PARAGRAPH = 2; @@ -46713,9 +48809,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines]
-         * element.
+         * References a [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] element.
          * 
* * LINE = 3; @@ -46725,9 +48819,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens]
-         * element.
+         * References a [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] element.
          * 
* * TOKEN = 4; @@ -46737,9 +48829,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements]
-         * element.
+         * References a [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] element.
          * 
* * VISUAL_ELEMENT = 5; @@ -46749,9 +48839,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * Refrrences a
-         * [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables]
-         * element.
+         * Refrrences a [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] element.
          * 
* * TABLE = 6; @@ -46761,9 +48849,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields]
-         * element.
+         * References a [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] element.
          * 
* * FORM_FIELD = 7; @@ -46786,9 +48872,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks]
-         * element.
+         * References a [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] element.
          * 
* * BLOCK = 1; @@ -46798,9 +48882,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs]
-         * element.
+         * References a [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] element.
          * 
* * PARAGRAPH = 2; @@ -46810,9 +48892,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines]
-         * element.
+         * References a [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] element.
          * 
* * LINE = 3; @@ -46822,9 +48902,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens]
-         * element.
+         * References a [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] element.
          * 
* * TOKEN = 4; @@ -46834,9 +48912,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements]
-         * element.
+         * References a [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] element.
          * 
* * VISUAL_ELEMENT = 5; @@ -46846,9 +48922,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * Refrrences a
-         * [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables]
-         * element.
+         * Refrrences a [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] element.
          * 
* * TABLE = 6; @@ -46858,9 +48932,7 @@ public enum LayoutType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * References a
-         * [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields]
-         * element.
+         * References a [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] element.
          * 
* * FORM_FIELD = 7; @@ -46969,11 +49041,9 @@ private LayoutType(int value) { * * *
-       * Required. Index into the
-       * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]
-       * element, for example using [Document.pages][page_refs.page] to locate
-       * the related page element. This field is skipped when its value is the
-       * default 0. See
+       * Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using
+       * [Document.pages][page_refs.page] to locate the related page element.
+       * This field is skipped when its value is the default 0. See
        * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* @@ -46992,8 +49062,7 @@ public long getPage() { * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -47010,8 +49079,7 @@ public int getLayoutTypeValue() { * * *
-       * Optional. The type of the layout element that is being referenced if
-       * any.
+       * Optional. The type of the layout element that is being referenced if any.
        * 
* * @@ -47039,16 +49107,14 @@ public int getLayoutTypeValue() { * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The layoutId. */ @java.lang.Override @@ -47068,16 +49134,14 @@ public java.lang.String getLayoutId() { * * *
-       * Optional. Deprecated.  Use
-       * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-       * instead.
+       * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
        * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Override @@ -47100,8 +49164,7 @@ public com.google.protobuf.ByteString getLayoutIdBytes() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -47118,8 +49181,7 @@ public boolean hasBoundingPoly() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -47138,8 +49200,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly getBoundingPoly() { * * *
-       * Optional. Identifies the bounding polygon of a layout element on the
-       * page.
+       * Optional. Identifies the bounding polygon of a layout element on the page.
        * 
* * @@ -47157,8 +49218,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPolyOrBuilder getBoundingPoly * * *
-       * Optional. Confidence of detected page element, if applicable. Range [0,
-       * 1].
+       * Optional. Confidence of detected page element, if applicable. Range [0, 1].
        * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -47587,11 +49647,9 @@ public Builder mergeFrom( * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]
-         * element, for example using [Document.pages][page_refs.page] to locate
-         * the related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -47607,11 +49665,9 @@ public long getPage() { * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]
-         * element, for example using [Document.pages][page_refs.page] to locate
-         * the related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -47630,11 +49686,9 @@ public Builder setPage(long value) { * * *
-         * Required. Index into the
-         * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]
-         * element, for example using [Document.pages][page_refs.page] to locate
-         * the related page element. This field is skipped when its value is the
-         * default 0. See
+         * Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using
+         * [Document.pages][page_refs.page] to locate the related page element.
+         * This field is skipped when its value is the default 0. See
          * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* @@ -47654,8 +49708,7 @@ public Builder clearPage() { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47672,8 +49725,7 @@ public int getLayoutTypeValue() { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47693,8 +49745,7 @@ public Builder setLayoutTypeValue(int value) { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47719,8 +49770,7 @@ public Builder setLayoutTypeValue(int value) { * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47744,8 +49794,7 @@ public Builder setLayoutType( * * *
-         * Optional. The type of the layout element that is being referenced if
-         * any.
+         * Optional. The type of the layout element that is being referenced if any.
          * 
* * @@ -47766,16 +49815,14 @@ public Builder clearLayoutType() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The layoutId. */ @java.lang.Deprecated @@ -47794,16 +49841,14 @@ public java.lang.String getLayoutId() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return The bytes for layoutId. */ @java.lang.Deprecated @@ -47822,16 +49867,14 @@ public com.google.protobuf.ByteString getLayoutIdBytes() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @param value The layoutId to set. * @return This builder for chaining. */ @@ -47849,16 +49892,14 @@ public Builder setLayoutId(java.lang.String value) { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @return This builder for chaining. */ @java.lang.Deprecated @@ -47872,16 +49913,14 @@ public Builder clearLayoutId() { * * *
-         * Optional. Deprecated.  Use
-         * [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly]
-         * instead.
+         * Optional. Deprecated.  Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead.
          * 
* * string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * * @deprecated google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.layout_id is - * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=628 + * deprecated. See google/cloud/documentai/v1beta3/document.proto;l=599 * @param value The bytes for layoutId to set. * @return This builder for chaining. */ @@ -47907,8 +49946,7 @@ public Builder setLayoutIdBytes(com.google.protobuf.ByteString value) { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47924,8 +49962,7 @@ public boolean hasBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47947,8 +49984,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly getBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47972,8 +50008,7 @@ public Builder setBoundingPoly(com.google.cloud.documentai.v1beta3.BoundingPoly * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -47995,8 +50030,7 @@ public Builder setBoundingPoly( * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -48024,8 +50058,7 @@ public Builder mergeBoundingPoly(com.google.cloud.documentai.v1beta3.BoundingPol * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -48047,8 +50080,7 @@ public Builder clearBoundingPoly() { * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -48064,8 +50096,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -48086,8 +50117,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * Optional. Identifies the bounding polygon of a layout element on the
-         * page.
+         * Optional. Identifies the bounding polygon of a layout element on the page.
          * 
* * @@ -48116,8 +50146,7 @@ public com.google.cloud.documentai.v1beta3.BoundingPoly.Builder getBoundingPolyB * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -48132,8 +50161,7 @@ public float getConfidence() { * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -48151,8 +50179,7 @@ public Builder setConfidence(float value) { * * *
-         * Optional. Confidence of detected page element, if applicable. Range [0,
-         * 1].
+         * Optional. Confidence of detected page element, if applicable. Range [0, 1].
          * 
* * float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -48466,9 +50493,8 @@ protected Builder newBuilderForType( * * *
-     * Referencing the visual context of the entity in the
-     * [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page
-     * anchors can be cross-page, consist of multiple bounding polygons and
+     * Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1beta3.Document.pages].
+     * Page anchors can be cross-page, consist of multiple bounding polygons and
      * optionally reference specific layout element types.
      * 
* @@ -49137,7 +51163,7 @@ public interface ProvenanceOrBuilder * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1beta3/document.proto;l=692 + * google/cloud/documentai/v1beta3/document.proto;l=663 * @return The id. */ @java.lang.Deprecated @@ -49647,7 +51673,7 @@ public interface ParentOrBuilder * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.Parent.id is deprecated. - * See google/cloud/documentai/v1beta3/document.proto;l=658 + * See google/cloud/documentai/v1beta3/document.proto;l=629 * @return The id. */ @java.lang.Deprecated @@ -49805,7 +51831,7 @@ public int getIndex() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.Parent.id is deprecated. - * See google/cloud/documentai/v1beta3/document.proto;l=658 + * See google/cloud/documentai/v1beta3/document.proto;l=629 * @return The id. */ @java.lang.Override @@ -50294,7 +52320,7 @@ public Builder clearIndex() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.Parent.id is deprecated. - * See google/cloud/documentai/v1beta3/document.proto;l=658 + * See google/cloud/documentai/v1beta3/document.proto;l=629 * @return The id. */ @java.lang.Override @@ -50312,7 +52338,7 @@ public int getId() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.Parent.id is deprecated. - * See google/cloud/documentai/v1beta3/document.proto;l=658 + * See google/cloud/documentai/v1beta3/document.proto;l=629 * @param value The id to set. * @return This builder for chaining. */ @@ -50333,7 +52359,7 @@ public Builder setId(int value) { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.Parent.id is deprecated. - * See google/cloud/documentai/v1beta3/document.proto;l=658 + * See google/cloud/documentai/v1beta3/document.proto;l=629 * @return This builder for chaining. */ @java.lang.Deprecated @@ -50430,7 +52456,7 @@ public int getRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1beta3/document.proto;l=692 + * google/cloud/documentai/v1beta3/document.proto;l=663 * @return The id. */ @java.lang.Override @@ -51035,7 +53061,7 @@ public Builder clearRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1beta3/document.proto;l=692 + * google/cloud/documentai/v1beta3/document.proto;l=663 * @return The id. */ @java.lang.Override @@ -51054,7 +53080,7 @@ public int getId() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1beta3/document.proto;l=692 + * google/cloud/documentai/v1beta3/document.proto;l=663 * @param value The id to set. * @return This builder for chaining. */ @@ -51076,7 +53102,7 @@ public Builder setId(int value) { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1beta3/document.proto;l=692 + * google/cloud/documentai/v1beta3/document.proto;l=663 * @return This builder for chaining. */ @java.lang.Deprecated @@ -51740,10 +53766,13 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return A list containing the parent. */ + @java.lang.Deprecated java.util.List getParentList(); /** * @@ -51754,10 +53783,13 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated int getParentCount(); /** * @@ -51768,13 +53800,75 @@ public interface RevisionOrBuilder * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated int getParent(int index); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + java.util.List getParentIdsList(); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + int getParentIdsCount(); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + java.lang.String getParentIds(int index); + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + com.google.protobuf.ByteString getParentIdsBytes(int index); + /** * * @@ -51870,6 +53964,7 @@ private Revision(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Revision() { id_ = ""; parent_ = emptyIntList(); + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -51977,6 +54072,16 @@ private Revision( humanReview_ = subBuilder.buildPartial(); } + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + parentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + parentIds_.add(s); break; } default: @@ -51998,6 +54103,9 @@ private Revision( if (((mutable_bitField0_ & 0x00000001) != 0)) { parent_.makeImmutable(); // C } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + parentIds_ = parentIds_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -53152,11 +55260,14 @@ public com.google.protobuf.ByteString getIdBytes() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return A list containing the parent. */ @java.lang.Override + @java.lang.Deprecated public java.util.List getParentList() { return parent_; } @@ -53169,10 +55280,13 @@ public java.util.List getParentList() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated public int getParentCount() { return parent_.size(); } @@ -53185,17 +55299,89 @@ public int getParentCount() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated public int getParent(int index) { return parent_.getInt(index); } private int parentMemoizedSerializedSize = -1; + public static final int PARENT_IDS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList parentIds_; + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + public com.google.protobuf.ProtocolStringList getParentIdsList() { + return parentIds_; + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + public int getParentIdsCount() { + return parentIds_.size(); + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + public java.lang.String getParentIds(int index) { + return parentIds_.get(index); + } + /** + * + * + *
+     * The revisions that this revision is based on. Must include all the ids
+     * that have anything to do with this revision - eg. there are
+     * `provenance.parent.revision` fields that index into this field.
+     * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + public com.google.protobuf.ByteString getParentIdsBytes(int index) { + return parentIds_.getByteString(index); + } + public static final int CREATE_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp createTime_; /** @@ -53328,6 +55514,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (humanReview_ != null) { output.writeMessage(6, getHumanReview()); } + for (int i = 0; i < parentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, parentIds_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -53365,6 +55554,14 @@ public int getSerializedSize() { if (humanReview_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getHumanReview()); } + { + int dataSize = 0; + for (int i = 0; i < parentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(parentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getParentIdsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -53383,6 +55580,7 @@ public boolean equals(final java.lang.Object obj) { if (!getId().equals(other.getId())) return false; if (!getParentList().equals(other.getParentList())) return false; + if (!getParentIdsList().equals(other.getParentIdsList())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -53419,6 +55617,10 @@ public int hashCode() { hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParentList().hashCode(); } + if (getParentIdsCount() > 0) { + hash = (37 * hash) + PARENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getParentIdsList().hashCode(); + } if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -53591,6 +55793,8 @@ public Builder clear() { parent_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000001); + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -53645,6 +55849,11 @@ public com.google.cloud.documentai.v1beta3.Document.Revision buildPartial() { bitField0_ = (bitField0_ & ~0x00000001); } result.parent_ = parent_; + if (((bitField0_ & 0x00000002) != 0)) { + parentIds_ = parentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parentIds_ = parentIds_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -53722,6 +55931,16 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Document.Revision o } onChanged(); } + if (!other.parentIds_.isEmpty()) { + if (parentIds_.isEmpty()) { + parentIds_ = other.parentIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureParentIdsIsMutable(); + parentIds_.addAll(other.parentIds_); + } + onChanged(); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -54197,10 +56416,13 @@ private void ensureParentIsMutable() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return A list containing the parent. */ + @java.lang.Deprecated public java.util.List getParentList() { return ((bitField0_ & 0x00000001) != 0) ? java.util.Collections.unmodifiableList(parent_) @@ -54215,10 +56437,13 @@ public java.util.List getParentList() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return The count of parent. */ + @java.lang.Deprecated public int getParentCount() { return parent_.size(); } @@ -54231,11 +56456,14 @@ public int getParentCount() { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param index The index of the element to return. * @return The parent at the given index. */ + @java.lang.Deprecated public int getParent(int index) { return parent_.getInt(index); } @@ -54248,12 +56476,15 @@ public int getParent(int index) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param index The index to set the value at. * @param value The parent to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setParent(int index, int value) { ensureParentIsMutable(); parent_.setInt(index, value); @@ -54269,11 +56500,14 @@ public Builder setParent(int index, int value) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param value The parent to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addParent(int value) { ensureParentIsMutable(); parent_.addInt(value); @@ -54289,11 +56523,14 @@ public Builder addParent(int value) { * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @param values The parent to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllParent(java.lang.Iterable values) { ensureParentIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parent_); @@ -54309,10 +56546,13 @@ public Builder addAllParent(java.lang.Iterable valu * index into the `revisions` field. * * - * repeated int32 parent = 2; + * repeated int32 parent = 2 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1beta3.Document.Revision.parent is deprecated. See + * google/cloud/documentai/v1beta3/document.proto;l=701 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearParent() { parent_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000001); @@ -54320,6 +56560,192 @@ public Builder clearParent() { return this; } + private com.google.protobuf.LazyStringList parentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureParentIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parentIds_ = new com.google.protobuf.LazyStringArrayList(parentIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return A list containing the parentIds. + */ + public com.google.protobuf.ProtocolStringList getParentIdsList() { + return parentIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return The count of parentIds. + */ + public int getParentIdsCount() { + return parentIds_.size(); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the element to return. + * @return The parentIds at the given index. + */ + public java.lang.String getParentIds(int index) { + return parentIds_.get(index); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the parentIds at the given index. + */ + public com.google.protobuf.ByteString getParentIdsBytes(int index) { + return parentIds_.getByteString(index); + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param index The index to set the value at. + * @param value The parentIds to set. + * @return This builder for chaining. + */ + public Builder setParentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParentIdsIsMutable(); + parentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param value The parentIds to add. + * @return This builder for chaining. + */ + public Builder addParentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParentIdsIsMutable(); + parentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param values The parentIds to add. + * @return This builder for chaining. + */ + public Builder addAllParentIds(java.lang.Iterable values) { + ensureParentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parentIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @return This builder for chaining. + */ + public Builder clearParentIds() { + parentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The revisions that this revision is based on. Must include all the ids
+       * that have anything to do with this revision - eg. there are
+       * `provenance.parent.revision` fields that index into this field.
+       * 
+ * + * repeated string parent_ids = 7; + * + * @param value The bytes of the parentIds to add. + * @return This builder for chaining. + */ + public Builder addParentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureParentIdsIsMutable(); + parentIds_.add(value); + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -54770,11 +57196,10 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -54787,11 +57212,10 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -54804,11 +57228,10 @@ public interface TextChangeOrBuilder * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55031,11 +57454,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55051,11 +57473,10 @@ public boolean hasTextAnchor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55073,11 +57494,10 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * *
      * Provenance of the correction.
-     * Text anchor indexing into the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-     * can only be a single `TextAnchor.text_segments` element.  If the start
-     * and end index of the text segment are the same, the text change is
-     * inserted before that index.
+     * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+     * single `TextAnchor.text_segments` element.  If the start and
+     * end index of the text segment are the same, the text change is inserted
+     * before that index.
      * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55629,11 +58049,10 @@ public Builder mergeFrom( * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55648,11 +58067,10 @@ public boolean hasTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55673,11 +58091,10 @@ public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55700,11 +58117,10 @@ public Builder setTextAnchor(com.google.cloud.documentai.v1beta3.Document.TextAn * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55725,11 +58141,10 @@ public Builder setTextAnchor( * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55757,11 +58172,10 @@ public Builder mergeTextAnchor( * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55782,11 +58196,10 @@ public Builder clearTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55802,11 +58215,10 @@ public Builder clearTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -55826,11 +58238,10 @@ public Builder clearTextAnchor() { * *
        * Provenance of the correction.
-       * Text anchor indexing into the
-       * [Document.text][google.cloud.documentai.v1beta3.Document.text].  There
-       * can only be a single `TextAnchor.text_segments` element.  If the start
-       * and end index of the text segment are the same, the text change is
-       * inserted before that index.
+       * Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text].  There can only be a
+       * single `TextAnchor.text_segments` element.  If the start and
+       * end index of the text segment are the same, the text change is inserted
+       * before that index.
        * 
* * .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1; @@ -56652,8 +59063,7 @@ public com.google.protobuf.ByteString getTextBytes() { * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -56666,8 +59076,7 @@ public java.util.List getTex * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -56681,8 +59090,7 @@ public java.util.List getTex * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -56695,8 +59103,7 @@ public int getTextStylesCount() { * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -56709,8 +59116,7 @@ public com.google.cloud.documentai.v1beta3.Document.Style getTextStyles(int inde * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -56727,8 +59133,7 @@ public com.google.cloud.documentai.v1beta3.Document.StyleOrBuilder getTextStyles * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -56741,8 +59146,7 @@ public java.util.List getPage * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -56756,8 +59160,7 @@ public java.util.List getPage * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -56770,8 +59173,7 @@ public int getPagesCount() { * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -56784,8 +59186,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page getPages(int index) { * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -56801,9 +59202,8 @@ public com.google.cloud.documentai.v1beta3.Document.PageOrBuilder getPagesOrBuil * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -56816,9 +59216,8 @@ public java.util.List getEn * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -56832,9 +59231,8 @@ public java.util.List getEn * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -56847,9 +59245,8 @@ public int getEntitiesCount() { * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -56862,9 +59259,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity getEntities(int index * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -56882,8 +59278,7 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getEntitiesO * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -56898,8 +59293,7 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getEntitiesO * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -56915,8 +59309,7 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getEntitiesO * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -56930,8 +59323,7 @@ public int getEntityRelationsCount() { * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -56945,8 +59337,7 @@ public com.google.cloud.documentai.v1beta3.Document.EntityRelation getEntityRela * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -57509,11 +59900,10 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Document represents the canonical document resource in Document Understanding
-   * AI.
-   * It is an interchange format that provides insights into documents and allows
-   * for collaboration between users and Document Understanding AI to iterate and
-   * optimize for quality.
+   * Document represents the canonical document resource in Document AI. It is an
+   * interchange format that provides insights into documents and allows for
+   * collaboration between users and Document AI to iterate and optimize for
+   * quality.
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Document} @@ -58486,8 +60876,7 @@ private void ensureTextStylesIsMutable() { * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58503,8 +60892,7 @@ public java.util.List getTex * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58520,8 +60908,7 @@ public int getTextStylesCount() { * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58537,8 +60924,7 @@ public com.google.cloud.documentai.v1beta3.Document.Style getTextStyles(int inde * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58561,8 +60947,7 @@ public Builder setTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58582,8 +60967,7 @@ public Builder setTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58605,8 +60989,7 @@ public Builder addTextStyles(com.google.cloud.documentai.v1beta3.Document.Style * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58629,8 +61012,7 @@ public Builder addTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58650,8 +61032,7 @@ public Builder addTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58671,8 +61052,7 @@ public Builder addTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58692,8 +61072,7 @@ public Builder addAllTextStyles( * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58712,8 +61091,7 @@ public Builder clearTextStyles() { * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58732,8 +61110,7 @@ public Builder removeTextStyles(int index) { * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58746,8 +61123,7 @@ public com.google.cloud.documentai.v1beta3.Document.Style.Builder getTextStylesB * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58764,8 +61140,7 @@ public com.google.cloud.documentai.v1beta3.Document.StyleOrBuilder getTextStyles * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58782,8 +61157,7 @@ public com.google.cloud.documentai.v1beta3.Document.StyleOrBuilder getTextStyles * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58796,8 +61170,7 @@ public com.google.cloud.documentai.v1beta3.Document.Style.Builder addTextStylesB * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58812,8 +61185,7 @@ public com.google.cloud.documentai.v1beta3.Document.Style.Builder addTextStylesB * * *
-     * Placeholder.  Styles for the
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+     * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -58860,8 +61232,7 @@ private void ensurePagesIsMutable() { * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58877,8 +61248,7 @@ public java.util.List getPage * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58894,8 +61264,7 @@ public int getPagesCount() { * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58911,8 +61280,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page getPages(int index) { * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58934,8 +61302,7 @@ public Builder setPages(int index, com.google.cloud.documentai.v1beta3.Document. * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58955,8 +61322,7 @@ public Builder setPages( * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -58978,8 +61344,7 @@ public Builder addPages(com.google.cloud.documentai.v1beta3.Document.Page value) * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59001,8 +61366,7 @@ public Builder addPages(int index, com.google.cloud.documentai.v1beta3.Document. * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59022,8 +61386,7 @@ public Builder addPages( * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59043,8 +61406,7 @@ public Builder addPages( * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59064,8 +61426,7 @@ public Builder addAllPages( * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59084,8 +61445,7 @@ public Builder clearPages() { * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59104,8 +61464,7 @@ public Builder removePages(int index) { * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59117,8 +61476,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Builder getPagesBuilder * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59134,8 +61492,7 @@ public com.google.cloud.documentai.v1beta3.Document.PageOrBuilder getPagesOrBuil * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59152,8 +61509,7 @@ public com.google.cloud.documentai.v1beta3.Document.PageOrBuilder getPagesOrBuil * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59166,8 +61522,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Builder addPagesBuilder * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59181,8 +61536,7 @@ public com.google.cloud.documentai.v1beta3.Document.Page.Builder addPagesBuilder * * *
-     * Visual page layout for the
-     * [Document][google.cloud.documentai.v1beta3.Document].
+     * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -59230,9 +61584,8 @@ private void ensureEntitiesIsMutable() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59248,9 +61601,8 @@ public java.util.List getEn * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59266,9 +61618,8 @@ public int getEntitiesCount() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59284,9 +61635,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity getEntities(int index * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59309,9 +61659,8 @@ public Builder setEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59331,9 +61680,8 @@ public Builder setEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59355,9 +61703,8 @@ public Builder addEntities(com.google.cloud.documentai.v1beta3.Document.Entity v * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59380,9 +61727,8 @@ public Builder addEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59402,9 +61748,8 @@ public Builder addEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59424,9 +61769,8 @@ public Builder addEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59446,9 +61790,8 @@ public Builder addAllEntities( * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59467,9 +61810,8 @@ public Builder clearEntities() { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59488,9 +61830,8 @@ public Builder removeEntities(int index) { * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59503,9 +61844,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder getEntitiesBu * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59522,9 +61862,8 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getEntitiesO * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59541,9 +61880,8 @@ public com.google.cloud.documentai.v1beta3.Document.EntityOrBuilder getEntitiesO * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59556,9 +61894,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder addEntitiesBu * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59573,9 +61910,8 @@ public com.google.cloud.documentai.v1beta3.Document.Entity.Builder addEntitiesBu * * *
-     * A list of entities detected on
-     * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-     * document shards, entities in this list may cross shard boundaries.
+     * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+     * entities in this list may cross shard boundaries.
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -59624,8 +61960,7 @@ private void ensureEntityRelationsIsMutable() { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59643,8 +61978,7 @@ private void ensureEntityRelationsIsMutable() { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59661,8 +61995,7 @@ public int getEntityRelationsCount() { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59680,8 +62013,7 @@ public com.google.cloud.documentai.v1beta3.Document.EntityRelation getEntityRela * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59705,8 +62037,7 @@ public Builder setEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59728,8 +62059,7 @@ public Builder setEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59753,8 +62083,7 @@ public Builder addEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59778,8 +62107,7 @@ public Builder addEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59800,8 +62128,7 @@ public Builder addEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59823,8 +62150,7 @@ public Builder addEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59846,8 +62172,7 @@ public Builder addAllEntityRelations( * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59867,8 +62192,7 @@ public Builder clearEntityRelations() { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59888,8 +62212,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59903,8 +62226,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59922,8 +62244,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59942,8 +62263,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59959,8 +62279,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -59977,8 +62296,7 @@ public Builder removeEntityRelations(int index) { * * *
-     * Placeholder.  Relationship among
-     * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+     * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
      * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiDocumentSchema.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiDocumentSchema.java new file mode 100644 index 00000000000..d9489edda6a --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiDocumentSchema.java @@ -0,0 +1,150 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1beta3/document_schema.proto + +package com.google.cloud.documentai.v1beta3; + +public final class DocumentAiDocumentSchema { + private DocumentAiDocumentSchema() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/documentai/v1beta3/docume" + + "nt_schema.proto\022\037google.cloud.documentai" + + ".v1beta3\"\300\007\n\016DocumentSchema\022\024\n\014display_n" + + "ame\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022P\n\014entity" + + "_types\030\003 \003(\0132:.google.cloud.documentai.v" + + "1beta3.DocumentSchema.EntityType\022J\n\010meta" + + "data\030\004 \001(\01328.google.cloud.documentai.v1b" + + "eta3.DocumentSchema.Metadata\032\315\004\n\nEntityT" + + "ype\022\\\n\013enum_values\030\016 \001(\0132E.google.cloud." + + "documentai.v1beta3.DocumentSchema.Entity" + + "Type.EnumValuesH\000\022\024\n\014display_name\030\r \001(\t\022" + + "\014\n\004name\030\001 \001(\t\022\022\n\nbase_types\030\002 \003(\t\022W\n\npro" + + "perties\030\006 \003(\0132C.google.cloud.documentai." + + "v1beta3.DocumentSchema.EntityType.Proper" + + "ty\032\034\n\nEnumValues\022\016\n\006values\030\001 \003(\t\032\241\002\n\010Pro" + + "perty\022\014\n\004name\030\001 \001(\t\022\022\n\nvalue_type\030\002 \001(\t\022" + + "k\n\017occurrence_type\030\003 \001(\0162R.google.cloud." + + "documentai.v1beta3.DocumentSchema.Entity" + + "Type.Property.OccurrenceType\"\205\001\n\016Occurre" + + "nceType\022\037\n\033OCCURRENCE_TYPE_UNSPECIFIED\020\000" + + "\022\021\n\rOPTIONAL_ONCE\020\001\022\025\n\021OPTIONAL_MULTIPLE" + + "\020\002\022\021\n\rREQUIRED_ONCE\020\003\022\025\n\021REQUIRED_MULTIP" + + "LE\020\004B\016\n\014value_source\032\224\001\n\010Metadata\022\031\n\021doc" + + "ument_splitter\030\001 \001(\010\022&\n\036document_allow_m" + + "ultiple_labels\030\002 \001(\010\022%\n\035prefixed_naming_" + + "on_properties\030\006 \001(\010\022\036\n\026skip_naming_valid" + + "ation\030\007 \001(\010B\365\001\n#com.google.cloud.documen" + + "tai.v1beta3B\030DocumentAiDocumentSchemaP\001Z" + + "Igoogle.golang.org/genproto/googleapis/c" + + "loud/documentai/v1beta3;documentai\252\002\037Goo" + + "gle.Cloud.DocumentAI.V1Beta3\312\002\037Google\\Cl" + + "oud\\DocumentAI\\V1beta3\352\002\"Google::Cloud::" + + "DocumentAI::V1beta3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor, + new java.lang.String[] { + "DisplayName", "Description", "EntityTypes", "Metadata", + }); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor = + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor, + new java.lang.String[] { + "EnumValues", "DisplayName", "Name", "BaseTypes", "Properties", "ValueSource", + }); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor = + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor = + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor, + new java.lang.String[] { + "Name", "ValueType", "OccurrenceType", + }); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor = + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor, + new java.lang.String[] { + "DocumentSplitter", + "DocumentAllowMultipleLabels", + "PrefixedNamingOnProperties", + "SkipNamingValidation", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java index 8991e55f0c4..5fdd89f2fc3 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java @@ -27,6 +27,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1beta3_Processor_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -43,29 +51,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n/google/cloud/documentai/v1beta3/proces" + "sor.proto\022\037google.cloud.documentai.v1bet" + "a3\032\037google/api/field_behavior.proto\032\031goo" - + "gle/api/resource.proto\0321google/cloud/doc" - + "umentai/v1beta3/document_io.proto\032\037googl" - + "e/protobuf/timestamp.proto\032\034google/api/a" - + "nnotations.proto\"\201\004\n\tProcessor\022\024\n\004name\030\001" - + " \001(\tB\006\340A\005\340A\003\022\014\n\004type\030\002 \001(\t\022\024\n\014display_na" - + "me\030\003 \001(\t\022D\n\005state\030\004 \001(\01620.google.cloud.d" - + "ocumentai.v1beta3.Processor.StateB\003\340A\003\022!" - + "\n\031default_processor_version\030\t \001(\t\022 \n\020pro" - + "cess_endpoint\030\006 \001(\tB\006\340A\003\340A\005\022/\n\013create_ti" - + "me\030\007 \001(\0132\032.google.protobuf.Timestamp\022\024\n\014" - + "kms_key_name\030\010 \001(\t\"~\n\005State\022\025\n\021STATE_UNS" - + "PECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DISABLED\020\002\022\014\n" - + "\010ENABLING\020\003\022\r\n\tDISABLING\020\004\022\014\n\010CREATING\020\005" - + "\022\n\n\006FAILED\020\006\022\014\n\010DELETING\020\007:h\352Ae\n#documen" - + "tai.googleapis.com/Processor\022>projects/{" - + "project}/locations/{location}/processors" - + "/{processor}B\360\001\n#com.google.cloud.docume" - + "ntai.v1beta3B\023DocumentAiProcessorP\001ZIgoo" - + "gle.golang.org/genproto/googleapis/cloud" - + "/documentai/v1beta3;documentai\252\002\037Google." - + "Cloud.DocumentAI.V1Beta3\312\002\037Google\\Cloud\\" - + "DocumentAI\\V1beta3\352\002\"Google::Cloud::Docu" - + "mentAI::V1beta3b\006proto3" + + "gle/api/resource.proto\032\037google/protobuf/" + + "timestamp.proto\"\232\006\n\020ProcessorVersion\022\014\n\004" + + "name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022F\n\005stat" + + "e\030\006 \001(\01627.google.cloud.documentai.v1beta" + + "3.ProcessorVersion.State\022/\n\013create_time\030" + + "\007 \001(\0132\032.google.protobuf.Timestamp\022\024\n\014kms" + + "_key_name\030\t \001(\t\022\034\n\024kms_key_version_name\030" + + "\n \001(\t\022\026\n\016google_managed\030\013 \001(\010\022[\n\020depreca" + + "tion_info\030\r \001(\0132A.google.cloud.documenta" + + "i.v1beta3.ProcessorVersion.DeprecationIn" + + "fo\032\237\001\n\017DeprecationInfo\0224\n\020deprecation_ti" + + "me\030\001 \001(\0132\032.google.protobuf.Timestamp\022V\n\035" + + "replacement_processor_version\030\002 \001(\tB/\372A," + + "\n*documentai.googleapis.com/ProcessorVer" + + "sion\"\204\001\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n" + + "\010DEPLOYED\020\001\022\r\n\tDEPLOYING\020\002\022\016\n\nUNDEPLOYED" + + "\020\003\022\017\n\013UNDEPLOYING\020\004\022\014\n\010CREATING\020\005\022\014\n\010DEL" + + "ETING\020\006\022\n\n\006FAILED\020\007:\226\001\352A\222\001\n*documentai.g" + + "oogleapis.com/ProcessorVersion\022dprojects" + + "/{project}/locations/{location}/processo" + + "rs/{processor}/processorVersions/{proces" + + "sor_version}\"\262\004\n\tProcessor\022\024\n\004name\030\001 \001(\t" + + "B\006\340A\005\340A\003\022\014\n\004type\030\002 \001(\t\022\024\n\014display_name\030\003" + + " \001(\t\022D\n\005state\030\004 \001(\01620.google.cloud.docum" + + "entai.v1beta3.Processor.StateB\003\340A\003\022R\n\031de" + + "fault_processor_version\030\t \001(\tB/\372A,\n*docu" + + "mentai.googleapis.com/ProcessorVersion\022 " + + "\n\020process_endpoint\030\006 \001(\tB\006\340A\003\340A\005\022/\n\013crea" + + "te_time\030\007 \001(\0132\032.google.protobuf.Timestam" + + "p\022\024\n\014kms_key_name\030\010 \001(\t\"~\n\005State\022\025\n\021STAT" + + "E_UNSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DISABLED" + + "\020\002\022\014\n\010ENABLING\020\003\022\r\n\tDISABLING\020\004\022\014\n\010CREAT" + + "ING\020\005\022\n\n\006FAILED\020\006\022\014\n\010DELETING\020\007:h\352Ae\n#do" + + "cumentai.googleapis.com/Processor\022>proje" + + "cts/{project}/locations/{location}/proce" + + "ssors/{processor}B\360\001\n#com.google.cloud.d" + + "ocumentai.v1beta3B\023DocumentAiProcessorP\001" + + "ZIgoogle.golang.org/genproto/googleapis/" + + "cloud/documentai/v1beta3;documentai\252\002\037Go" + + "ogle.Cloud.DocumentAI.V1Beta3\312\002\037Google\\C" + + "loud\\DocumentAI\\V1beta3\352\002\"Google::Cloud:" + + ":DocumentAI::V1beta3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -73,12 +100,35 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), - com.google.cloud.documentai.v1beta3.DocumentIoProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); - internal_static_google_cloud_documentai_v1beta3_Processor_descriptor = + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "State", + "CreateTime", + "KmsKeyName", + "KmsKeyVersionName", + "GoogleManaged", + "DeprecationInfo", + }); + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor = + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor, + new java.lang.String[] { + "DeprecationTime", "ReplacementProcessorVersion", + }); + internal_static_google_cloud_documentai_v1beta3_Processor_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_documentai_v1beta3_Processor_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_Processor_descriptor, @@ -96,13 +146,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); - com.google.cloud.documentai.v1beta3.DocumentIoProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java index 6833459e7fc..51df45e7298 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java @@ -71,6 +71,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -79,6 +87,54 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -115,6 +171,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1beta3_ReviewDocumentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -143,186 +211,293 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "le/api/field_behavior.proto\032\031google/api/" + "resource.proto\032.google/cloud/documentai/" + "v1beta3/document.proto\0321google/cloud/doc" - + "umentai/v1beta3/document_io.proto\0328googl" - + "e/cloud/documentai/v1beta3/operation_met" - + "adata.proto\032/google/cloud/documentai/v1b" - + "eta3/processor.proto\0324google/cloud/docum" - + "entai/v1beta3/processor_type.proto\032#goog" - + "le/longrunning/operations.proto\032 google/" - + "protobuf/field_mask.proto\032\037google/protob" - + "uf/timestamp.proto\032\027google/rpc/status.pr" - + "oto\"\275\002\n\016ProcessRequest\022D\n\017inline_documen" - + "t\030\004 \001(\0132).google.cloud.documentai.v1beta" - + "3.DocumentH\000\022D\n\014raw_document\030\005 \001(\0132,.goo" - + "gle.cloud.documentai.v1beta3.RawDocument" - + "H\000\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documentai.goo" - + "gleapis.com/Processor\022?\n\010document\030\002 \001(\0132" - + ").google.cloud.documentai.v1beta3.Docume" - + "ntB\002\030\001\022\031\n\021skip_human_review\030\003 \001(\010B\010\n\006sou" - + "rce\"\363\001\n\021HumanReviewStatus\022G\n\005state\030\001 \001(\016" - + "28.google.cloud.documentai.v1beta3.Human" - + "ReviewStatus.State\022\025\n\rstate_message\030\002 \001(" - + "\t\022\036\n\026human_review_operation\030\003 \001(\t\"^\n\005Sta" - + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025" - + "\n\021VALIDATION_PASSED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t" - + "\n\005ERROR\020\004\"\303\001\n\017ProcessResponse\022;\n\010documen" - + "t\030\001 \001(\0132).google.cloud.documentai.v1beta" - + "3.Document\022\"\n\026human_review_operation\030\002 \001" - + "(\tB\002\030\001\022O\n\023human_review_status\030\003 \001(\01322.go" - + "ogle.cloud.documentai.v1beta3.HumanRevie" - + "wStatus\"\315\004\n\023BatchProcessRequest\0229\n\004name\030" - + "\001 \001(\tB+\340A\002\372A%\n#documentai.googleapis.com" - + "/Processor\022`\n\rinput_configs\030\002 \003(\0132E.goog" - + "le.cloud.documentai.v1beta3.BatchProcess" - + "Request.BatchInputConfigB\002\030\001\022a\n\routput_c" - + "onfig\030\003 \001(\0132F.google.cloud.documentai.v1" - + "beta3.BatchProcessRequest.BatchOutputCon" - + "figB\002\030\001\022S\n\017input_documents\030\005 \001(\0132:.googl" - + "e.cloud.documentai.v1beta3.BatchDocument" - + "sInputConfig\022U\n\026document_output_config\030\006" - + " \001(\01325.google.cloud.documentai.v1beta3.D" - + "ocumentOutputConfig\022\031\n\021skip_human_review" - + "\030\004 \001(\010\032=\n\020BatchInputConfig\022\022\n\ngcs_source" - + "\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t:\002\030\001\0320\n\021BatchOu" - + "tputConfig\022\027\n\017gcs_destination\030\001 \001(\t:\002\030\001\"" - + "\026\n\024BatchProcessResponse\"\262\005\n\024BatchProcess" - + "Metadata\022J\n\005state\030\001 \001(\0162;.google.cloud.d" - + "ocumentai.v1beta3.BatchProcessMetadata.S" - + "tate\022\025\n\rstate_message\030\002 \001(\t\022/\n\013create_ti" - + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\022/\n\013" - + "update_time\030\004 \001(\0132\032.google.protobuf.Time" - + "stamp\022r\n\033individual_process_statuses\030\005 \003" - + "(\0132M.google.cloud.documentai.v1beta3.Bat" - + "chProcessMetadata.IndividualProcessStatu" - + "s\032\354\001\n\027IndividualProcessStatus\022\030\n\020input_g" - + "cs_source\030\001 \001(\t\022\"\n\006status\030\002 \001(\0132\022.google" - + ".rpc.Status\022\036\n\026output_gcs_destination\030\003 " - + "\001(\t\022\"\n\026human_review_operation\030\004 \001(\tB\002\030\001\022" - + "O\n\023human_review_status\030\005 \001(\01322.google.cl" - + "oud.documentai.v1beta3.HumanReviewStatus" - + "\"r\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007WAIT" - + "ING\020\001\022\013\n\007RUNNING\020\002\022\r\n\tSUCCEEDED\020\003\022\016\n\nCAN" - + "CELLING\020\004\022\r\n\tCANCELLED\020\005\022\n\n\006FAILED\020\006\"]\n\032" - + "FetchProcessorTypesRequest\022?\n\006parent\030\001 \001" - + "(\tB/\340A\002\372A)\022\'documentai.googleapis.com/Pr" - + "ocessorType\"f\n\033FetchProcessorTypesRespon" - + "se\022G\n\017processor_types\030\001 \003(\0132..google.clo" - + "ud.documentai.v1beta3.ProcessorType\"{\n\025L" - + "istProcessorsRequest\022;\n\006parent\030\001 \001(\tB+\340A" - + "\002\372A%\022#documentai.googleapis.com/Processo" - + "r\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" - + "\"q\n\026ListProcessorsResponse\022>\n\nprocessors" - + "\030\001 \003(\0132*.google.cloud.documentai.v1beta3" - + ".Processor\022\027\n\017next_page_token\030\002 \001(\t\"\231\001\n\026" - + "CreateProcessorRequest\022;\n\006parent\030\001 \001(\tB+" - + "\340A\002\372A%\022#documentai.googleapis.com/Proces" - + "sor\022B\n\tprocessor\030\002 \001(\0132*.google.cloud.do" - + "cumentai.v1beta3.ProcessorB\003\340A\002\"S\n\026Delet" - + "eProcessorRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n" - + "#documentai.googleapis.com/Processor\"l\n\027" - + "DeleteProcessorMetadata\022Q\n\017common_metada" - + "ta\030\005 \001(\01328.google.cloud.documentai.v1bet" - + "a3.CommonOperationMetadata\"S\n\026EnableProc" - + "essorRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#docu" - + "mentai.googleapis.com/Processor\"\031\n\027Enabl" - + "eProcessorResponse\"l\n\027EnableProcessorMet" - + "adata\022Q\n\017common_metadata\030\005 \001(\01328.google." - + "cloud.documentai.v1beta3.CommonOperation" - + "Metadata\"T\n\027DisableProcessorRequest\0229\n\004n" + + "umentai/v1beta3/document_io.proto\0325googl" + + "e/cloud/documentai/v1beta3/document_sche" + + "ma.proto\0328google/cloud/documentai/v1beta" + + "3/operation_metadata.proto\032/google/cloud" + + "/documentai/v1beta3/processor.proto\0324goo" + + "gle/cloud/documentai/v1beta3/processor_t" + + "ype.proto\032#google/longrunning/operations" + + ".proto\032 google/protobuf/field_mask.proto" + + "\032\037google/protobuf/timestamp.proto\032\027googl" + + "e/rpc/status.proto\"\313\002\n\016ProcessRequest\022D\n" + + "\017inline_document\030\004 \001(\0132).google.cloud.do" + + "cumentai.v1beta3.DocumentH\000\022D\n\014raw_docum" + + "ent\030\005 \001(\0132,.google.cloud.documentai.v1be" + + "ta3.RawDocumentH\000\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n" + + "\001*\022?\n\010document\030\002 \001(\0132).google.cloud.docu" + + "mentai.v1beta3.DocumentB\002\030\001\022\031\n\021skip_huma" + + "n_review\030\003 \001(\010\022.\n\nfield_mask\030\006 \001(\0132\032.goo" + + "gle.protobuf.FieldMaskB\010\n\006source\"\363\001\n\021Hum" + + "anReviewStatus\022G\n\005state\030\001 \001(\01628.google.c" + + "loud.documentai.v1beta3.HumanReviewStatu" + + "s.State\022\025\n\rstate_message\030\002 \001(\t\022\036\n\026human_" + + "review_operation\030\003 \001(\t\"^\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025\n\021VALIDATIO" + + "N_PASSED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t\n\005ERROR\020\004\"\303" + + "\001\n\017ProcessResponse\022;\n\010document\030\001 \001(\0132).g" + + "oogle.cloud.documentai.v1beta3.Document\022" + + "\"\n\026human_review_operation\030\002 \001(\tB\002\030\001\022O\n\023h" + + "uman_review_status\030\003 \001(\01322.google.cloud." + + "documentai.v1beta3.HumanReviewStatus\"\253\004\n" + + "\023BatchProcessRequest\022\027\n\004name\030\001 \001(\tB\t\340A\002\372" + + "A\003\n\001*\022`\n\rinput_configs\030\002 \003(\0132E.google.cl" + + "oud.documentai.v1beta3.BatchProcessReque" + + "st.BatchInputConfigB\002\030\001\022a\n\routput_config" + + "\030\003 \001(\0132F.google.cloud.documentai.v1beta3" + + ".BatchProcessRequest.BatchOutputConfigB\002" + + "\030\001\022S\n\017input_documents\030\005 \001(\0132:.google.clo" + + "ud.documentai.v1beta3.BatchDocumentsInpu" + + "tConfig\022U\n\026document_output_config\030\006 \001(\0132" + + "5.google.cloud.documentai.v1beta3.Docume" + + "ntOutputConfig\022\031\n\021skip_human_review\030\004 \001(" + + "\010\032=\n\020BatchInputConfig\022\022\n\ngcs_source\030\001 \001(" + + "\t\022\021\n\tmime_type\030\002 \001(\t:\002\030\001\0320\n\021BatchOutputC" + + "onfig\022\027\n\017gcs_destination\030\001 \001(\t:\002\030\001\"\026\n\024Ba" + + "tchProcessResponse\"\262\005\n\024BatchProcessMetad" + + "ata\022J\n\005state\030\001 \001(\0162;.google.cloud.docume" + + "ntai.v1beta3.BatchProcessMetadata.State\022" + + "\025\n\rstate_message\030\002 \001(\t\022/\n\013create_time\030\003 " + + "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat" + + "e_time\030\004 \001(\0132\032.google.protobuf.Timestamp" + + "\022r\n\033individual_process_statuses\030\005 \003(\0132M." + + "google.cloud.documentai.v1beta3.BatchPro" + + "cessMetadata.IndividualProcessStatus\032\354\001\n" + + "\027IndividualProcessStatus\022\030\n\020input_gcs_so" + + "urce\030\001 \001(\t\022\"\n\006status\030\002 \001(\0132\022.google.rpc." + + "Status\022\036\n\026output_gcs_destination\030\003 \001(\t\022\"" + + "\n\026human_review_operation\030\004 \001(\tB\002\030\001\022O\n\023hu" + + "man_review_status\030\005 \001(\01322.google.cloud.d" + + "ocumentai.v1beta3.HumanReviewStatus\"r\n\005S" + + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007WAITING\020\001" + + "\022\013\n\007RUNNING\020\002\022\r\n\tSUCCEEDED\020\003\022\016\n\nCANCELLI" + + "NG\020\004\022\r\n\tCANCELLED\020\005\022\n\n\006FAILED\020\006\"]\n\032Fetch" + + "ProcessorTypesRequest\022?\n\006parent\030\001 \001(\tB/\340" + + "A\002\372A)\022\'documentai.googleapis.com/Process" + + "orType\"f\n\033FetchProcessorTypesResponse\022G\n" + + "\017processor_types\030\001 \003(\0132..google.cloud.do" + + "cumentai.v1beta3.ProcessorType\"\203\001\n\031ListP" + + "rocessorTypesRequest\022?\n\006parent\030\001 \001(\tB/\340A" + + "\002\372A)\022\'documentai.googleapis.com/Processo" + + "rType\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"~\n\032ListProcessorTypesResponse\022G\n\017pr" + + "ocessor_types\030\001 \003(\0132..google.cloud.docum" + + "entai.v1beta3.ProcessorType\022\027\n\017next_page" + + "_token\030\002 \001(\t\"{\n\025ListProcessorsRequest\022;\n" + + "\006parent\030\001 \001(\tB+\340A\002\372A%\022#documentai.google" + + "apis.com/Processor\022\021\n\tpage_size\030\002 \001(\005\022\022\n" + + "\npage_token\030\003 \001(\t\"q\n\026ListProcessorsRespo" + + "nse\022>\n\nprocessors\030\001 \003(\0132*.google.cloud.d" + + "ocumentai.v1beta3.Processor\022\027\n\017next_page" + + "_token\030\002 \001(\t\"P\n\023GetProcessorRequest\0229\n\004n" + "ame\030\001 \001(\tB+\340A\002\372A%\n#documentai.googleapis" - + ".com/Processor\"\032\n\030DisableProcessorRespon" - + "se\"m\n\030DisableProcessorMetadata\022Q\n\017common" - + "_metadata\030\005 \001(\01328.google.cloud.documenta" - + "i.v1beta3.CommonOperationMetadata\"\224\003\n\025Re" - + "viewDocumentRequest\022D\n\017inline_document\030\004" - + " \001(\0132).google.cloud.documentai.v1beta3.D" - + "ocumentH\000\022P\n\023human_review_config\030\001 \001(\tB3" - + "\340A\002\372A-\n+documentai.googleapis.com/HumanR" - + "eviewConfig\022?\n\010document\030\002 \001(\0132).google.c" - + "loud.documentai.v1beta3.DocumentB\002\030\001\022 \n\030" - + "enable_schema_validation\030\003 \001(\010\022Q\n\010priori" - + "ty\030\005 \001(\0162?.google.cloud.documentai.v1bet" - + "a3.ReviewDocumentRequest.Priority\"#\n\010Pri" - + "ority\022\013\n\007DEFAULT\020\000\022\n\n\006URGENT\020\001B\010\n\006source" - + "\"1\n\026ReviewDocumentResponse\022\027\n\017gcs_destin" - + "ation\030\001 \001(\t\"\300\003\n\037ReviewDocumentOperationM" - + "etadata\022U\n\005state\030\001 \001(\0162F.google.cloud.do" - + "cumentai.v1beta3.ReviewDocumentOperation" - + "Metadata.State\022\025\n\rstate_message\030\002 \001(\t\022/\n" - + "\013create_time\030\003 \001(\0132\032.google.protobuf.Tim" - + "estamp\022/\n\013update_time\030\004 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022Q\n\017common_metadata\030\005 \001(\013" - + "28.google.cloud.documentai.v1beta3.Commo" - + "nOperationMetadata\022\023\n\013question_id\030\006 \001(\t\"" - + "e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNNI" - + "NG\020\001\022\016\n\nCANCELLING\020\002\022\r\n\tSUCCEEDED\020\003\022\n\n\006F" - + "AILED\020\004\022\r\n\tCANCELLED\020\0052\207\021\n\030DocumentProce" - + "ssorService\022\303\001\n\017ProcessDocument\022/.google" - + ".cloud.documentai.v1beta3.ProcessRequest" - + "\0320.google.cloud.documentai.v1beta3.Proce" - + "ssResponse\"M\202\323\344\223\002@\";/v1beta3/{name=proje" - + "cts/*/locations/*/processors/*}:process:" - + "\001*\332A\004name\022\360\001\n\025BatchProcessDocuments\0224.go" - + "ogle.cloud.documentai.v1beta3.BatchProce" - + "ssRequest\032\035.google.longrunning.Operation" - + "\"\201\001\202\323\344\223\002E\"@/v1beta3/{name=projects/*/loc" - + "ations/*/processors/*}:batchProcess:\001*\332A" - + "\004name\312A,\n\024BatchProcessResponse\022\024BatchPro" - + "cessMetadata\022\337\001\n\023FetchProcessorTypes\022;.g" - + "oogle.cloud.documentai.v1beta3.FetchProc" - + "essorTypesRequest\032<.google.cloud.documen" - + "tai.v1beta3.FetchProcessorTypesResponse\"" - + "M\202\323\344\223\002>\022\n\tprocessor\030" + + "\001 \001(\tB+\340A\002\372A%\n#documentai.googleapis.com" + + "/Processor\022U\n\031default_processor_version\030" + + "\002 \001(\tB2\340A\002\372A,\n*documentai.googleapis.com" + + "/ProcessorVersion\"$\n\"SetDefaultProcessor" + + "VersionResponse\"w\n\"SetDefaultProcessorVe" + + "rsionMetadata\022Q\n\017common_metadata\030\001 \001(\01328" + + ".google.cloud.documentai.v1beta3.CommonO" + + "perationMetadata\"\336\003\n\025ReviewDocumentReque" + + "st\022D\n\017inline_document\030\004 \001(\0132).google.clo" + + "ud.documentai.v1beta3.DocumentH\000\022P\n\023huma" + + "n_review_config\030\001 \001(\tB3\340A\002\372A-\n+documenta" + + "i.googleapis.com/HumanReviewConfig\022?\n\010do" + + "cument\030\002 \001(\0132).google.cloud.documentai.v" + + "1beta3.DocumentB\002\030\001\022 \n\030enable_schema_val" + + "idation\030\003 \001(\010\022Q\n\010priority\030\005 \001(\0162?.google" + + ".cloud.documentai.v1beta3.ReviewDocument" + + "Request.Priority\022H\n\017document_schema\030\006 \001(" + + "\0132/.google.cloud.documentai.v1beta3.Docu" + + "mentSchema\"#\n\010Priority\022\013\n\007DEFAULT\020\000\022\n\n\006U" + + "RGENT\020\001B\010\n\006source\"\326\001\n\026ReviewDocumentResp" + + "onse\022\027\n\017gcs_destination\030\001 \001(\t\022L\n\005state\030\002" + + " \001(\0162=.google.cloud.documentai.v1beta3.R" + + "eviewDocumentResponse.State\022\030\n\020rejection" + + "_reason\030\003 \001(\t\";\n\005State\022\025\n\021STATE_UNSPECIF" + + "IED\020\000\022\014\n\010REJECTED\020\001\022\r\n\tSUCCEEDED\020\002\"\300\003\n\037R" + + "eviewDocumentOperationMetadata\022U\n\005state\030" + + "\001 \001(\0162F.google.cloud.documentai.v1beta3." + + "ReviewDocumentOperationMetadata.State\022\025\n" + + "\rstate_message\030\002 \001(\t\022/\n\013create_time\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\022/\n\013update_" + + "time\030\004 \001(\0132\032.google.protobuf.Timestamp\022Q" + + "\n\017common_metadata\030\005 \001(\01328.google.cloud.d" + + "ocumentai.v1beta3.CommonOperationMetadat" + + "a\022\023\n\013question_id\030\006 \001(\t\"e\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLIN" + + "G\020\002\022\r\n\tSUCCEEDED\020\003\022\n\n\006FAILED\020\004\022\r\n\tCANCEL" + + "LED\020\0052\244\"\n\030DocumentProcessorService\022\233\002\n\017P" + + "rocessDocument\022/.google.cloud.documentai" + + ".v1beta3.ProcessRequest\0320.google.cloud.d" + + "ocumentai.v1beta3.ProcessResponse\"\244\001\202\323\344\223" + + "\002\226\001\";/v1beta3/{name=projects/*/locations" + + "/*/processors/*}:process:\001*ZT\"O/v1beta3/" + "{name=projects/*/locations/*/processors/" - + "*}:disable:\001*\312A4\n\030DisableProcessorRespon" - + "se\022\030DisableProcessorMetadata\022\252\002\n\016ReviewD" - + "ocument\0226.google.cloud.documentai.v1beta" - + "3.ReviewDocumentRequest\032\035.google.longrun" - + "ning.Operation\"\300\001\202\323\344\223\002h\"c/v1beta3/{human" - + "_review_config=projects/*/locations/*/pr" - + "ocessors/*/humanReviewConfig}:reviewDocu" - + "ment:\001*\332A\023human_review_config\312A9\n\026Review" - + "DocumentResponse\022\037ReviewDocumentOperatio" - + "nMetadata\032M\312A\031documentai.googleapis.com\322" - + "A.https://www.googleapis.com/auth/cloud-" - + "platformB\311\003\n#com.google.cloud.documentai" - + ".v1beta3B\032DocumentAiProcessorServiceP\001ZI" - + "google.golang.org/genproto/googleapis/cl" - + "oud/documentai/v1beta3;documentai\252\002\037Goog" - + "le.Cloud.DocumentAI.V1Beta3\312\002\037Google\\Clo" - + "ud\\DocumentAI\\V1beta3\352\002\"Google::Cloud::D" - + "ocumentAI::V1beta3\352AM\n\"documentai.google" - + "apis.com/Location\022\'projects/{project}/lo" - + "cations/{location}\352A\177\n+documentai.google" - + "apis.com/HumanReviewConfig\022Pprojects/{pr" - + "oject}/locations/{location}/processors/{" - + "processor}/humanReviewConfigb\006proto3" + + "*/processorVersions/*}:process:\001*\332A\004name" + + "\022\314\002\n\025BatchProcessDocuments\0224.google.clou" + + "d.documentai.v1beta3.BatchProcessRequest" + + "\032\035.google.longrunning.Operation\"\335\001\202\323\344\223\002\240" + + "\001\"@/v1beta3/{name=projects/*/locations/*" + + "/processors/*}:batchProcess:\001*ZY\"T/v1bet" + + "a3/{name=projects/*/locations/*/processo" + + "rs/*/processorVersions/*}:batchProcess:\001" + + "*\332A\004name\312A,\n\024BatchProcessResponse\022\024Batch" + + "ProcessMetadata\022\337\001\n\023FetchProcessorTypes\022" + + ";.google.cloud.documentai.v1beta3.FetchP" + + "rocessorTypesRequest\032<.google.cloud.docu" + + "mentai.v1beta3.FetchProcessorTypesRespon" + + "se\"M\202\323\344\223\002>\022." + + "google.cloud.documentai.v1beta3.ListProc" + + "essorVersionsResponse\"X\202\323\344\223\002I\022G/v1beta3/" + + "{parent=projects/*/locations/*/processor" + + "s/*}/processorVersions\332A\006parent\022\212\002\n\026Dele" + + "teProcessorVersion\022>.google.cloud.docume" + + "ntai.v1beta3.DeleteProcessorVersionReque" + + "st\032\035.google.longrunning.Operation\"\220\001\202\323\344\223" + + "\002I*G/v1beta3/{name=projects/*/locations/" + + "*/processors/*/processorVersions/*}\332A\004na" + + "me\312A7\n\025google.protobuf.Empty\022\036DeleteProc" + + "essorVersionMetadata\022\235\002\n\026DeployProcessor" + + "Version\022>.google.cloud.documentai.v1beta" + + "3.DeployProcessorVersionRequest\032\035.google" + + ".longrunning.Operation\"\243\001\202\323\344\223\002S\"N/v1beta" + + "3/{name=projects/*/locations/*/processor" + + "s/*/processorVersions/*}:deploy:\001*\332A\004nam" + + "e\312A@\n\036DeployProcessorVersionResponse\022\036De" + + "ployProcessorVersionMetadata\022\247\002\n\030Undeplo" + + "yProcessorVersion\022@.google.cloud.documen" + + "tai.v1beta3.UndeployProcessorVersionRequ" + + "est\032\035.google.longrunning.Operation\"\251\001\202\323\344" + + "\223\002U\"P/v1beta3/{name=projects/*/locations" + + "/*/processors/*/processorVersions/*}:und" + + "eploy:\001*\332A\004name\312AD\n UndeployProcessorVer" + + "sionResponse\022 UndeployProcessorVersionMe" + + "tadata\022\321\001\n\017CreateProcessor\0227.google.clou" + + "d.documentai.v1beta3.CreateProcessorRequ" + + "est\032*.google.cloud.documentai.v1beta3.Pr" + + "ocessor\"Y\202\323\344\223\002@\"3/v1beta3/{parent=projec" + + "ts/*/locations/*}/processors:\tprocessor\332" + + "A\020parent,processor\022\340\001\n\017DeleteProcessor\0227" + + ".google.cloud.documentai.v1beta3.DeleteP" + + "rocessorRequest\032\035.google.longrunning.Ope" + + "ration\"u\202\323\344\223\0025*3/v1beta3/{name=projects/" + + "*/locations/*/processors/*}\332A\004name\312A0\n\025g" + + "oogle.protobuf.Empty\022\027DeleteProcessorMet" + + "adata\022\345\001\n\017EnableProcessor\0227.google.cloud" + + ".documentai.v1beta3.EnableProcessorReque" + + "st\032\035.google.longrunning.Operation\"z\202\323\344\223\002" + + "?\":/v1beta3/{name=projects/*/locations/*" + + "/processors/*}:enable:\001*\312A2\n\027EnableProce" + + "ssorResponse\022\027EnableProcessorMetadata\022\352\001" + + "\n\020DisableProcessor\0228.google.cloud.docume" + + "ntai.v1beta3.DisableProcessorRequest\032\035.g" + + "oogle.longrunning.Operation\"}\202\323\344\223\002@\";/v1" + + "beta3/{name=projects/*/locations/*/proce" + + "ssors/*}:disable:\001*\312A4\n\030DisableProcessor" + + "Response\022\030DisableProcessorMetadata\022\253\002\n\032S" + + "etDefaultProcessorVersion\022B.google.cloud" + + ".documentai.v1beta3.SetDefaultProcessorV" + + "ersionRequest\032\035.google.longrunning.Opera" + + "tion\"\251\001\202\323\344\223\002X\"S/v1beta3/{processor=proje" + + "cts/*/locations/*/processors/*}:setDefau" + + "ltProcessorVersion:\001*\312AH\n\"SetDefaultProc" + + "essorVersionResponse\022\"SetDefaultProcesso" + + "rVersionMetadata\022\252\002\n\016ReviewDocument\0226.go" + + "ogle.cloud.documentai.v1beta3.ReviewDocu" + + "mentRequest\032\035.google.longrunning.Operati" + + "on\"\300\001\202\323\344\223\002h\"c/v1beta3/{human_review_conf" + + "ig=projects/*/locations/*/processors/*/h" + + "umanReviewConfig}:reviewDocument:\001*\332A\023hu" + + "man_review_config\312A9\n\026ReviewDocumentResp" + + "onse\022\037ReviewDocumentOperationMetadata\032M\312" + + "A\031documentai.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\311\003\n" + + "#com.google.cloud.documentai.v1beta3B\032Do" + + "cumentAiProcessorServiceP\001ZIgoogle.golan" + + "g.org/genproto/googleapis/cloud/document" + + "ai/v1beta3;documentai\252\002\037Google.Cloud.Doc" + + "umentAI.V1Beta3\312\002\037Google\\Cloud\\DocumentA" + + "I\\V1beta3\352\002\"Google::Cloud::DocumentAI::V" + + "1beta3\352A\177\n+documentai.googleapis.com/Hum" + + "anReviewConfig\022Pprojects/{project}/locat" + + "ions/{location}/processors/{processor}/h" + + "umanReviewConfig\352AM\n\"documentai.googleap" + + "is.com/Location\022\'projects/{project}/loca" + + "tions/{location}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -334,6 +509,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.cloud.documentai.v1beta3.DocumentProto.getDescriptor(), com.google.cloud.documentai.v1beta3.DocumentIoProto.getDescriptor(), + com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema.getDescriptor(), com.google.cloud.documentai.v1beta3.OperationMetadataProto.getDescriptor(), com.google.cloud.documentai.v1beta3.DocumentAiProcessor.getDescriptor(), com.google.cloud.documentai.v1beta3.DocumentAiProcessorType.getDescriptor(), @@ -348,7 +524,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ProcessRequest_descriptor, new java.lang.String[] { - "InlineDocument", "RawDocument", "Name", "Document", "SkipHumanReview", "Source", + "InlineDocument", + "RawDocument", + "Name", + "Document", + "SkipHumanReview", + "FieldMask", + "Source", }); internal_static_google_cloud_documentai_v1beta3_HumanReviewStatus_descriptor = getDescriptor().getMessageTypes().get(1); @@ -443,8 +625,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ProcessorTypes", }); - internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor = + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor, + new java.lang.String[] { + "ProcessorTypes", "NextPageToken", + }); + internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor, @@ -452,15 +650,107 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor, new java.lang.String[] { "Processors", "NextPageToken", }); + internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor, + new java.lang.String[] { + "ProcessorVersions", "NextPageToken", + }); + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_DeployProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_descriptor, @@ -468,7 +758,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Processor", }); internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_descriptor, @@ -476,7 +766,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_descriptor, @@ -484,7 +774,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CommonMetadata", }); internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_descriptor, @@ -492,13 +782,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_descriptor, new java.lang.String[] {}); internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_descriptor, @@ -506,7 +796,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CommonMetadata", }); internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_descriptor, @@ -514,21 +804,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_descriptor, new java.lang.String[] {}); internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(32); internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_descriptor, new java.lang.String[] { "CommonMetadata", }); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Processor", "DefaultProcessorVersion", + }); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentRequest_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(36); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ReviewDocumentRequest_descriptor, @@ -538,18 +850,19 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EnableSchemaValidation", "Priority", + "DocumentSchema", "Source", }); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentResponse_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(37); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ReviewDocumentResponse_descriptor, new java.lang.String[] { - "GcsDestination", + "GcsDestination", "State", "RejectionReason", }); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(38); internal_static_google_cloud_documentai_v1beta3_ReviewDocumentOperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ReviewDocumentOperationMetadata_descriptor, @@ -574,6 +887,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.cloud.documentai.v1beta3.DocumentProto.getDescriptor(); com.google.cloud.documentai.v1beta3.DocumentIoProto.getDescriptor(); + com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema.getDescriptor(); com.google.cloud.documentai.v1beta3.OperationMetadataProto.getDescriptor(); com.google.cloud.documentai.v1beta3.DocumentAiProcessor.getDescriptor(); com.google.cloud.documentai.v1beta3.DocumentAiProcessorType.getDescriptor(); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorType.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorType.java index f1d45e5d469..e600dad175b 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorType.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorType.java @@ -46,30 +46,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n4google/cloud/documentai/v1beta3/proces" + "sor_type.proto\022\037google.cloud.documentai." - + "v1beta3\032\031google/api/resource.proto\032\034goog" - + "le/api/annotations.proto\"\313\002\n\rProcessorTy" - + "pe\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\020\n\010catego" - + "ry\030\003 \001(\t\022X\n\023available_locations\030\004 \003(\0132;." - + "google.cloud.documentai.v1beta3.Processo" - + "rType.LocationInfo\022\026\n\016allow_creation\030\006 \001" - + "(\010\032#\n\014LocationInfo\022\023\n\013location_id\030\001 \001(\t:" - + "u\352Ar\n\'documentai.googleapis.com/Processo" - + "rType\022Gprojects/{project}/locations/{loc" - + "ation}/processorTypes/{processor_type}B\364" - + "\001\n#com.google.cloud.documentai.v1beta3B\027" - + "DocumentAiProcessorTypeP\001ZIgoogle.golang" - + ".org/genproto/googleapis/cloud/documenta" - + "i/v1beta3;documentai\252\002\037Google.Cloud.Docu" - + "mentAI.V1Beta3\312\002\037Google\\Cloud\\DocumentAI" - + "\\V1beta3\352\002\"Google::Cloud::DocumentAI::V1" - + "beta3b\006proto3" + + "v1beta3\032\035google/api/launch_stage.proto\032\031" + + "google/api/resource.proto\"\372\002\n\rProcessorT" + + "ype\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\020\n\010categ" + + "ory\030\003 \001(\t\022X\n\023available_locations\030\004 \003(\0132;" + + ".google.cloud.documentai.v1beta3.Process" + + "orType.LocationInfo\022\026\n\016allow_creation\030\006 " + + "\001(\010\022-\n\014launch_stage\030\010 \001(\0162\027.google.api.L" + + "aunchStage\032#\n\014LocationInfo\022\023\n\013location_i" + + "d\030\001 \001(\t:u\352Ar\n\'documentai.googleapis.com/" + + "ProcessorType\022Gprojects/{project}/locati" + + "ons/{location}/processorTypes/{processor" + + "_type}B\364\001\n#com.google.cloud.documentai.v" + + "1beta3B\027DocumentAiProcessorTypeP\001ZIgoogl" + + "e.golang.org/genproto/googleapis/cloud/d" + + "ocumentai/v1beta3;documentai\252\002\037Google.Cl" + + "oud.DocumentAI.V1Beta3\312\002\037Google\\Cloud\\Do" + + "cumentAI\\V1beta3\352\002\"Google::Cloud::Docume" + + "ntAI::V1beta3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.LaunchStageProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor = getDescriptor().getMessageTypes().get(0); @@ -77,7 +78,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor, new java.lang.String[] { - "Name", "Type", "Category", "AvailableLocations", "AllowCreation", + "Name", "Type", "Category", "AvailableLocations", "AllowCreation", "LaunchStage", }); internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_descriptor = internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor @@ -94,8 +95,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); + com.google.api.LaunchStageProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentIoProto.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentIoProto.java index 7d46dbd779b..40cfc4b5ca8 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentIoProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentIoProto.java @@ -66,35 +66,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n1google/cloud/documentai/v1beta3/docume" + "nt_io.proto\022\037google.cloud.documentai.v1b" - + "eta3\032\034google/api/annotations.proto\"1\n\013Ra" - + "wDocument\022\017\n\007content\030\001 \001(\014\022\021\n\tmime_type\030" - + "\002 \001(\t\"1\n\013GcsDocument\022\017\n\007gcs_uri\030\001 \001(\t\022\021\n" - + "\tmime_type\030\002 \001(\t\"O\n\014GcsDocuments\022?\n\tdocu" - + "ments\030\001 \003(\0132,.google.cloud.documentai.v1" - + "beta3.GcsDocument\"#\n\tGcsPrefix\022\026\n\016gcs_ur" - + "i_prefix\030\001 \001(\t\"\257\001\n\031BatchDocumentsInputCo" - + "nfig\022@\n\ngcs_prefix\030\001 \001(\0132*.google.cloud." - + "documentai.v1beta3.GcsPrefixH\000\022F\n\rgcs_do" - + "cuments\030\002 \001(\0132-.google.cloud.documentai." - + "v1beta3.GcsDocumentsH\000B\010\n\006source\"\255\001\n\024Doc" - + "umentOutputConfig\022b\n\021gcs_output_config\030\001" - + " \001(\0132E.google.cloud.documentai.v1beta3.D" - + "ocumentOutputConfig.GcsOutputConfigH\000\032\"\n" - + "\017GcsOutputConfig\022\017\n\007gcs_uri\030\001 \001(\tB\r\n\013des" - + "tinationB\354\001\n#com.google.cloud.documentai" - + ".v1beta3B\017DocumentIoProtoP\001ZIgoogle.gola" - + "ng.org/genproto/googleapis/cloud/documen" - + "tai/v1beta3;documentai\252\002\037Google.Cloud.Do" - + "cumentAI.V1Beta3\312\002\037Google\\Cloud\\Document" - + "AI\\V1beta3\352\002\"Google::Cloud::DocumentAI::" - + "V1beta3b\006proto3" + + "eta3\"1\n\013RawDocument\022\017\n\007content\030\001 \001(\014\022\021\n\t" + + "mime_type\030\002 \001(\t\"1\n\013GcsDocument\022\017\n\007gcs_ur" + + "i\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\"O\n\014GcsDocumen" + + "ts\022?\n\tdocuments\030\001 \003(\0132,.google.cloud.doc" + + "umentai.v1beta3.GcsDocument\"#\n\tGcsPrefix" + + "\022\026\n\016gcs_uri_prefix\030\001 \001(\t\"\257\001\n\031BatchDocume" + + "ntsInputConfig\022@\n\ngcs_prefix\030\001 \001(\0132*.goo" + + "gle.cloud.documentai.v1beta3.GcsPrefixH\000" + + "\022F\n\rgcs_documents\030\002 \001(\0132-.google.cloud.d" + + "ocumentai.v1beta3.GcsDocumentsH\000B\010\n\006sour" + + "ce\"\255\001\n\024DocumentOutputConfig\022b\n\021gcs_outpu" + + "t_config\030\001 \001(\0132E.google.cloud.documentai" + + ".v1beta3.DocumentOutputConfig.GcsOutputC" + + "onfigH\000\032\"\n\017GcsOutputConfig\022\017\n\007gcs_uri\030\001 " + + "\001(\tB\r\n\013destinationB\354\001\n#com.google.cloud." + + "documentai.v1beta3B\017DocumentIoProtoP\001ZIg" + + "oogle.golang.org/genproto/googleapis/clo" + + "ud/documentai/v1beta3;documentai\252\002\037Googl" + + "e.Cloud.DocumentAI.V1Beta3\312\002\037Google\\Clou" + + "d\\DocumentAI\\V1beta3\352\002\"Google::Cloud::Do" + + "cumentAI::V1beta3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - }); + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_google_cloud_documentai_v1beta3_RawDocument_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_documentai_v1beta3_RawDocument_fieldAccessorTable = @@ -153,7 +149,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "GcsUri", }); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentOrBuilder.java index 2d8c070c9e3..4768f97acc4 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentOrBuilder.java @@ -159,8 +159,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -170,8 +169,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -181,8 +179,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -192,8 +189,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -204,8 +200,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Styles for the
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text].
+   * Placeholder.  Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Style text_styles = 5; @@ -216,8 +211,7 @@ public interface DocumentOrBuilder * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -227,8 +221,7 @@ public interface DocumentOrBuilder * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -238,8 +231,7 @@ public interface DocumentOrBuilder * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -249,8 +241,7 @@ public interface DocumentOrBuilder * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -261,8 +252,7 @@ public interface DocumentOrBuilder * * *
-   * Visual page layout for the
-   * [Document][google.cloud.documentai.v1beta3.Document].
+   * Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Page pages = 6; @@ -273,9 +263,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -285,9 +274,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -297,9 +285,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -309,9 +296,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -322,9 +308,8 @@ public interface DocumentOrBuilder * * *
-   * A list of entities detected on
-   * [Document.text][google.cloud.documentai.v1beta3.Document.text]. For
-   * document shards, entities in this list may cross shard boundaries.
+   * A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards,
+   * entities in this list may cross shard boundaries.
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.Entity entities = 7; @@ -335,8 +320,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -348,8 +332,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -360,8 +343,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -372,8 +354,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; @@ -385,8 +366,7 @@ public interface DocumentOrBuilder * * *
-   * Placeholder.  Relationship among
-   * [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
+   * Placeholder.  Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
    * 
* * repeated .google.cloud.documentai.v1beta3.Document.EntityRelation entity_relations = 8; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProto.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProto.java index 0ccba4c4844..1ac6f86cdaa 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProto.java @@ -107,6 +107,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1beta3_Document_Page_FormField_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1beta3_Document_Page_FormField_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -170,226 +174,236 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n.google/cloud/documentai/v1beta3/docume" + "nt.proto\022\037google.cloud.documentai.v1beta" - + "3\032\034google/api/annotations.proto\032\037google/" - + "api/field_behavior.proto\032.google/cloud/d" - + "ocumentai/v1beta3/geometry.proto\032\037google" - + "/protobuf/timestamp.proto\032\027google/rpc/st" - + "atus.proto\032\027google/type/color.proto\032\026goo" - + "gle/type/date.proto\032\032google/type/datetim" - + "e.proto\032\027google/type/money.proto\032 google" - + "/type/postal_address.proto\"\222>\n\010Document\022" - + "\022\n\003uri\030\001 \001(\tB\003\340A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A" - + "\001H\000\022\021\n\tmime_type\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A" - + "\001\022D\n\013text_styles\030\005 \003(\0132/.google.cloud.do" - + "cumentai.v1beta3.Document.Style\022=\n\005pages" - + "\030\006 \003(\0132..google.cloud.documentai.v1beta3" - + ".Document.Page\022B\n\010entities\030\007 \003(\01320.googl" - + "e.cloud.documentai.v1beta3.Document.Enti" - + "ty\022R\n\020entity_relations\030\010 \003(\01328.google.cl" - + "oud.documentai.v1beta3.Document.EntityRe" - + "lation\022J\n\014text_changes\030\016 \003(\01324.google.cl" - + "oud.documentai.v1beta3.Document.TextChan" - + "ge\022G\n\nshard_info\030\t \001(\01323.google.cloud.do" - + "cumentai.v1beta3.Document.ShardInfo\022!\n\005e" - + "rror\030\n \001(\0132\022.google.rpc.Status\022E\n\trevisi" - + "ons\030\r \003(\01322.google.cloud.documentai.v1be" - + "ta3.Document.Revision\032J\n\tShardInfo\022\023\n\013sh" - + "ard_index\030\001 \001(\003\022\023\n\013shard_count\030\002 \001(\003\022\023\n\013" - + "text_offset\030\003 \001(\003\032\332\002\n\005Style\022I\n\013text_anch" - + "or\030\001 \001(\01324.google.cloud.documentai.v1bet" - + "a3.Document.TextAnchor\022!\n\005color\030\002 \001(\0132\022." - + "google.type.Color\022,\n\020background_color\030\003 " - + "\001(\0132\022.google.type.Color\022\023\n\013font_weight\030\004" - + " \001(\t\022\022\n\ntext_style\030\005 \001(\t\022\027\n\017text_decorat" - + "ion\030\006 \001(\t\022K\n\tfont_size\030\007 \001(\01328.google.cl" - + "oud.documentai.v1beta3.Document.Style.Fo" - + "ntSize\032&\n\010FontSize\022\014\n\004size\030\001 \001(\002\022\014\n\004unit" - + "\030\002 \001(\t\032\333\"\n\004Page\022\023\n\013page_number\030\001 \001(\005\022C\n\005" - + "image\030\r \001(\01324.google.cloud.documentai.v1" - + "beta3.Document.Page.Image\022I\n\ntransforms\030" - + "\016 \003(\01325.google.cloud.documentai.v1beta3." - + "Document.Page.Matrix\022K\n\tdimension\030\002 \001(\0132" - + "8.google.cloud.documentai.v1beta3.Docume" - + "nt.Page.Dimension\022E\n\006layout\030\003 \001(\01325.goog" + + "3\032\037google/api/field_behavior.proto\032-goog" + + "le/cloud/documentai/v1beta3/barcode.prot" + + "o\032.google/cloud/documentai/v1beta3/geome" + + "try.proto\032\037google/protobuf/timestamp.pro" + + "to\032\027google/rpc/status.proto\032\027google/type" + + "/color.proto\032\026google/type/date.proto\032\032go" + + "ogle/type/datetime.proto\032\027google/type/mo" + + "ney.proto\032 google/type/postal_address.pr" + + "oto\"\205A\n\010Document\022\022\n\003uri\030\001 \001(\tB\003\340A\001H\000\022\026\n\007" + + "content\030\002 \001(\014B\003\340A\001H\000\022\021\n\tmime_type\030\003 \001(\t\022" + + "\021\n\004text\030\004 \001(\tB\003\340A\001\022D\n\013text_styles\030\005 \003(\0132" + + "/.google.cloud.documentai.v1beta3.Docume" + + "nt.Style\022=\n\005pages\030\006 \003(\0132..google.cloud.d" + + "ocumentai.v1beta3.Document.Page\022B\n\010entit" + + "ies\030\007 \003(\01320.google.cloud.documentai.v1be" + + "ta3.Document.Entity\022R\n\020entity_relations\030" + + "\010 \003(\01328.google.cloud.documentai.v1beta3." + + "Document.EntityRelation\022J\n\014text_changes\030" + + "\016 \003(\01324.google.cloud.documentai.v1beta3." + + "Document.TextChange\022G\n\nshard_info\030\t \001(\0132" + + "3.google.cloud.documentai.v1beta3.Docume" + + "nt.ShardInfo\022!\n\005error\030\n \001(\0132\022.google.rpc" + + ".Status\022E\n\trevisions\030\r \003(\01322.google.clou" + + "d.documentai.v1beta3.Document.Revision\032J" + + "\n\tShardInfo\022\023\n\013shard_index\030\001 \001(\003\022\023\n\013shar" + + "d_count\030\002 \001(\003\022\023\n\013text_offset\030\003 \001(\003\032\332\002\n\005S" + + "tyle\022I\n\013text_anchor\030\001 \001(\01324.google.cloud" + + ".documentai.v1beta3.Document.TextAnchor\022" + + "!\n\005color\030\002 \001(\0132\022.google.type.Color\022,\n\020ba" + + "ckground_color\030\003 \001(\0132\022.google.type.Color" + + "\022\023\n\013font_weight\030\004 \001(\t\022\022\n\ntext_style\030\005 \001(" + + "\t\022\027\n\017text_decoration\030\006 \001(\t\022K\n\tfont_size\030" + + "\007 \001(\01328.google.cloud.documentai.v1beta3." + + "Document.Style.FontSize\032&\n\010FontSize\022\014\n\004s" + + "ize\030\001 \001(\002\022\014\n\004unit\030\002 \001(\t\032\206%\n\004Page\022\023\n\013page" + + "_number\030\001 \001(\005\022C\n\005image\030\r \001(\01324.google.cl" + + "oud.documentai.v1beta3.Document.Page.Ima" + + "ge\022I\n\ntransforms\030\016 \003(\01325.google.cloud.do" + + "cumentai.v1beta3.Document.Page.Matrix\022K\n" + + "\tdimension\030\002 \001(\01328.google.cloud.document" + + "ai.v1beta3.Document.Page.Dimension\022E\n\006la" + + "yout\030\003 \001(\01325.google.cloud.documentai.v1b" + + "eta3.Document.Page.Layout\022[\n\022detected_la" + + "nguages\030\004 \003(\0132?.google.cloud.documentai." + + "v1beta3.Document.Page.DetectedLanguage\022D" + + "\n\006blocks\030\005 \003(\01324.google.cloud.documentai" + + ".v1beta3.Document.Page.Block\022L\n\nparagrap" + + "hs\030\006 \003(\01328.google.cloud.documentai.v1bet" + + "a3.Document.Page.Paragraph\022B\n\005lines\030\007 \003(" + + "\01323.google.cloud.documentai.v1beta3.Docu" + + "ment.Page.Line\022D\n\006tokens\030\010 \003(\01324.google." + + "cloud.documentai.v1beta3.Document.Page.T" + + "oken\022U\n\017visual_elements\030\t \003(\0132<.google.c" + + "loud.documentai.v1beta3.Document.Page.Vi" + + "sualElement\022D\n\006tables\030\n \003(\01324.google.clo" + + "ud.documentai.v1beta3.Document.Page.Tabl" + + "e\022M\n\013form_fields\030\013 \003(\01328.google.cloud.do" + + "cumentai.v1beta3.Document.Page.FormField" + + "\022F\n\007symbols\030\014 \003(\01325.google.cloud.documen" + + "tai.v1beta3.Document.Page.Symbol\022Y\n\021dete" + + "cted_barcodes\030\017 \003(\0132>.google.cloud.docum" + + "entai.v1beta3.Document.Page.DetectedBarc" + + "ode\022H\n\nprovenance\030\020 \001(\01324.google.cloud.d" + + "ocumentai.v1beta3.Document.Provenance\0328\n" + + "\tDimension\022\r\n\005width\030\001 \001(\002\022\016\n\006height\030\002 \001(" + + "\002\022\014\n\004unit\030\003 \001(\t\032J\n\005Image\022\017\n\007content\030\001 \001(" + + "\014\022\021\n\tmime_type\030\002 \001(\t\022\r\n\005width\030\003 \001(\005\022\016\n\006h" + + "eight\030\004 \001(\005\032@\n\006Matrix\022\014\n\004rows\030\001 \001(\005\022\014\n\004c" + + "ols\030\002 \001(\005\022\014\n\004type\030\003 \001(\005\022\014\n\004data\030\004 \001(\014\032\354\002" + + "\n\006Layout\022I\n\013text_anchor\030\001 \001(\01324.google.c" + + "loud.documentai.v1beta3.Document.TextAnc" + + "hor\022\022\n\nconfidence\030\002 \001(\002\022D\n\rbounding_poly" + + "\030\003 \001(\0132-.google.cloud.documentai.v1beta3" + + ".BoundingPoly\022V\n\013orientation\030\004 \001(\0162A.goo" + + "gle.cloud.documentai.v1beta3.Document.Pa" + + "ge.Layout.Orientation\"e\n\013Orientation\022\033\n\027" + + "ORIENTATION_UNSPECIFIED\020\000\022\013\n\007PAGE_UP\020\001\022\016" + + "\n\nPAGE_RIGHT\020\002\022\r\n\tPAGE_DOWN\020\003\022\r\n\tPAGE_LE" + + "FT\020\004\032\365\001\n\005Block\022E\n\006layout\030\001 \001(\01325.google." + + "cloud.documentai.v1beta3.Document.Page.L" + + "ayout\022[\n\022detected_languages\030\002 \003(\0132?.goog" + "le.cloud.documentai.v1beta3.Document.Pag" - + "e.Layout\022[\n\022detected_languages\030\004 \003(\0132?.g" - + "oogle.cloud.documentai.v1beta3.Document." - + "Page.DetectedLanguage\022D\n\006blocks\030\005 \003(\01324." - + "google.cloud.documentai.v1beta3.Document" - + ".Page.Block\022L\n\nparagraphs\030\006 \003(\01328.google" - + ".cloud.documentai.v1beta3.Document.Page." - + "Paragraph\022B\n\005lines\030\007 \003(\01323.google.cloud." - + "documentai.v1beta3.Document.Page.Line\022D\n" - + "\006tokens\030\010 \003(\01324.google.cloud.documentai." - + "v1beta3.Document.Page.Token\022U\n\017visual_el" - + "ements\030\t \003(\0132<.google.cloud.documentai.v" - + "1beta3.Document.Page.VisualElement\022D\n\006ta" - + "bles\030\n \003(\01324.google.cloud.documentai.v1b" - + "eta3.Document.Page.Table\022M\n\013form_fields\030" - + "\013 \003(\01328.google.cloud.documentai.v1beta3." - + "Document.Page.FormField\022F\n\007symbols\030\014 \003(\013" - + "25.google.cloud.documentai.v1beta3.Docum" - + "ent.Page.Symbol\022H\n\nprovenance\030\020 \001(\01324.go" - + "ogle.cloud.documentai.v1beta3.Document.P" - + "rovenance\0328\n\tDimension\022\r\n\005width\030\001 \001(\002\022\016\n" - + "\006height\030\002 \001(\002\022\014\n\004unit\030\003 \001(\t\032J\n\005Image\022\017\n\007" - + "content\030\001 \001(\014\022\021\n\tmime_type\030\002 \001(\t\022\r\n\005widt" - + "h\030\003 \001(\005\022\016\n\006height\030\004 \001(\005\032@\n\006Matrix\022\014\n\004row" - + "s\030\001 \001(\005\022\014\n\004cols\030\002 \001(\005\022\014\n\004type\030\003 \001(\005\022\014\n\004d" - + "ata\030\004 \001(\014\032\354\002\n\006Layout\022I\n\013text_anchor\030\001 \001(" - + "\01324.google.cloud.documentai.v1beta3.Docu" - + "ment.TextAnchor\022\022\n\nconfidence\030\002 \001(\002\022D\n\rb" - + "ounding_poly\030\003 \001(\0132-.google.cloud.docume" - + "ntai.v1beta3.BoundingPoly\022V\n\013orientation" - + "\030\004 \001(\0162A.google.cloud.documentai.v1beta3" - + ".Document.Page.Layout.Orientation\"e\n\013Ori" - + "entation\022\033\n\027ORIENTATION_UNSPECIFIED\020\000\022\013\n" - + "\007PAGE_UP\020\001\022\016\n\nPAGE_RIGHT\020\002\022\r\n\tPAGE_DOWN\020" - + "\003\022\r\n\tPAGE_LEFT\020\004\032\365\001\n\005Block\022E\n\006layout\030\001 \001" + + "e.DetectedLanguage\022H\n\nprovenance\030\003 \001(\01324" + + ".google.cloud.documentai.v1beta3.Documen" + + "t.Provenance\032\371\001\n\tParagraph\022E\n\006layout\030\001 \001" + "(\01325.google.cloud.documentai.v1beta3.Doc" + "ument.Page.Layout\022[\n\022detected_languages\030" + "\002 \003(\0132?.google.cloud.documentai.v1beta3." + "Document.Page.DetectedLanguage\022H\n\nproven" + "ance\030\003 \001(\01324.google.cloud.documentai.v1b" - + "eta3.Document.Provenance\032\371\001\n\tParagraph\022E" - + "\n\006layout\030\001 \001(\01325.google.cloud.documentai" - + ".v1beta3.Document.Page.Layout\022[\n\022detecte" - + "d_languages\030\002 \003(\0132?.google.cloud.documen" - + "tai.v1beta3.Document.Page.DetectedLangua" - + "ge\022H\n\nprovenance\030\003 \001(\01324.google.cloud.do" - + "cumentai.v1beta3.Document.Provenance\032\364\001\n" - + "\004Line\022E\n\006layout\030\001 \001(\01325.google.cloud.doc" - + "umentai.v1beta3.Document.Page.Layout\022[\n\022" - + "detected_languages\030\002 \003(\0132?.google.cloud." - + "documentai.v1beta3.Document.Page.Detecte" - + "dLanguage\022H\n\nprovenance\030\003 \001(\01324.google.c" - + "loud.documentai.v1beta3.Document.Provena" - + "nce\032\377\003\n\005Token\022E\n\006layout\030\001 \001(\01325.google.c" - + "loud.documentai.v1beta3.Document.Page.La" - + "yout\022Z\n\016detected_break\030\002 \001(\0132B.google.cl" - + "oud.documentai.v1beta3.Document.Page.Tok" - + "en.DetectedBreak\022[\n\022detected_languages\030\003" - + " \003(\0132?.google.cloud.documentai.v1beta3.D" - + "ocument.Page.DetectedLanguage\022H\n\nprovena" - + "nce\030\004 \001(\01324.google.cloud.documentai.v1be" - + "ta3.Document.Provenance\032\253\001\n\rDetectedBrea" - + "k\022U\n\004type\030\001 \001(\0162G.google.cloud.documenta" - + "i.v1beta3.Document.Page.Token.DetectedBr" - + "eak.Type\"C\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\t" - + "\n\005SPACE\020\001\022\016\n\nWIDE_SPACE\020\002\022\n\n\006HYPHEN\020\003\032\254\001" - + "\n\006Symbol\022E\n\006layout\030\001 \001(\01325.google.cloud." - + "documentai.v1beta3.Document.Page.Layout\022" - + "[\n\022detected_languages\030\002 \003(\0132?.google.clo" - + "ud.documentai.v1beta3.Document.Page.Dete" - + "ctedLanguage\032\301\001\n\rVisualElement\022E\n\006layout" - + "\030\001 \001(\01325.google.cloud.documentai.v1beta3" - + ".Document.Page.Layout\022\014\n\004type\030\002 \001(\t\022[\n\022d" - + "etected_languages\030\003 \003(\0132?.google.cloud.d" - + "ocumentai.v1beta3.Document.Page.Detected" - + "Language\032\202\005\n\005Table\022E\n\006layout\030\001 \001(\01325.goo" - + "gle.cloud.documentai.v1beta3.Document.Pa" - + "ge.Layout\022R\n\013header_rows\030\002 \003(\0132=.google." - + "cloud.documentai.v1beta3.Document.Page.T" - + "able.TableRow\022P\n\tbody_rows\030\003 \003(\0132=.googl" + + "eta3.Document.Provenance\032\364\001\n\004Line\022E\n\006lay" + + "out\030\001 \001(\01325.google.cloud.documentai.v1be" + + "ta3.Document.Page.Layout\022[\n\022detected_lan" + + "guages\030\002 \003(\0132?.google.cloud.documentai.v" + + "1beta3.Document.Page.DetectedLanguage\022H\n" + + "\nprovenance\030\003 \001(\01324.google.cloud.documen" + + "tai.v1beta3.Document.Provenance\032\377\003\n\005Toke" + + "n\022E\n\006layout\030\001 \001(\01325.google.cloud.documen" + + "tai.v1beta3.Document.Page.Layout\022Z\n\016dete" + + "cted_break\030\002 \001(\0132B.google.cloud.document" + + "ai.v1beta3.Document.Page.Token.DetectedB" + + "reak\022[\n\022detected_languages\030\003 \003(\0132?.googl" + "e.cloud.documentai.v1beta3.Document.Page" - + ".Table.TableRow\022[\n\022detected_languages\030\004 " - + "\003(\0132?.google.cloud.documentai.v1beta3.Do" - + "cument.Page.DetectedLanguage\032Y\n\010TableRow" - + "\022M\n\005cells\030\001 \003(\0132>.google.cloud.documenta" - + "i.v1beta3.Document.Page.Table.TableCell\032" - + "\323\001\n\tTableCell\022E\n\006layout\030\001 \001(\01325.google.c" - + "loud.documentai.v1beta3.Document.Page.La" - + "yout\022\020\n\010row_span\030\002 \001(\005\022\020\n\010col_span\030\003 \001(\005" - + "\022[\n\022detected_languages\030\004 \003(\0132?.google.cl" - + "oud.documentai.v1beta3.Document.Page.Det" - + "ectedLanguage\032\305\003\n\tFormField\022I\n\nfield_nam" - + "e\030\001 \001(\01325.google.cloud.documentai.v1beta" - + "3.Document.Page.Layout\022J\n\013field_value\030\002 " - + "\001(\01325.google.cloud.documentai.v1beta3.Do" - + "cument.Page.Layout\022`\n\027name_detected_lang" + + ".DetectedLanguage\022H\n\nprovenance\030\004 \001(\01324." + + "google.cloud.documentai.v1beta3.Document" + + ".Provenance\032\253\001\n\rDetectedBreak\022U\n\004type\030\001 " + + "\001(\0162G.google.cloud.documentai.v1beta3.Do" + + "cument.Page.Token.DetectedBreak.Type\"C\n\004" + + "Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\t\n\005SPACE\020\001\022\016\n" + + "\nWIDE_SPACE\020\002\022\n\n\006HYPHEN\020\003\032\254\001\n\006Symbol\022E\n\006" + + "layout\030\001 \001(\01325.google.cloud.documentai.v" + + "1beta3.Document.Page.Layout\022[\n\022detected_" + + "languages\030\002 \003(\0132?.google.cloud.documenta" + + "i.v1beta3.Document.Page.DetectedLanguage" + + "\032\301\001\n\rVisualElement\022E\n\006layout\030\001 \001(\01325.goo" + + "gle.cloud.documentai.v1beta3.Document.Pa" + + "ge.Layout\022\014\n\004type\030\002 \001(\t\022[\n\022detected_lang" + "uages\030\003 \003(\0132?.google.cloud.documentai.v1" - + "beta3.Document.Page.DetectedLanguage\022a\n\030" - + "value_detected_languages\030\004 \003(\0132?.google." - + "cloud.documentai.v1beta3.Document.Page.D" - + "etectedLanguage\022\022\n\nvalue_type\030\005 \001(\t\022H\n\np" - + "rovenance\030\010 \001(\01324.google.cloud.documenta" - + "i.v1beta3.Document.Provenance\032=\n\020Detecte" - + "dLanguage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\nconf" - + "idence\030\002 \001(\002\032\271\006\n\006Entity\022N\n\013text_anchor\030\001" + + "beta3.Document.Page.DetectedLanguage\032\202\005\n" + + "\005Table\022E\n\006layout\030\001 \001(\01325.google.cloud.do" + + "cumentai.v1beta3.Document.Page.Layout\022R\n" + + "\013header_rows\030\002 \003(\0132=.google.cloud.docume" + + "ntai.v1beta3.Document.Page.Table.TableRo" + + "w\022P\n\tbody_rows\030\003 \003(\0132=.google.cloud.docu" + + "mentai.v1beta3.Document.Page.Table.Table" + + "Row\022[\n\022detected_languages\030\004 \003(\0132?.google" + + ".cloud.documentai.v1beta3.Document.Page." + + "DetectedLanguage\032Y\n\010TableRow\022M\n\005cells\030\001 " + + "\003(\0132>.google.cloud.documentai.v1beta3.Do" + + "cument.Page.Table.TableCell\032\323\001\n\tTableCel" + + "l\022E\n\006layout\030\001 \001(\01325.google.cloud.documen" + + "tai.v1beta3.Document.Page.Layout\022\020\n\010row_" + + "span\030\002 \001(\005\022\020\n\010col_span\030\003 \001(\005\022[\n\022detected" + + "_languages\030\004 \003(\0132?.google.cloud.document" + + "ai.v1beta3.Document.Page.DetectedLanguag" + + "e\032\377\003\n\tFormField\022I\n\nfield_name\030\001 \001(\01325.go" + + "ogle.cloud.documentai.v1beta3.Document.P" + + "age.Layout\022J\n\013field_value\030\002 \001(\01325.google" + + ".cloud.documentai.v1beta3.Document.Page." + + "Layout\022`\n\027name_detected_languages\030\003 \003(\0132" + + "?.google.cloud.documentai.v1beta3.Docume" + + "nt.Page.DetectedLanguage\022a\n\030value_detect" + + "ed_languages\030\004 \003(\0132?.google.cloud.docume" + + "ntai.v1beta3.Document.Page.DetectedLangu" + + "age\022\022\n\nvalue_type\030\005 \001(\t\022\032\n\022corrected_key" + + "_text\030\006 \001(\t\022\034\n\024corrected_value_text\030\007 \001(" + + "\t\022H\n\nprovenance\030\010 \001(\01324.google.cloud.doc" + + "umentai.v1beta3.Document.Provenance\032\223\001\n\017" + + "DetectedBarcode\022E\n\006layout\030\001 \001(\01325.google" + + ".cloud.documentai.v1beta3.Document.Page." + + "Layout\0229\n\007barcode\030\002 \001(\0132(.google.cloud.d" + + "ocumentai.v1beta3.Barcode\032=\n\020DetectedLan" + + "guage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\nconfiden" + + "ce\030\002 \001(\002\032\351\006\n\006Entity\022N\n\013text_anchor\030\001 \001(\013" + + "24.google.cloud.documentai.v1beta3.Docum" + + "ent.TextAnchorB\003\340A\001\022\021\n\004type\030\002 \001(\tB\003\340A\002\022\031" + + "\n\014mention_text\030\003 \001(\tB\003\340A\001\022\027\n\nmention_id\030" + + "\004 \001(\tB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\022N\n\013p" + + "age_anchor\030\006 \001(\01324.google.cloud.document" + + "ai.v1beta3.Document.PageAnchorB\003\340A\001\022\017\n\002i" + + "d\030\007 \001(\tB\003\340A\001\022_\n\020normalized_value\030\t \001(\0132@" + + ".google.cloud.documentai.v1beta3.Documen" + + "t.Entity.NormalizedValueB\003\340A\001\022I\n\npropert" + + "ies\030\n \003(\01320.google.cloud.documentai.v1be" + + "ta3.Document.EntityB\003\340A\001\022M\n\nprovenance\030\013" + " \001(\01324.google.cloud.documentai.v1beta3.D" - + "ocument.TextAnchorB\003\340A\001\022\021\n\004type\030\002 \001(\tB\003\340" - + "A\002\022\031\n\014mention_text\030\003 \001(\tB\003\340A\001\022\027\n\nmention" - + "_id\030\004 \001(\tB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\022" - + "N\n\013page_anchor\030\006 \001(\01324.google.cloud.docu" - + "mentai.v1beta3.Document.PageAnchorB\003\340A\001\022" - + "\017\n\002id\030\007 \001(\tB\003\340A\001\022_\n\020normalized_value\030\t \001" - + "(\0132@.google.cloud.documentai.v1beta3.Doc" - + "ument.Entity.NormalizedValueB\003\340A\001\022I\n\npro" - + "perties\030\n \003(\01320.google.cloud.documentai." - + "v1beta3.Document.EntityB\003\340A\001\022M\n\nprovenan" - + "ce\030\013 \001(\01324.google.cloud.documentai.v1bet" - + "a3.Document.ProvenanceB\003\340A\001\022\025\n\010redacted\030" - + "\014 \001(\010B\003\340A\001\032\213\002\n\017NormalizedValue\022)\n\013money_" - + "value\030\002 \001(\0132\022.google.type.MoneyH\000\022\'\n\ndat" - + "e_value\030\003 \001(\0132\021.google.type.DateH\000\022/\n\016da" - + "tetime_value\030\004 \001(\0132\025.google.type.DateTim" - + "eH\000\0223\n\raddress_value\030\005 \001(\0132\032.google.type" - + ".PostalAddressH\000\022\027\n\rboolean_value\030\006 \001(\010H" - + "\000\022\021\n\004text\030\001 \001(\tB\003\340A\001B\022\n\020structured_value" - + "\032I\n\016EntityRelation\022\022\n\nsubject_id\030\001 \001(\t\022\021" - + "\n\tobject_id\030\002 \001(\t\022\020\n\010relation\030\003 \001(\t\032\255\001\n\n" - + "TextAnchor\022W\n\rtext_segments\030\001 \003(\0132@.goog" - + "le.cloud.documentai.v1beta3.Document.Tex" - + "tAnchor.TextSegment\022\017\n\007content\030\002 \001(\t\0325\n\013" - + "TextSegment\022\023\n\013start_index\030\001 \001(\003\022\021\n\tend_" - + "index\030\002 \001(\003\032\347\003\n\nPageAnchor\022O\n\tpage_refs\030" - + "\001 \003(\0132<.google.cloud.documentai.v1beta3." - + "Document.PageAnchor.PageRef\032\207\003\n\007PageRef\022" - + "\021\n\004page\030\001 \001(\003B\003\340A\002\022a\n\013layout_type\030\002 \001(\0162" - + "G.google.cloud.documentai.v1beta3.Docume" - + "nt.PageAnchor.PageRef.LayoutTypeB\003\340A\001\022\030\n" - + "\tlayout_id\030\003 \001(\tB\005\030\001\340A\001\022I\n\rbounding_poly" - + "\030\004 \001(\0132-.google.cloud.documentai.v1beta3" - + ".BoundingPolyB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003" - + "\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_TYPE_UNSPEC" - + "IFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010\n\004LIN" - + "E\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022\t\n\005TA" - + "BLE\020\006\022\016\n\nFORM_FIELD\020\007\032\226\003\n\nProvenance\022\020\n\010" - + "revision\030\001 \001(\005\022\016\n\002id\030\002 \001(\005B\002\030\001\022L\n\007parent" - + "s\030\003 \003(\0132;.google.cloud.documentai.v1beta" - + "3.Document.Provenance.Parent\022P\n\004type\030\004 \001" - + "(\0162B.google.cloud.documentai.v1beta3.Doc" - + "ument.Provenance.OperationType\0329\n\006Parent" - + "\022\020\n\010revision\030\001 \001(\005\022\r\n\005index\030\003 \001(\005\022\016\n\002id\030" - + "\002 \001(\005B\002\030\001\"\212\001\n\rOperationType\022\036\n\032OPERATION" - + "_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002" - + "\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_REQUESTED\020\004\022\021\n\rEVA" - + "L_APPROVED\020\005\022\020\n\014EVAL_SKIPPED\020\006\032\222\002\n\010Revis" - + "ion\022\017\n\005agent\030\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\tH" - + "\000\022\n\n\002id\030\001 \001(\t\022\016\n\006parent\030\002 \003(\005\022/\n\013create_" - + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022T" - + "\n\014human_review\030\006 \001(\0132>.google.cloud.docu" - + "mentai.v1beta3.Document.Revision.HumanRe" - + "view\0323\n\013HumanReview\022\r\n\005state\030\001 \001(\t\022\025\n\rst" - + "ate_message\030\002 \001(\tB\010\n\006source\032\267\001\n\nTextChan" - + "ge\022I\n\013text_anchor\030\001 \001(\01324.google.cloud.d" - + "ocumentai.v1beta3.Document.TextAnchor\022\024\n" - + "\014changed_text\030\002 \001(\t\022H\n\nprovenance\030\003 \003(\0132" - + "4.google.cloud.documentai.v1beta3.Docume" - + "nt.ProvenanceB\010\n\006sourceB\352\001\n#com.google.c" - + "loud.documentai.v1beta3B\rDocumentProtoP\001" - + "ZIgoogle.golang.org/genproto/googleapis/" - + "cloud/documentai/v1beta3;documentai\252\002\037Go" - + "ogle.Cloud.DocumentAI.V1Beta3\312\002\037Google\\C" - + "loud\\DocumentAI\\V1beta3\352\002\"Google::Cloud:" - + ":DocumentAI::V1beta3b\006proto3" + + "ocument.ProvenanceB\003\340A\001\022\025\n\010redacted\030\014 \001(" + + "\010B\003\340A\001\032\273\002\n\017NormalizedValue\022)\n\013money_valu" + + "e\030\002 \001(\0132\022.google.type.MoneyH\000\022\'\n\ndate_va" + + "lue\030\003 \001(\0132\021.google.type.DateH\000\022/\n\016dateti" + + "me_value\030\004 \001(\0132\025.google.type.DateTimeH\000\022" + + "3\n\raddress_value\030\005 \001(\0132\032.google.type.Pos" + + "talAddressH\000\022\027\n\rboolean_value\030\006 \001(\010H\000\022\027\n" + + "\rinteger_value\030\007 \001(\005H\000\022\025\n\013float_value\030\010 " + + "\001(\002H\000\022\021\n\004text\030\001 \001(\tB\003\340A\001B\022\n\020structured_v" + + "alue\032I\n\016EntityRelation\022\022\n\nsubject_id\030\001 \001" + + "(\t\022\021\n\tobject_id\030\002 \001(\t\022\020\n\010relation\030\003 \001(\t\032" + + "\255\001\n\nTextAnchor\022W\n\rtext_segments\030\001 \003(\0132@." + + "google.cloud.documentai.v1beta3.Document" + + ".TextAnchor.TextSegment\022\017\n\007content\030\002 \001(\t" + + "\0325\n\013TextSegment\022\023\n\013start_index\030\001 \001(\003\022\021\n\t" + + "end_index\030\002 \001(\003\032\347\003\n\nPageAnchor\022O\n\tpage_r" + + "efs\030\001 \003(\0132<.google.cloud.documentai.v1be" + + "ta3.Document.PageAnchor.PageRef\032\207\003\n\007Page" + + "Ref\022\021\n\004page\030\001 \001(\003B\003\340A\002\022a\n\013layout_type\030\002 " + + "\001(\0162G.google.cloud.documentai.v1beta3.Do" + + "cument.PageAnchor.PageRef.LayoutTypeB\003\340A" + + "\001\022\030\n\tlayout_id\030\003 \001(\tB\005\030\001\340A\001\022I\n\rbounding_" + + "poly\030\004 \001(\0132-.google.cloud.documentai.v1b" + + "eta3.BoundingPolyB\003\340A\001\022\027\n\nconfidence\030\005 \001" + + "(\002B\003\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_TYPE_UN" + + "SPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010\n" + + "\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022\t" + + "\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\226\003\n\nProvenance" + + "\022\020\n\010revision\030\001 \001(\005\022\016\n\002id\030\002 \001(\005B\002\030\001\022L\n\007pa" + + "rents\030\003 \003(\0132;.google.cloud.documentai.v1" + + "beta3.Document.Provenance.Parent\022P\n\004type" + + "\030\004 \001(\0162B.google.cloud.documentai.v1beta3" + + ".Document.Provenance.OperationType\0329\n\006Pa" + + "rent\022\020\n\010revision\030\001 \001(\005\022\r\n\005index\030\003 \001(\005\022\016\n" + + "\002id\030\002 \001(\005B\002\030\001\"\212\001\n\rOperationType\022\036\n\032OPERA" + + "TION_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMO" + + "VE\020\002\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_REQUESTED\020\004\022\021\n" + + "\rEVAL_APPROVED\020\005\022\020\n\014EVAL_SKIPPED\020\006\032\252\002\n\010R" + + "evision\022\017\n\005agent\030\004 \001(\tH\000\022\023\n\tprocessor\030\005 " + + "\001(\tH\000\022\n\n\002id\030\001 \001(\t\022\022\n\006parent\030\002 \003(\005B\002\030\001\022\022\n" + + "\nparent_ids\030\007 \003(\t\022/\n\013create_time\030\003 \001(\0132\032" + + ".google.protobuf.Timestamp\022T\n\014human_revi" + + "ew\030\006 \001(\0132>.google.cloud.documentai.v1bet" + + "a3.Document.Revision.HumanReview\0323\n\013Huma" + + "nReview\022\r\n\005state\030\001 \001(\t\022\025\n\rstate_message\030" + + "\002 \001(\tB\010\n\006source\032\267\001\n\nTextChange\022I\n\013text_a" + + "nchor\030\001 \001(\01324.google.cloud.documentai.v1" + + "beta3.Document.TextAnchor\022\024\n\014changed_tex" + + "t\030\002 \001(\t\022H\n\nprovenance\030\003 \003(\01324.google.clo" + + "ud.documentai.v1beta3.Document.Provenanc" + + "eB\010\n\006sourceB\352\001\n#com.google.cloud.documen" + + "tai.v1beta3B\rDocumentProtoP\001ZIgoogle.gol" + + "ang.org/genproto/googleapis/cloud/docume" + + "ntai/v1beta3;documentai\252\002\037Google.Cloud.D" + + "ocumentAI.V1Beta3\312\002\037Google\\Cloud\\Documen" + + "tAI\\V1beta3\352\002\"Google::Cloud::DocumentAI:" + + ":V1beta3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.documentai.v1beta3.BarcodeProto.getDescriptor(), com.google.cloud.documentai.v1beta3.GeometryProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), @@ -471,6 +485,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Tables", "FormFields", "Symbols", + "DetectedBarcodes", "Provenance", }); internal_static_google_cloud_documentai_v1beta3_Document_Page_Dimension_descriptor = @@ -626,12 +641,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "NameDetectedLanguages", "ValueDetectedLanguages", "ValueType", + "CorrectedKeyText", + "CorrectedValueText", "Provenance", }); - internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_descriptor = + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor = internal_static_google_cloud_documentai_v1beta3_Document_Page_descriptor .getNestedTypes() .get(12); + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedBarcode_descriptor, + new java.lang.String[] { + "Layout", "Barcode", + }); + internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_descriptor = + internal_static_google_cloud_documentai_v1beta3_Document_Page_descriptor + .getNestedTypes() + .get(13); internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_descriptor, @@ -669,6 +696,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DatetimeValue", "AddressValue", "BooleanValue", + "IntegerValue", + "FloatValue", "Text", "StructuredValue", }); @@ -740,7 +769,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_Document_Revision_descriptor, new java.lang.String[] { - "Agent", "Processor", "Id", "Parent", "CreateTime", "HumanReview", "Source", + "Agent", + "Processor", + "Id", + "Parent", + "ParentIds", + "CreateTime", + "HumanReview", + "Source", }); internal_static_google_cloud_documentai_v1beta3_Document_Revision_HumanReview_descriptor = internal_static_google_cloud_documentai_v1beta3_Document_Revision_descriptor @@ -765,8 +801,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.documentai.v1beta3.BarcodeProto.getDescriptor(); com.google.cloud.documentai.v1beta3.GeometryProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchema.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchema.java new file mode 100644 index 00000000000..a7547e02b3d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchema.java @@ -0,0 +1,7186 @@ +/* + * 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/documentai/v1beta3/document_schema.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The schema defines the output of the processed document by a processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema} + */ +public final class DocumentSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DocumentSchema) + DocumentSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentSchema.newBuilder() to construct. + private DocumentSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentSchema() { + displayName_ = ""; + description_ = ""; + entityTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentSchema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentSchema( + 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(); + + displayName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entityTypes_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType>(); + mutable_bitField0_ |= 0x00000001; + } + entityTypes_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.parser(), + extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder.class); + } + + public interface EntityTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + boolean hasEnumValues(); + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues getEnumValues(); + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder(); + + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + java.util.List getBaseTypesList(); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + int getBaseTypesCount(); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + java.lang.String getBaseTypes(int index); + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + com.google.protobuf.ByteString getBaseTypesBytes(int index); + + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + java.util.List + getPropertiesList(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property getProperties(int index); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + int getPropertiesCount(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + java.util.List< + ? extends + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList(); + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index); + + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.ValueSourceCase + getValueSourceCase(); + } + /** + * + * + *
+   * EntityType is the wrapper of a label of the corresponding model with
+   * detailed attributes and limitations for entity-based processors. Multiple
+   * types can also compose a dependency tree to represent nested types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType} + */ + public static final class EntityType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + EntityTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use EntityType.newBuilder() to construct. + private EntityType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EntityType() { + displayName_ = ""; + name_ = ""; + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + properties_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EntityType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + baseTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + baseTypes_.add(s); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + properties_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property>(); + mutable_bitField0_ |= 0x00000002; + } + properties_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .parser(), + extensionRegistry)); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 114: + { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder + subBuilder = null; + if (valueSourceCase_ == 14) { + subBuilder = + ((com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_) + .toBuilder(); + } + valueSource_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_); + valueSource_ = subBuilder.buildPartial(); + } + valueSourceCase_ = 14; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + baseTypes_ = baseTypes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder.class); + } + + public interface EnumValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); + } + /** + * + * + *
+     * Defines the a list of enum values.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} + */ + public static final class EnumValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + EnumValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumValues.newBuilder() to construct. + private EnumValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumValues(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnumValues( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + values_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder + .class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList values_; + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+       * The individual values that this enum values type can include.
+       * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + 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 < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + 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 < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues other = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) obj; + + if (!getValuesList().equals(other.getValuesList())) 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 (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues 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; + } + /** + * + * + *
+       * Defines the a list of enum values.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder + .class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.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(); + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_EnumValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues build() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + buildPartial() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues result = + new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + values_ = values_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues other) { + if (other + == com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + 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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList values_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_.getUnmodifiableView(); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * The individual values that this enum values type can include.
+         * 
+ * + * repeated string values = 1; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + private static final com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues(); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumValues parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumValues(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.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + java.lang.String getValueType(); + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + com.google.protobuf.ByteString getValueTypeBytes(); + + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + int getOccurrenceTypeValue(); + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType(); + } + /** + * + * + *
+     * Defines properties that can be part of the entity type.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} + */ + public static final class Property extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + PropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Property() { + name_ = ""; + valueType_ = ""; + occurrenceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Property(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Property( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + valueType_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + occurrenceType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + .class); + } + + /** + * + * + *
+       * Types of occurrences of the entity type in the document.  Note: this
+       * represents the number of instances of an entity types, not number of
+       * mentions of a given entity instance.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType} + */ + public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Unspecified occurrence type.
+         * 
+ * + * OCCURRENCE_TYPE_UNSPECIFIED = 0; + */ + OCCURRENCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+         * There will be zero or one instance of this entity type.
+         * 
+ * + * OPTIONAL_ONCE = 1; + */ + OPTIONAL_ONCE(1), + /** + * + * + *
+         * The entity type will appear zero or multiple times.
+         * 
+ * + * OPTIONAL_MULTIPLE = 2; + */ + OPTIONAL_MULTIPLE(2), + /** + * + * + *
+         * The entity type will only appear exactly once.
+         * 
+ * + * REQUIRED_ONCE = 3; + */ + REQUIRED_ONCE(3), + /** + * + * + *
+         * The entity type will appear once or more times.
+         * 
+ * + * REQUIRED_MULTIPLE = 4; + */ + REQUIRED_MULTIPLE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Unspecified occurrence type.
+         * 
+ * + * OCCURRENCE_TYPE_UNSPECIFIED = 0; + */ + public static final int OCCURRENCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * There will be zero or one instance of this entity type.
+         * 
+ * + * OPTIONAL_ONCE = 1; + */ + public static final int OPTIONAL_ONCE_VALUE = 1; + /** + * + * + *
+         * The entity type will appear zero or multiple times.
+         * 
+ * + * OPTIONAL_MULTIPLE = 2; + */ + public static final int OPTIONAL_MULTIPLE_VALUE = 2; + /** + * + * + *
+         * The entity type will only appear exactly once.
+         * 
+ * + * REQUIRED_ONCE = 3; + */ + public static final int REQUIRED_ONCE_VALUE = 3; + /** + * + * + *
+         * The entity type will appear once or more times.
+         * 
+ * + * REQUIRED_MULTIPLE = 4; + */ + public static final int REQUIRED_MULTIPLE_VALUE = 4; + + 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 OccurrenceType 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 OccurrenceType forNumber(int value) { + switch (value) { + case 0: + return OCCURRENCE_TYPE_UNSPECIFIED; + case 1: + return OPTIONAL_ONCE; + case 2: + return OPTIONAL_MULTIPLE; + case 3: + return REQUIRED_ONCE; + case 4: + return REQUIRED_MULTIPLE; + 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 OccurrenceType findValueByNumber(int number) { + return OccurrenceType.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.documentai.v1beta3.DocumentSchema.EntityType.Property + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final OccurrenceType[] VALUES = values(); + + public static OccurrenceType 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 OccurrenceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+       * The name of the property.  Follows the same guidelines as the
+       * EntityType name.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object valueType_; + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + @java.lang.Override + public java.lang.String getValueType() { + java.lang.Object ref = valueType_; + 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(); + valueType_ = s; + return s; + } + } + /** + * + * + *
+       * A reference to the value type of the property.  This type is subject
+       * to the same conventions as the `Entity.base_types` field.
+       * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueTypeBytes() { + java.lang.Object ref = valueType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OCCURRENCE_TYPE_FIELD_NUMBER = 3; + private int occurrenceType_; + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + @java.lang.Override + public int getOccurrenceTypeValue() { + return occurrenceType_; + } + /** + * + * + *
+       * Occurrence type limits the number of instances an entity type appears
+       * in the document.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + result = + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .OccurrenceType.valueOf(occurrenceType_); + return result == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + .UNRECOGNIZED + : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valueType_); + } + if (occurrenceType_ + != com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + .OCCURRENCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, occurrenceType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueType_); + } + if (occurrenceType_ + != com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + .OCCURRENCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, occurrenceType_); + } + 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.documentai.v1beta3.DocumentSchema.EntityType.Property)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property other = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValueType().equals(other.getValueType())) return false; + if (occurrenceType_ != other.occurrenceType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + hash = (37 * hash) + OCCURRENCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + occurrenceType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + 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.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + 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.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + 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.documentai.v1beta3.DocumentSchema.EntityType.Property + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + 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.documentai.v1beta3.DocumentSchema.EntityType.Property + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + 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.documentai.v1beta3.DocumentSchema.EntityType.Property 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; + } + /** + * + * + *
+       * Defines properties that can be part of the entity type.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + .class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + valueType_ = ""; + + occurrenceType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_Property_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property build() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + buildPartial() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property result = + new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property(this); + result.name_ = name_; + result.valueType_ = valueType_; + result.occurrenceType_ = occurrenceType_; + 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.documentai.v1beta3.DocumentSchema.EntityType.Property) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property other) { + if (other + == com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getValueType().isEmpty()) { + valueType_ = other.valueType_; + onChanged(); + } + if (other.occurrenceType_ != 0) { + setOccurrenceTypeValue(other.getOccurrenceTypeValue()); + } + 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.documentai.v1beta3.DocumentSchema.EntityType.Property parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the property.  Follows the same guidelines as the
+         * EntityType name.
+         * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object valueType_ = ""; + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return The valueType. + */ + public java.lang.String getValueType() { + java.lang.Object ref = valueType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return The bytes for valueType. + */ + public com.google.protobuf.ByteString getValueTypeBytes() { + java.lang.Object ref = valueType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @param value The valueType to set. + * @return This builder for chaining. + */ + public Builder setValueType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearValueType() { + + valueType_ = getDefaultInstance().getValueType(); + onChanged(); + return this; + } + /** + * + * + *
+         * A reference to the value type of the property.  This type is subject
+         * to the same conventions as the `Entity.base_types` field.
+         * 
+ * + * string value_type = 2; + * + * @param value The bytes for valueType to set. + * @return This builder for chaining. + */ + public Builder setValueTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueType_ = value; + onChanged(); + return this; + } + + private int occurrenceType_ = 0; + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The enum numeric value on the wire for occurrenceType. + */ + @java.lang.Override + public int getOccurrenceTypeValue() { + return occurrenceType_; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @param value The enum numeric value on the wire for occurrenceType to set. + * @return This builder for chaining. + */ + public Builder setOccurrenceTypeValue(int value) { + + occurrenceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return The occurrenceType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + getOccurrenceType() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + result = + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .OccurrenceType.valueOf(occurrenceType_); + return result == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .OccurrenceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @param value The occurrenceType to set. + * @return This builder for chaining. + */ + public Builder setOccurrenceType( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + value) { + if (value == null) { + throw new NullPointerException(); + } + + occurrenceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Occurrence type limits the number of instances an entity type appears
+         * in the document.
+         * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearOccurrenceType() { + + occurrenceType_ = 0; + 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.documentai.v1beta3.DocumentSchema.EntityType.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + private static final com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property(); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Property(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.documentai.v1beta3.DocumentSchema.EntityType.Property + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int valueSourceCase_ = 0; + private java.lang.Object valueSource_; + + public enum ValueSourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ENUM_VALUES(14), + VALUESOURCE_NOT_SET(0); + private final int value; + + private ValueSourceCase(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 ValueSourceCase valueOf(int value) { + return forNumber(value); + } + + public static ValueSourceCase forNumber(int value) { + switch (value) { + case 14: + return ENUM_VALUES; + case 0: + return VALUESOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueSourceCase getValueSourceCase() { + return ValueSourceCase.forNumber(valueSourceCase_); + } + + public static final int ENUM_VALUES_FIELD_NUMBER = 14; + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueSourceCase_ == 14; + } + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + getEnumValues() { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + /** + * + * + *
+     * If specified, lists all the possible values for this entity.  This
+     * should not be more than a handful of values.  If the number of values
+     * is >10 or could change frequently use the `EntityType.value_ontology`
+     * field and specify a list of all possible values in a value ontology
+     * file.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder() { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 13; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * User defined name for the type.
+     * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the type. It must be unique within the schema file and
+     * cannot be a 'Common Type'.  Besides that we use the following naming
+     * conventions:
+     * - *use snake_casing*
+     * - name matching is case-insensitive
+     * - Maximum 64 characters.
+     * - Must start with a letter.
+     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+     *   compatibility internal infrastructure and tooling can handle any ascii
+     *   character)
+     * - The '/' is sometimes used to denote a property of a type.  For example
+     *   line_item/amount.  This convention is deprecated, but will still be
+     *   honored for backward compatibility.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BASE_TYPES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList baseTypes_; + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + public com.google.protobuf.ProtocolStringList getBaseTypesList() { + return baseTypes_; + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + public int getBaseTypesCount() { + return baseTypes_.size(); + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + public java.lang.String getBaseTypes(int index) { + return baseTypes_.get(index); + } + /** + * + * + *
+     * The entity type that this type is derived from.  For now, one and only
+     * one should be set.
+     * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + public com.google.protobuf.ByteString getBaseTypesBytes(int index) { + return baseTypes_.getByteString(index); + } + + public static final int PROPERTIES_FIELD_NUMBER = 6; + private java.util.List + properties_; + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public java.util.List + getPropertiesList() { + return properties_; + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property getProperties( + int index) { + return properties_.get(index); + } + /** + * + * + *
+     * Describing the nested structure, or composition of an entity.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + return properties_.get(index); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < baseTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, baseTypes_.getRaw(i)); + } + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(6, properties_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, displayName_); + } + if (valueSourceCase_ == 14) { + output.writeMessage( + 14, + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < baseTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(baseTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getBaseTypesList().size(); + } + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, properties_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, displayName_); + } + if (valueSourceCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_); + } + 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.documentai.v1beta3.DocumentSchema.EntityType)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType other = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getName().equals(other.getName())) return false; + if (!getBaseTypesList().equals(other.getBaseTypesList())) return false; + if (!getPropertiesList().equals(other.getPropertiesList())) return false; + if (!getValueSourceCase().equals(other.getValueSourceCase())) return false; + switch (valueSourceCase_) { + case 14: + if (!getEnumValues().equals(other.getEnumValues())) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getBaseTypesCount() > 0) { + hash = (37 * hash) + BASE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getBaseTypesList().hashCode(); + } + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + switch (valueSourceCase_) { + case 14: + hash = (37 * hash) + ENUM_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getEnumValues().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType 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.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType 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.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType 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.documentai.v1beta3.DocumentSchema.EntityType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType 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.documentai.v1beta3.DocumentSchema.EntityType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType 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.documentai.v1beta3.DocumentSchema.EntityType 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; + } + /** + * + * + *
+     * EntityType is the wrapper of a label of the corresponding model with
+     * detailed attributes and limitations for entity-based processors. Multiple
+     * types can also compose a dependency tree to represent nested types.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.EntityType} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPropertiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + name_ = ""; + + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + propertiesBuilder_.clear(); + } + valueSourceCase_ = 0; + valueSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_EntityType_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType build() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType buildPartial() { + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType result = + new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType(this); + int from_bitField0_ = bitField0_; + if (valueSourceCase_ == 14) { + if (enumValuesBuilder_ == null) { + result.valueSource_ = valueSource_; + } else { + result.valueSource_ = enumValuesBuilder_.build(); + } + } + result.displayName_ = displayName_; + result.name_ = name_; + if (((bitField0_ & 0x00000001) != 0)) { + baseTypes_ = baseTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.baseTypes_ = baseTypes_; + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + result.valueSourceCase_ = valueSourceCase_; + 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.documentai.v1beta3.DocumentSchema.EntityType) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType other) { + if (other + == com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.baseTypes_.isEmpty()) { + if (baseTypes_.isEmpty()) { + baseTypes_ = other.baseTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBaseTypesIsMutable(); + baseTypes_.addAll(other.baseTypes_); + } + onChanged(); + } + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000002); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + switch (other.getValueSourceCase()) { + case ENUM_VALUES: + { + mergeEnumValues(other.getEnumValues()); + break; + } + case VALUESOURCE_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.documentai.v1beta3.DocumentSchema.EntityType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valueSourceCase_ = 0; + private java.lang.Object valueSource_; + + public ValueSourceCase getValueSourceCase() { + return ValueSourceCase.forNumber(valueSourceCase_); + } + + public Builder clearValueSource() { + valueSourceCase_ = 0; + valueSource_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder> + enumValuesBuilder_; + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueSourceCase_ == 14; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + getEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } else { + if (valueSourceCase_ == 14) { + return enumValuesBuilder_.getMessage(); + } + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder setEnumValues( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues value) { + if (enumValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueSource_ = value; + onChanged(); + } else { + enumValuesBuilder_.setMessage(value); + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder setEnumValues( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder + builderForValue) { + if (enumValuesBuilder_ == null) { + valueSource_ = builderForValue.build(); + onChanged(); + } else { + enumValuesBuilder_.setMessage(builderForValue.build()); + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder mergeEnumValues( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues value) { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14 + && valueSource_ + != com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance()) { + valueSource_ = + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.newBuilder( + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_) + .mergeFrom(value) + .buildPartial(); + } else { + valueSource_ = value; + } + onChanged(); + } else { + if (valueSourceCase_ == 14) { + enumValuesBuilder_.mergeFrom(value); + } else { + enumValuesBuilder_.setMessage(value); + } + } + valueSourceCase_ = 14; + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public Builder clearEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueSourceCase_ == 14) { + valueSourceCase_ = 0; + valueSource_ = null; + onChanged(); + } + } else { + if (valueSourceCase_ == 14) { + valueSourceCase_ = 0; + valueSource_ = null; + } + enumValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder + getEnumValuesBuilder() { + return getEnumValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder + getEnumValuesOrBuilder() { + if ((valueSourceCase_ == 14) && (enumValuesBuilder_ != null)) { + return enumValuesBuilder_.getMessageOrBuilder(); + } else { + if (valueSourceCase_ == 14) { + return (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_; + } + return com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + } + /** + * + * + *
+       * If specified, lists all the possible values for this entity.  This
+       * should not be more than a handful of values.  If the number of values
+       * is >10 or could change frequently use the `EntityType.value_ontology`
+       * field and specify a list of all possible values in a value ontology
+       * file.
+       * 
+ * + * + * .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues enum_values = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValuesOrBuilder> + getEnumValuesFieldBuilder() { + if (enumValuesBuilder_ == null) { + if (!(valueSourceCase_ == 14)) { + valueSource_ = + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + .getDefaultInstance(); + } + enumValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType + .EnumValuesOrBuilder>( + (com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + valueSource_, + getParentForChildren(), + isClean()); + valueSource_ = null; + } + valueSourceCase_ = 14; + onChanged(); + ; + return enumValuesBuilder_; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * User defined name for the type.
+       * 
+ * + * string display_name = 13; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the type. It must be unique within the schema file and
+       * cannot be a 'Common Type'.  Besides that we use the following naming
+       * conventions:
+       * - *use snake_casing*
+       * - name matching is case-insensitive
+       * - Maximum 64 characters.
+       * - Must start with a letter.
+       * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
+       *   compatibility internal infrastructure and tooling can handle any ascii
+       *   character)
+       * - The '/' is sometimes used to denote a property of a type.  For example
+       *   line_item/amount.  This convention is deprecated, but will still be
+       *   honored for backward compatibility.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList baseTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBaseTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + baseTypes_ = new com.google.protobuf.LazyStringArrayList(baseTypes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return A list containing the baseTypes. + */ + public com.google.protobuf.ProtocolStringList getBaseTypesList() { + return baseTypes_.getUnmodifiableView(); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return The count of baseTypes. + */ + public int getBaseTypesCount() { + return baseTypes_.size(); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the element to return. + * @return The baseTypes at the given index. + */ + public java.lang.String getBaseTypes(int index) { + return baseTypes_.get(index); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the baseTypes at the given index. + */ + public com.google.protobuf.ByteString getBaseTypesBytes(int index) { + return baseTypes_.getByteString(index); + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param index The index to set the value at. + * @param value The baseTypes to set. + * @return This builder for chaining. + */ + public Builder setBaseTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBaseTypesIsMutable(); + baseTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param value The baseTypes to add. + * @return This builder for chaining. + */ + public Builder addBaseTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBaseTypesIsMutable(); + baseTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param values The baseTypes to add. + * @return This builder for chaining. + */ + public Builder addAllBaseTypes(java.lang.Iterable values) { + ensureBaseTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, baseTypes_); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @return This builder for chaining. + */ + public Builder clearBaseTypes() { + baseTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The entity type that this type is derived from.  For now, one and only
+       * one should be set.
+       * 
+ * + * repeated string base_types = 2; + * + * @param value The bytes of the baseTypes to add. + * @return This builder for chaining. + */ + public Builder addBaseTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBaseTypesIsMutable(); + baseTypes_.add(value); + onChanged(); + return this; + } + + private java.util.List + properties_ = java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + properties_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property>( + properties_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List + getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property getProperties( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder setProperties( + int index, com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder setProperties( + int index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + int index, com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addProperties( + int index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder addAllProperties( + java.lang.Iterable< + ? extends com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property> + values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + getPropertiesBuilder(int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List< + ? extends + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder + addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Describing the nested structure, or composition of an entity.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property properties = 6; + * + */ + public java.util.List< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder> + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.PropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + @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.documentai.v1beta3.DocumentSchema.EntityType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + private static final com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType(); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EntityType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EntityType(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.documentai.v1beta3.DocumentSchema.EntityType + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If true, a `document` entity type can be applied to subdocument (
+     * splitting). Otherwise, it can only be applied to the entire document
+     * (classification).
+     * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + boolean getDocumentSplitter(); + + /** + * + * + *
+     * If true, on a given page, there can be multiple `document` annotations
+     * covering it.
+     * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + boolean getDocumentAllowMultipleLabels(); + + /** + * + * + *
+     * If set, all the nested entities must be prefixed with the parents.
+     * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + boolean getPrefixedNamingOnProperties(); + + /** + * + * + *
+     * If set, we will skip the naming format validation in the schema. So the
+     * string values in `DocumentSchema.EntityType.name` and
+     * `DocumentSchema.EntityType.Property.name` will not be checked.
+     * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + boolean getSkipNamingValidation(); + } + /** + * + * + *
+   * Metadata for global schema behavior.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Metadata( + 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: + { + documentSplitter_ = input.readBool(); + break; + } + case 16: + { + documentAllowMultipleLabels_ = input.readBool(); + break; + } + case 48: + { + prefixedNamingOnProperties_ = input.readBool(); + break; + } + case 56: + { + skipNamingValidation_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder.class); + } + + public static final int DOCUMENT_SPLITTER_FIELD_NUMBER = 1; + private boolean documentSplitter_; + /** + * + * + *
+     * If true, a `document` entity type can be applied to subdocument (
+     * splitting). Otherwise, it can only be applied to the entire document
+     * (classification).
+     * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + @java.lang.Override + public boolean getDocumentSplitter() { + return documentSplitter_; + } + + public static final int DOCUMENT_ALLOW_MULTIPLE_LABELS_FIELD_NUMBER = 2; + private boolean documentAllowMultipleLabels_; + /** + * + * + *
+     * If true, on a given page, there can be multiple `document` annotations
+     * covering it.
+     * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + @java.lang.Override + public boolean getDocumentAllowMultipleLabels() { + return documentAllowMultipleLabels_; + } + + public static final int PREFIXED_NAMING_ON_PROPERTIES_FIELD_NUMBER = 6; + private boolean prefixedNamingOnProperties_; + /** + * + * + *
+     * If set, all the nested entities must be prefixed with the parents.
+     * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + @java.lang.Override + public boolean getPrefixedNamingOnProperties() { + return prefixedNamingOnProperties_; + } + + public static final int SKIP_NAMING_VALIDATION_FIELD_NUMBER = 7; + private boolean skipNamingValidation_; + /** + * + * + *
+     * If set, we will skip the naming format validation in the schema. So the
+     * string values in `DocumentSchema.EntityType.name` and
+     * `DocumentSchema.EntityType.Property.name` will not be checked.
+     * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + @java.lang.Override + public boolean getSkipNamingValidation() { + return skipNamingValidation_; + } + + 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 (documentSplitter_ != false) { + output.writeBool(1, documentSplitter_); + } + if (documentAllowMultipleLabels_ != false) { + output.writeBool(2, documentAllowMultipleLabels_); + } + if (prefixedNamingOnProperties_ != false) { + output.writeBool(6, prefixedNamingOnProperties_); + } + if (skipNamingValidation_ != false) { + output.writeBool(7, skipNamingValidation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (documentSplitter_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, documentSplitter_); + } + if (documentAllowMultipleLabels_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, documentAllowMultipleLabels_); + } + if (prefixedNamingOnProperties_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(6, prefixedNamingOnProperties_); + } + if (skipNamingValidation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, skipNamingValidation_); + } + 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.documentai.v1beta3.DocumentSchema.Metadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata other = + (com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata) obj; + + if (getDocumentSplitter() != other.getDocumentSplitter()) return false; + if (getDocumentAllowMultipleLabels() != other.getDocumentAllowMultipleLabels()) return false; + if (getPrefixedNamingOnProperties() != other.getPrefixedNamingOnProperties()) return false; + if (getSkipNamingValidation() != other.getSkipNamingValidation()) 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) + DOCUMENT_SPLITTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentSplitter()); + hash = (37 * hash) + DOCUMENT_ALLOW_MULTIPLE_LABELS_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDocumentAllowMultipleLabels()); + hash = (37 * hash) + PREFIXED_NAMING_ON_PROPERTIES_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPrefixedNamingOnProperties()); + hash = (37 * hash) + SKIP_NAMING_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipNamingValidation()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata 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.documentai.v1beta3.DocumentSchema.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata 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.documentai.v1beta3.DocumentSchema.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata 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.documentai.v1beta3.DocumentSchema.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata 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.documentai.v1beta3.DocumentSchema.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata 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.documentai.v1beta3.DocumentSchema.Metadata 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; + } + /** + * + * + *
+     * Metadata for global schema behavior.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema.Metadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.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(); + documentSplitter_ = false; + + documentAllowMultipleLabels_ = false; + + prefixedNamingOnProperties_ = false; + + skipNamingValidation_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_Metadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata build() { + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata buildPartial() { + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata result = + new com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata(this); + result.documentSplitter_ = documentSplitter_; + result.documentAllowMultipleLabels_ = documentAllowMultipleLabels_; + result.prefixedNamingOnProperties_ = prefixedNamingOnProperties_; + result.skipNamingValidation_ = skipNamingValidation_; + 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.documentai.v1beta3.DocumentSchema.Metadata) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata other) { + if (other + == com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.getDefaultInstance()) + return this; + if (other.getDocumentSplitter() != false) { + setDocumentSplitter(other.getDocumentSplitter()); + } + if (other.getDocumentAllowMultipleLabels() != false) { + setDocumentAllowMultipleLabels(other.getDocumentAllowMultipleLabels()); + } + if (other.getPrefixedNamingOnProperties() != false) { + setPrefixedNamingOnProperties(other.getPrefixedNamingOnProperties()); + } + if (other.getSkipNamingValidation() != false) { + setSkipNamingValidation(other.getSkipNamingValidation()); + } + 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.documentai.v1beta3.DocumentSchema.Metadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean documentSplitter_; + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @return The documentSplitter. + */ + @java.lang.Override + public boolean getDocumentSplitter() { + return documentSplitter_; + } + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @param value The documentSplitter to set. + * @return This builder for chaining. + */ + public Builder setDocumentSplitter(boolean value) { + + documentSplitter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, a `document` entity type can be applied to subdocument (
+       * splitting). Otherwise, it can only be applied to the entire document
+       * (classification).
+       * 
+ * + * bool document_splitter = 1; + * + * @return This builder for chaining. + */ + public Builder clearDocumentSplitter() { + + documentSplitter_ = false; + onChanged(); + return this; + } + + private boolean documentAllowMultipleLabels_; + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return The documentAllowMultipleLabels. + */ + @java.lang.Override + public boolean getDocumentAllowMultipleLabels() { + return documentAllowMultipleLabels_; + } + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @param value The documentAllowMultipleLabels to set. + * @return This builder for chaining. + */ + public Builder setDocumentAllowMultipleLabels(boolean value) { + + documentAllowMultipleLabels_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, on a given page, there can be multiple `document` annotations
+       * covering it.
+       * 
+ * + * bool document_allow_multiple_labels = 2; + * + * @return This builder for chaining. + */ + public Builder clearDocumentAllowMultipleLabels() { + + documentAllowMultipleLabels_ = false; + onChanged(); + return this; + } + + private boolean prefixedNamingOnProperties_; + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return The prefixedNamingOnProperties. + */ + @java.lang.Override + public boolean getPrefixedNamingOnProperties() { + return prefixedNamingOnProperties_; + } + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @param value The prefixedNamingOnProperties to set. + * @return This builder for chaining. + */ + public Builder setPrefixedNamingOnProperties(boolean value) { + + prefixedNamingOnProperties_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, all the nested entities must be prefixed with the parents.
+       * 
+ * + * bool prefixed_naming_on_properties = 6; + * + * @return This builder for chaining. + */ + public Builder clearPrefixedNamingOnProperties() { + + prefixedNamingOnProperties_ = false; + onChanged(); + return this; + } + + private boolean skipNamingValidation_; + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @return The skipNamingValidation. + */ + @java.lang.Override + public boolean getSkipNamingValidation() { + return skipNamingValidation_; + } + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @param value The skipNamingValidation to set. + * @return This builder for chaining. + */ + public Builder setSkipNamingValidation(boolean value) { + + skipNamingValidation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, we will skip the naming format validation in the schema. So the
+       * string values in `DocumentSchema.EntityType.name` and
+       * `DocumentSchema.EntityType.Property.name` will not be checked.
+       * 
+ * + * bool skip_naming_validation = 7; + * + * @return This builder for chaining. + */ + public Builder clearSkipNamingValidation() { + + skipNamingValidation_ = false; + 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.documentai.v1beta3.DocumentSchema.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + private static final com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata(); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Metadata(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.documentai.v1beta3.DocumentSchema.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_TYPES_FIELD_NUMBER = 3; + private java.util.List + entityTypes_; + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + @java.lang.Override + public java.util.List + getEntityTypesList() { + return entityTypes_; + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder> + getEntityTypesOrBuilderList() { + return entityTypes_; + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + @java.lang.Override + public int getEntityTypesCount() { + return entityTypes_.size(); + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType getEntityTypes(int index) { + return entityTypes_.get(index); + } + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder + getEntityTypesOrBuilder(int index) { + return entityTypes_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata_; + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata getMetadata() { + return metadata_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder + getMetadataOrBuilder() { + return getMetadata(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + for (int i = 0; i < entityTypes_.size(); i++) { + output.writeMessage(3, entityTypes_.get(i)); + } + if (metadata_ != null) { + output.writeMessage(4, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + for (int i = 0; i < entityTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, entityTypes_.get(i)); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMetadata()); + } + 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.documentai.v1beta3.DocumentSchema)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DocumentSchema other = + (com.google.cloud.documentai.v1beta3.DocumentSchema) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getEntityTypesList().equals(other.getEntityTypesList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getEntityTypesCount() > 0) { + hash = (37 * hash) + ENTITY_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getEntityTypesList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema 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.documentai.v1beta3.DocumentSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema 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.documentai.v1beta3.DocumentSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema 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.documentai.v1beta3.DocumentSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema 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.documentai.v1beta3.DocumentSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema 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.documentai.v1beta3.DocumentSchema 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 schema defines the output of the processed document by a processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DocumentSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DocumentSchema) + com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DocumentSchema.class, + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.DocumentSchema.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEntityTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + description_ = ""; + + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entityTypesBuilder_.clear(); + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentSchema + .internal_static_google_cloud_documentai_v1beta3_DocumentSchema_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DocumentSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema build() { + com.google.cloud.documentai.v1beta3.DocumentSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema buildPartial() { + com.google.cloud.documentai.v1beta3.DocumentSchema result = + new com.google.cloud.documentai.v1beta3.DocumentSchema(this); + int from_bitField0_ = bitField0_; + result.displayName_ = displayName_; + result.description_ = description_; + if (entityTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entityTypes_ = entityTypes_; + } else { + result.entityTypes_ = entityTypesBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.DocumentSchema) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DocumentSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DocumentSchema other) { + if (other == com.google.cloud.documentai.v1beta3.DocumentSchema.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (entityTypesBuilder_ == null) { + if (!other.entityTypes_.isEmpty()) { + if (entityTypes_.isEmpty()) { + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntityTypesIsMutable(); + entityTypes_.addAll(other.entityTypes_); + } + onChanged(); + } + } else { + if (!other.entityTypes_.isEmpty()) { + if (entityTypesBuilder_.isEmpty()) { + entityTypesBuilder_.dispose(); + entityTypesBuilder_ = null; + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + entityTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntityTypesFieldBuilder() + : null; + } else { + entityTypesBuilder_.addAllMessages(other.entityTypes_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.DocumentSchema parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DocumentSchema) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Display name to show to users.
+     * 
+ * + * string display_name = 1; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the schema.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List + entityTypes_ = java.util.Collections.emptyList(); + + private void ensureEntityTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = + new java.util.ArrayList( + entityTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder> + entityTypesBuilder_; + + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public java.util.List + getEntityTypesList() { + if (entityTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entityTypes_); + } else { + return entityTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public int getEntityTypesCount() { + if (entityTypesBuilder_ == null) { + return entityTypes_.size(); + } else { + return entityTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType getEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder setEntityTypes( + int index, com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.set(index, value); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder setEntityTypes( + int index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder addEntityTypes( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder addEntityTypes( + int index, com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(index, value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder addEntityTypes( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder addEntityTypes( + int index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder addAllEntityTypes( + java.lang.Iterable + values) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entityTypes_); + onChanged(); + } else { + entityTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder clearEntityTypes() { + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entityTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public Builder removeEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.remove(index); + onChanged(); + } else { + entityTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder + getEntityTypesBuilder(int index) { + return getEntityTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder + getEntityTypesOrBuilder(int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder> + getEntityTypesOrBuilderList() { + if (entityTypesBuilder_ != null) { + return entityTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entityTypes_); + } + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder + addEntityTypesBuilder() { + return getEntityTypesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder + addEntityTypesBuilder(int index) { + return getEntityTypesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Entity types of the schema.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + public java.util.List + getEntityTypesBuilderList() { + return getEntityTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder> + getEntityTypesFieldBuilder() { + if (entityTypesBuilder_ == null) { + entityTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder>( + entityTypes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entityTypes_ = null; + } + return entityTypesBuilder_; + } + + private com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata, + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public Builder setMetadata(com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public Builder setMetadata( + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public Builder mergeMetadata( + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder + getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder + getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Metadata of the schema.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata, + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata, + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.DocumentSchema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DocumentSchema) + private static final com.google.cloud.documentai.v1beta3.DocumentSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DocumentSchema(); + } + + public static com.google.cloud.documentai.v1beta3.DocumentSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentSchema(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.documentai.v1beta3.DocumentSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchemaOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchemaOrBuilder.java new file mode 100644 index 00000000000..514f3be1bdb --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentSchemaOrBuilder.java @@ -0,0 +1,169 @@ +/* + * 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/documentai/v1beta3/document_schema.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DocumentSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DocumentSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Display name to show to users.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the schema.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + java.util.List + getEntityTypesList(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityType getEntityTypes(int index); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + int getEntityTypesCount(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + java.util.List + getEntityTypesOrBuilderList(); + /** + * + * + *
+   * Entity types of the schema.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.DocumentSchema.EntityType entity_types = 3; + * + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.EntityTypeOrBuilder getEntityTypesOrBuilder( + int index); + + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + * + * @return The metadata. + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.Metadata getMetadata(); + /** + * + * + *
+   * Metadata of the schema.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema.Metadata metadata = 4; + */ + com.google.cloud.documentai.v1beta3.DocumentSchema.MetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java index 7590cbcbf0e..a7a31370168 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java @@ -23,6 +23,7 @@ * *
  * Response message for the enable processor method.
+ * Intentionally empty proto for adding fields in future.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorResponse} @@ -260,6 +261,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Response message for the enable processor method.
+   * Intentionally empty proto for adding fields in future.
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorResponse} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java index 08f867800ce..81dffc714d5 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java @@ -120,7 +120,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The project of processor type to list.
-   * Format: projects/{project}/locations/{location}
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -146,7 +147,8 @@ public java.lang.String getParent() { * *
    * Required. The project of processor type to list.
-   * Format: projects/{project}/locations/{location}
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -496,7 +498,8 @@ public Builder mergeFrom( * *
      * Required. The project of processor type to list.
-     * Format: projects/{project}/locations/{location}
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -521,7 +524,8 @@ public java.lang.String getParent() { * *
      * Required. The project of processor type to list.
-     * Format: projects/{project}/locations/{location}
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -546,7 +550,8 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The project of processor type to list.
-     * Format: projects/{project}/locations/{location}
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -570,7 +575,8 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The project of processor type to list.
-     * Format: projects/{project}/locations/{location}
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -590,7 +596,8 @@ public Builder clearParent() { * *
      * Required. The project of processor type to list.
-     * Format: projects/{project}/locations/{location}
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
      * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java index 28c3e4712ba..53c65f50012 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java @@ -28,7 +28,8 @@ public interface FetchProcessorTypesRequestOrBuilder * *
    * Required. The project of processor type to list.
-   * Format: projects/{project}/locations/{location}
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -43,7 +44,8 @@ public interface FetchProcessorTypesRequestOrBuilder * *
    * Required. The project of processor type to list.
-   * Format: projects/{project}/locations/{location}
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
    * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GeometryProto.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GeometryProto.java index 2c99945068b..bd6472ec9bf 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GeometryProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GeometryProto.java @@ -50,26 +50,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n.google/cloud/documentai/v1beta3/geomet" + "ry.proto\022\037google.cloud.documentai.v1beta" - + "3\032\034google/api/annotations.proto\"\036\n\006Verte" - + "x\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\"(\n\020NormalizedVer" - + "tex\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\"\231\001\n\014BoundingPo" - + "ly\0229\n\010vertices\030\001 \003(\0132\'.google.cloud.docu" - + "mentai.v1beta3.Vertex\022N\n\023normalized_vert" - + "ices\030\002 \003(\01321.google.cloud.documentai.v1b" - + "eta3.NormalizedVertexB\352\001\n#com.google.clo" - + "ud.documentai.v1beta3B\rGeometryProtoP\001ZI" - + "google.golang.org/genproto/googleapis/cl" - + "oud/documentai/v1beta3;documentai\252\002\037Goog" - + "le.Cloud.DocumentAI.V1Beta3\312\002\037Google\\Clo" - + "ud\\DocumentAI\\V1beta3\352\002\"Google::Cloud::D" - + "ocumentAI::V1beta3b\006proto3" + + "3\"\036\n\006Vertex\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\"(\n\020Nor" + + "malizedVertex\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\"\231\001\n\014" + + "BoundingPoly\0229\n\010vertices\030\001 \003(\0132\'.google." + + "cloud.documentai.v1beta3.Vertex\022N\n\023norma" + + "lized_vertices\030\002 \003(\01321.google.cloud.docu" + + "mentai.v1beta3.NormalizedVertexB\352\001\n#com." + + "google.cloud.documentai.v1beta3B\rGeometr" + + "yProtoP\001ZIgoogle.golang.org/genproto/goo" + + "gleapis/cloud/documentai/v1beta3;documen" + + "tai\252\002\037Google.Cloud.DocumentAI.V1Beta3\312\002\037" + + "Google\\Cloud\\DocumentAI\\V1beta3\352\002\"Google" + + "::Cloud::DocumentAI::V1beta3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - }); + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_google_cloud_documentai_v1beta3_Vertex_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_documentai_v1beta3_Vertex_fieldAccessorTable = @@ -94,7 +90,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Vertices", "NormalizedVertices", }); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequest.java new file mode 100644 index 00000000000..358e8162516 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequest.java @@ -0,0 +1,653 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for get processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.GetProcessorRequest} + */ +public final class GetProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.GetProcessorRequest) + GetProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProcessorRequest.newBuilder() to construct. + private GetProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProcessorRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProcessorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.GetProcessorRequest.class, + com.google.cloud.documentai.v1beta3.GetProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.GetProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.GetProcessorRequest other = + (com.google.cloud.documentai.v1beta3.GetProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest 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.documentai.v1beta3.GetProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest 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.documentai.v1beta3.GetProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest 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.documentai.v1beta3.GetProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest 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.documentai.v1beta3.GetProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest 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.documentai.v1beta3.GetProcessorRequest 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; + } + /** + * + * + *
+   * Request message for get processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.GetProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.GetProcessorRequest) + com.google.cloud.documentai.v1beta3.GetProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.GetProcessorRequest.class, + com.google.cloud.documentai.v1beta3.GetProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.GetProcessorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.GetProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorRequest build() { + com.google.cloud.documentai.v1beta3.GetProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorRequest buildPartial() { + com.google.cloud.documentai.v1beta3.GetProcessorRequest result = + new com.google.cloud.documentai.v1beta3.GetProcessorRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.GetProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.GetProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.GetProcessorRequest other) { + if (other == com.google.cloud.documentai.v1beta3.GetProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.GetProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.GetProcessorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.GetProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.GetProcessorRequest) + private static final com.google.cloud.documentai.v1beta3.GetProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.GetProcessorRequest(); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProcessorRequest(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.documentai.v1beta3.GetProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequestOrBuilder.java new file mode 100644 index 00000000000..2c3c7109a9f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface GetProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.GetProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequest.java new file mode 100644 index 00000000000..9c4e3125488 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequest.java @@ -0,0 +1,659 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for get processor version.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.GetProcessorVersionRequest} + */ +public final class GetProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + GetProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProcessorVersionRequest.newBuilder() to construct. + private GetProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest other = + (com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest 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.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest 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.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest 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.documentai.v1beta3.GetProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest 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.documentai.v1beta3.GetProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest 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.documentai.v1beta3.GetProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for get processor version.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.GetProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_GetProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest build() { + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest result = + new com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + private static final com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProcessorVersionRequest(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.documentai.v1beta3.GetProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..9e38322f824 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/GetProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface GetProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequest.java new file mode 100644 index 00000000000..02b31761a06 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequest.java @@ -0,0 +1,948 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for list processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorTypesRequest} + */ +public final class ListProcessorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + ListProcessorTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorTypesRequest.newBuilder() to construct. + private ListProcessorTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorTypesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.class, + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of processor types to return.
+   * If unspecified, at most 100 processor types will be returned.
+   * The maximum value is 500; values above 500 will be coerced to 500.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest other = + (com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest 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.documentai.v1beta3.ListProcessorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest 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.documentai.v1beta3.ListProcessorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest 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.documentai.v1beta3.ListProcessorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest 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.documentai.v1beta3.ListProcessorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest 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.documentai.v1beta3.ListProcessorTypesRequest 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; + } + /** + * + * + *
+   * Request message for list processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.class, + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest build() { + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest result = + new com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of processor type to list.
+     * The available processor types may depend on the allow-listing on projects.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of processor types to return.
+     * If unspecified, at most 100 processor types will be returned.
+     * The maximum value is 500; values above 500 will be coerced to 500.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Used to retrieve the next page of results, empty if at the end of the list.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + private static final com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest(); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorTypesRequest(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.documentai.v1beta3.ListProcessorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequestOrBuilder.java new file mode 100644 index 00000000000..0b3435d7866 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location of processor type to list.
+   * The available processor types may depend on the allow-listing on projects.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of processor types to return.
+   * If unspecified, at most 100 processor types will be returned.
+   * The maximum value is 500; values above 500 will be coerced to 500.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Used to retrieve the next page of results, empty if at the end of the list.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponse.java new file mode 100644 index 00000000000..4235fda0a8c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponse.java @@ -0,0 +1,1153 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Response message for list processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorTypesResponse} + */ +public final class ListProcessorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + ListProcessorTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorTypesResponse.newBuilder() to construct. + private ListProcessorTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorTypesResponse() { + processorTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorTypesResponse( + 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)) { + processorTypes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processorTypes_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.ProcessorType.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.Builder.class); + } + + public static final int PROCESSOR_TYPES_FIELD_NUMBER = 1; + private java.util.List processorTypes_; + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List getProcessorTypesList() { + return processorTypes_; + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List + getProcessorTypesOrBuilderList() { + return processorTypes_; + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public int getProcessorTypesCount() { + return processorTypes_.size(); + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType getProcessorTypes(int index) { + return processorTypes_.get(index); + } + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + return processorTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < processorTypes_.size(); i++) { + output.writeMessage(1, processorTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processorTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, processorTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse other = + (com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) obj; + + if (!getProcessorTypesList().equals(other.getProcessorTypesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProcessorTypesCount() > 0) { + hash = (37 * hash) + PROCESSOR_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getProcessorTypesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse 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.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse 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.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse 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.documentai.v1beta3.ListProcessorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse 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.documentai.v1beta3.ListProcessorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse 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.documentai.v1beta3.ListProcessorTypesResponse 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; + } + /** + * + * + *
+   * Response message for list processor types.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse build() { + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse result = + new com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse(this); + int from_bitField0_ = bitField0_; + if (processorTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = java.util.Collections.unmodifiableList(processorTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processorTypes_ = processorTypes_; + } else { + result.processorTypes_ = processorTypesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.getDefaultInstance()) + return this; + if (processorTypesBuilder_ == null) { + if (!other.processorTypes_.isEmpty()) { + if (processorTypes_.isEmpty()) { + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorTypesIsMutable(); + processorTypes_.addAll(other.processorTypes_); + } + onChanged(); + } + } else { + if (!other.processorTypes_.isEmpty()) { + if (processorTypesBuilder_.isEmpty()) { + processorTypesBuilder_.dispose(); + processorTypesBuilder_ = null; + processorTypes_ = other.processorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + processorTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorTypesFieldBuilder() + : null; + } else { + processorTypesBuilder_.addAllMessages(other.processorTypes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List processorTypes_ = + java.util.Collections.emptyList(); + + private void ensureProcessorTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processorTypes_ = + new java.util.ArrayList( + processorTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorType, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder, + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder> + processorTypesBuilder_; + + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesList() { + if (processorTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(processorTypes_); + } else { + return processorTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public int getProcessorTypesCount() { + if (processorTypesBuilder_ == null) { + return processorTypes_.size(); + } else { + return processorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorType getProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1beta3.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, value); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder setProcessorTypes( + int index, com.google.cloud.documentai.v1beta3.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes(com.google.cloud.documentai.v1beta3.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1beta3.ProcessorType value) { + if (processorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, value); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + com.google.cloud.documentai.v1beta3.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder addProcessorTypes( + int index, com.google.cloud.documentai.v1beta3.ProcessorType.Builder builderForValue) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + processorTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder addAllProcessorTypes( + java.lang.Iterable values) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processorTypes_); + onChanged(); + } else { + processorTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder clearProcessorTypes() { + if (processorTypesBuilder_ == null) { + processorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public Builder removeProcessorTypes(int index) { + if (processorTypesBuilder_ == null) { + ensureProcessorTypesIsMutable(); + processorTypes_.remove(index); + onChanged(); + } else { + processorTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.Builder getProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder getProcessorTypesOrBuilder( + int index) { + if (processorTypesBuilder_ == null) { + return processorTypes_.get(index); + } else { + return processorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesOrBuilderList() { + if (processorTypesBuilder_ != null) { + return processorTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processorTypes_); + } + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.Builder addProcessorTypesBuilder() { + return getProcessorTypesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1beta3.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.Builder addProcessorTypesBuilder( + int index) { + return getProcessorTypesFieldBuilder() + .addBuilder( + index, com.google.cloud.documentai.v1beta3.ProcessorType.getDefaultInstance()); + } + /** + * + * + *
+     * The processor types.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + public java.util.List + getProcessorTypesBuilderList() { + return getProcessorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorType, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder, + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder> + getProcessorTypesFieldBuilder() { + if (processorTypesBuilder_ == null) { + processorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorType, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder, + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder>( + processorTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + processorTypes_ = null; + } + return processorTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next page, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + private static final com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse(); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorTypesResponse(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.documentai.v1beta3.ListProcessorTypesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponseOrBuilder.java new file mode 100644 index 00000000000..b302f980c26 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorTypesResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + java.util.List getProcessorTypesList(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorType getProcessorTypes(int index); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + int getProcessorTypesCount(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + java.util.List + getProcessorTypesOrBuilderList(); + /** + * + * + *
+   * The processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder getProcessorTypesOrBuilder(int index); + + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Points to the next page, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequest.java new file mode 100644 index 00000000000..69f4d85911c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequest.java @@ -0,0 +1,951 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for list all processor versions belongs to a processor.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} + */ +public final class ListProcessorVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + ListProcessorVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorVersionsRequest.newBuilder() to construct. + private ListProcessorVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorVersionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.class, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of processor versions to return.
+   * If unspecified, at most 10 processor versions will be returned.
+   * The maximum value is 20; values above 20 will be coerced to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest other = + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest 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.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest 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.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest 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.documentai.v1beta3.ListProcessorVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest 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.documentai.v1beta3.ListProcessorVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest 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.documentai.v1beta3.ListProcessorVersionsRequest 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; + } + /** + * + * + *
+   * Request message for list all processor versions belongs to a processor.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.class, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest build() { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest result = + new com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to list all versions.
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of processor versions to return.
+     * If unspecified, at most 10 processor versions will be returned.
+     * The maximum value is 20; values above 20 will be coerced to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * We will return the processor versions sorted by creation time. The page
+     * token will point to the next processor version.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + private static final com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest(); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorVersionsRequest(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.documentai.v1beta3.ListProcessorVersionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequestOrBuilder.java new file mode 100644 index 00000000000..430387cbe42 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project, location and processor) to list all versions.
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of processor versions to return.
+   * If unspecified, at most 10 processor versions will be returned.
+   * The maximum value is 20; values above 20 will be coerced to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * We will return the processor versions sorted by creation time. The page
+   * token will point to the next processor version.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponse.java new file mode 100644 index 00000000000..588096c14ec --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponse.java @@ -0,0 +1,1178 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Response message for list processors.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} + */ +public final class ListProcessorVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + ListProcessorVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProcessorVersionsResponse.newBuilder() to construct. + private ListProcessorVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProcessorVersionsResponse() { + processorVersions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProcessorVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProcessorVersionsResponse( + 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)) { + processorVersions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + processorVersions_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.ProcessorVersion.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + processorVersions_ = java.util.Collections.unmodifiableList(processorVersions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.Builder.class); + } + + public static final int PROCESSOR_VERSIONS_FIELD_NUMBER = 1; + private java.util.List processorVersions_; + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public java.util.List + getProcessorVersionsList() { + return processorVersions_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public java.util.List + getProcessorVersionsOrBuilderList() { + return processorVersions_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public int getProcessorVersionsCount() { + return processorVersions_.size(); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion getProcessorVersions(int index) { + return processorVersions_.get(index); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder + getProcessorVersionsOrBuilder(int index) { + return processorVersions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < processorVersions_.size(); i++) { + output.writeMessage(1, processorVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < processorVersions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, processorVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse other = + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) obj; + + if (!getProcessorVersionsList().equals(other.getProcessorVersionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProcessorVersionsCount() > 0) { + hash = (37 * hash) + PROCESSOR_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getProcessorVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse 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.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse 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.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse 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.documentai.v1beta3.ListProcessorVersionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + 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.documentai.v1beta3.ListProcessorVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse 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.documentai.v1beta3.ListProcessorVersionsResponse 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; + } + /** + * + * + *
+   * Response message for list processors.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProcessorVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (processorVersionsBuilder_ == null) { + processorVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + processorVersionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse build() { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse result = + new com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (processorVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + processorVersions_ = java.util.Collections.unmodifiableList(processorVersions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.processorVersions_ = processorVersions_; + } else { + result.processorVersions_ = processorVersionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.getDefaultInstance()) + return this; + if (processorVersionsBuilder_ == null) { + if (!other.processorVersions_.isEmpty()) { + if (processorVersions_.isEmpty()) { + processorVersions_ = other.processorVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcessorVersionsIsMutable(); + processorVersions_.addAll(other.processorVersions_); + } + onChanged(); + } + } else { + if (!other.processorVersions_.isEmpty()) { + if (processorVersionsBuilder_.isEmpty()) { + processorVersionsBuilder_.dispose(); + processorVersionsBuilder_ = null; + processorVersions_ = other.processorVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + processorVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProcessorVersionsFieldBuilder() + : null; + } else { + processorVersionsBuilder_.addAllMessages(other.processorVersions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + processorVersions_ = java.util.Collections.emptyList(); + + private void ensureProcessorVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + processorVersions_ = + new java.util.ArrayList( + processorVersions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion, + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder> + processorVersionsBuilder_; + + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public java.util.List + getProcessorVersionsList() { + if (processorVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(processorVersions_); + } else { + return processorVersionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public int getProcessorVersionsCount() { + if (processorVersionsBuilder_ == null) { + return processorVersions_.size(); + } else { + return processorVersionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion getProcessorVersions(int index) { + if (processorVersionsBuilder_ == null) { + return processorVersions_.get(index); + } else { + return processorVersionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder setProcessorVersions( + int index, com.google.cloud.documentai.v1beta3.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.set(index, value); + onChanged(); + } else { + processorVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder setProcessorVersions( + int index, com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder addProcessorVersions( + com.google.cloud.documentai.v1beta3.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.add(value); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder addProcessorVersions( + int index, com.google.cloud.documentai.v1beta3.ProcessorVersion value) { + if (processorVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcessorVersionsIsMutable(); + processorVersions_.add(index, value); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder addProcessorVersions( + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.add(builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder addProcessorVersions( + int index, com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder builderForValue) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + processorVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder addAllProcessorVersions( + java.lang.Iterable values) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, processorVersions_); + onChanged(); + } else { + processorVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder clearProcessorVersions() { + if (processorVersionsBuilder_ == null) { + processorVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + processorVersionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public Builder removeProcessorVersions(int index) { + if (processorVersionsBuilder_ == null) { + ensureProcessorVersionsIsMutable(); + processorVersions_.remove(index); + onChanged(); + } else { + processorVersionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder getProcessorVersionsBuilder( + int index) { + return getProcessorVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder + getProcessorVersionsOrBuilder(int index) { + if (processorVersionsBuilder_ == null) { + return processorVersions_.get(index); + } else { + return processorVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public java.util.List + getProcessorVersionsOrBuilderList() { + if (processorVersionsBuilder_ != null) { + return processorVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(processorVersions_); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder + addProcessorVersionsBuilder() { + return getProcessorVersionsFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1beta3.ProcessorVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder addProcessorVersionsBuilder( + int index) { + return getProcessorVersionsFieldBuilder() + .addBuilder( + index, com.google.cloud.documentai.v1beta3.ProcessorVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + * + */ + public java.util.List + getProcessorVersionsBuilderList() { + return getProcessorVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion, + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder> + getProcessorVersionsFieldBuilder() { + if (processorVersionsBuilder_ == null) { + processorVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion, + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder>( + processorVersions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + processorVersions_ = null; + } + return processorVersionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to the next processor, otherwise empty.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + private static final com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse(); + } + + public static com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProcessorVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProcessorVersionsResponse(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.documentai.v1beta3.ListProcessorVersionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponseOrBuilder.java new file mode 100644 index 00000000000..af82f773ca4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorVersionsResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + java.util.List getProcessorVersionsList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorVersion getProcessorVersions(int index); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + int getProcessorVersionsCount(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + java.util.List + getProcessorVersionsOrBuilderList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorVersion processor_versions = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder getProcessorVersionsOrBuilder( + int index); + + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Points to the next processor, otherwise empty.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java index 22c065c1a28..f27f9b5adfe 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java @@ -133,7 +133,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The parent (project and location) which owns this collection of Processors.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -159,7 +159,7 @@ public java.lang.String getParent() { * *
    * Required. The parent (project and location) which owns this collection of Processors.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -608,7 +608,7 @@ public Builder mergeFrom( * *
      * Required. The parent (project and location) which owns this collection of Processors.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -633,7 +633,7 @@ public java.lang.String getParent() { * *
      * Required. The parent (project and location) which owns this collection of Processors.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -658,7 +658,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The parent (project and location) which owns this collection of Processors.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -682,7 +682,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The parent (project and location) which owns this collection of Processors.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * @@ -702,7 +702,7 @@ public Builder clearParent() { * *
      * Required. The parent (project and location) which owns this collection of Processors.
-     * Format: projects/{project}/locations/{location}
+     * Format: `projects/{project}/locations/{location}`
      * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java index 157b8446fca..c481292c023 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListProcessorsRequestOrBuilder * *
    * Required. The parent (project and location) which owns this collection of Processors.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * @@ -43,7 +43,7 @@ public interface ListProcessorsRequestOrBuilder * *
    * Required. The parent (project and location) which owns this collection of Processors.
-   * Format: projects/{project}/locations/{location}
+   * Format: `projects/{project}/locations/{location}`
    * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OperationMetadataProto.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OperationMetadataProto.java index 197c4ee89ba..24eeb64bfd7 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OperationMetadataProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/OperationMetadataProto.java @@ -43,29 +43,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n8google/cloud/documentai/v1beta3/operat" + "ion_metadata.proto\022\037google.cloud.documen" + "tai.v1beta3\032\037google/protobuf/timestamp.p" - + "roto\032\034google/api/annotations.proto\"\310\002\n\027C" - + "ommonOperationMetadata\022M\n\005state\030\001 \001(\0162>." - + "google.cloud.documentai.v1beta3.CommonOp" - + "erationMetadata.State\022\025\n\rstate_message\030\002" - + " \001(\t\022/\n\013create_time\030\003 \001(\0132\032.google.proto" - + "buf.Timestamp\022/\n\013update_time\030\004 \001(\0132\032.goo" - + "gle.protobuf.Timestamp\"e\n\005State\022\025\n\021STATE" - + "_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLIN" - + "G\020\002\022\r\n\tSUCCEEDED\020\003\022\n\n\006FAILED\020\004\022\r\n\tCANCEL" - + "LED\020\005B\363\001\n#com.google.cloud.documentai.v1" - + "beta3B\026OperationMetadataProtoP\001ZIgoogle." - + "golang.org/genproto/googleapis/cloud/doc" - + "umentai/v1beta3;documentai\252\002\037Google.Clou" - + "d.DocumentAI.V1Beta3\312\002\037Google\\Cloud\\Docu" - + "mentAI\\V1beta3\352\002\"Google::Cloud::Document" - + "AI::V1beta3b\006proto3" + + "roto\"\332\002\n\027CommonOperationMetadata\022M\n\005stat" + + "e\030\001 \001(\0162>.google.cloud.documentai.v1beta" + + "3.CommonOperationMetadata.State\022\025\n\rstate" + + "_message\030\002 \001(\t\022\020\n\010resource\030\005 \001(\t\022/\n\013crea" + + "te_time\030\003 \001(\0132\032.google.protobuf.Timestam" + + "p\022/\n\013update_time\030\004 \001(\0132\032.google.protobuf" + + ".Timestamp\"e\n\005State\022\025\n\021STATE_UNSPECIFIED" + + "\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLING\020\002\022\r\n\tSUCCE" + + "EDED\020\003\022\n\n\006FAILED\020\004\022\r\n\tCANCELLED\020\005B\363\001\n#co" + + "m.google.cloud.documentai.v1beta3B\026Opera" + + "tionMetadataProtoP\001ZIgoogle.golang.org/g" + + "enproto/googleapis/cloud/documentai/v1be" + + "ta3;documentai\252\002\037Google.Cloud.DocumentAI" + + ".V1Beta3\312\002\037Google\\Cloud\\DocumentAI\\V1bet" + + "a3\352\002\"Google::Cloud::DocumentAI::V1beta3b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_documentai_v1beta3_CommonOperationMetadata_descriptor = getDescriptor().getMessageTypes().get(0); @@ -73,10 +72,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_CommonOperationMetadata_descriptor, new java.lang.String[] { - "State", "StateMessage", "CreateTime", "UpdateTime", + "State", "StateMessage", "Resource", "CreateTime", "UpdateTime", }); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequest.java index ebda56a9154..dca3fa9c010 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequest.java @@ -129,6 +129,21 @@ private ProcessRequest( source_ = subBuilder.buildPartial(); } sourceCase_ = 5; + break; + } + case 50: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + break; } default: @@ -322,7 +337,12 @@ public com.google.cloud.documentai.v1beta3.RawDocumentOrBuilder getRawDocumentOr * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -347,7 +367,12 @@ public java.lang.String getName() { * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -381,7 +406,7 @@ public com.google.protobuf.ByteString getNameBytes() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return Whether the document field is set. */ @java.lang.Override @@ -399,7 +424,7 @@ public boolean hasDocument() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return The document. */ @java.lang.Override @@ -443,6 +468,52 @@ public boolean getSkipHumanReview() { return skipHumanReview_; } + public static final int FIELD_MASK_FIELD_NUMBER = 6; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + @java.lang.Override + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -472,6 +543,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceCase_ == 5) { output.writeMessage(5, (com.google.cloud.documentai.v1beta3.RawDocument) source_); } + if (fieldMask_ != null) { + output.writeMessage(6, getFieldMask()); + } unknownFields.writeTo(output); } @@ -500,6 +574,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 5, (com.google.cloud.documentai.v1beta3.RawDocument) source_); } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFieldMask()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -522,6 +599,10 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (getSkipHumanReview() != other.getSkipHumanReview()) return false; + if (hasFieldMask() != other.hasFieldMask()) return false; + if (hasFieldMask()) { + if (!getFieldMask().equals(other.getFieldMask())) return false; + } if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 4: @@ -552,6 +633,10 @@ public int hashCode() { } hash = (37 * hash) + SKIP_HUMAN_REVIEW_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipHumanReview()); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } switch (sourceCase_) { case 4: hash = (37 * hash) + INLINE_DOCUMENT_FIELD_NUMBER; @@ -719,6 +804,12 @@ public Builder clear() { } skipHumanReview_ = false; + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } sourceCase_ = 0; source_ = null; return this; @@ -769,6 +860,11 @@ public com.google.cloud.documentai.v1beta3.ProcessRequest buildPartial() { result.document_ = documentBuilder_.build(); } result.skipHumanReview_ = skipHumanReview_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -830,6 +926,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ProcessRequest othe if (other.getSkipHumanReview() != false) { setSkipHumanReview(other.getSkipHumanReview()); } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } switch (other.getSourceCase()) { case INLINE_DOCUMENT: { @@ -1315,7 +1414,12 @@ public com.google.cloud.documentai.v1beta3.RawDocumentOrBuilder getRawDocumentOr * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1339,7 +1443,12 @@ public java.lang.String getName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1363,7 +1472,12 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1386,7 +1500,12 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1405,7 +1524,12 @@ public Builder clearName() { * * *
-     * Required. The processor resource name.
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+     * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+     * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`, or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
      * 
* * @@ -1442,7 +1566,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return Whether the document field is set. */ @java.lang.Deprecated @@ -1459,7 +1583,7 @@ public boolean hasDocument() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return The document. */ @java.lang.Deprecated @@ -1679,6 +1803,185 @@ public Builder clearSkipHumanReview() { return this; } + private com.google.protobuf.FieldMask fieldMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Specifies which fields to include in ProcessResponse's document.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequestOrBuilder.java index 9aca4f273d6..2e724cc4df4 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessRequestOrBuilder.java @@ -97,7 +97,12 @@ public interface ProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -111,7 +116,12 @@ public interface ProcessRequestOrBuilder * * *
-   * Required. The processor resource name.
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
+   * to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
+   * its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`, or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    * 
* * @@ -132,7 +142,7 @@ public interface ProcessRequestOrBuilder * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return Whether the document field is set. */ @java.lang.Deprecated @@ -147,7 +157,7 @@ public interface ProcessRequestOrBuilder * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=182 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=277 * @return The document. */ @java.lang.Deprecated @@ -178,5 +188,40 @@ public interface ProcessRequestOrBuilder */ boolean getSkipHumanReview(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return Whether the fieldMask field is set. + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + * + * @return The fieldMask. + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Specifies which fields to include in ProcessResponse's document.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 6; + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + public com.google.cloud.documentai.v1beta3.ProcessRequest.SourceCase getSourceCase(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponse.java index 1241b278618..2cbf4580931 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponse.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponse.java @@ -212,7 +212,7 @@ public com.google.cloud.documentai.v1beta3.DocumentOrBuilder getDocumentOrBuilde * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The humanReviewOperation. */ @java.lang.Override @@ -241,7 +241,7 @@ public java.lang.String getHumanReviewOperation() { * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The bytes for humanReviewOperation. */ @java.lang.Override @@ -890,7 +890,7 @@ public com.google.cloud.documentai.v1beta3.DocumentOrBuilder getDocumentOrBuilde * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The humanReviewOperation. */ @java.lang.Deprecated @@ -918,7 +918,7 @@ public java.lang.String getHumanReviewOperation() { * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The bytes for humanReviewOperation. */ @java.lang.Deprecated @@ -946,7 +946,7 @@ public com.google.protobuf.ByteString getHumanReviewOperationBytes() { * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @param value The humanReviewOperation to set. * @return This builder for chaining. */ @@ -973,7 +973,7 @@ public Builder setHumanReviewOperation(java.lang.String value) { * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return This builder for chaining. */ @java.lang.Deprecated @@ -996,7 +996,7 @@ public Builder clearHumanReviewOperation() { * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @param value The bytes for humanReviewOperation to set. * @return This builder for chaining. */ diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponseOrBuilder.java index bfc8b57a872..fcd4a2f1690 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponseOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessResponseOrBuilder.java @@ -74,7 +74,7 @@ public interface ProcessResponseOrBuilder * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The humanReviewOperation. */ @java.lang.Deprecated @@ -92,7 +92,7 @@ public interface ProcessResponseOrBuilder * string human_review_operation = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ProcessResponse.human_review_operation is - * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=235 + * deprecated. See google/cloud/documentai/v1beta3/document_processor_service.proto;l=333 * @return The bytes for humanReviewOperation. */ @java.lang.Deprecated diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java index 3a5ff02dc95..f154beab54f 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java @@ -22,8 +22,8 @@ * * *
- * The first-class citizen for DocumentAI. Each processor defines how to extract
- * structural information from a document.
+ * The first-class citizen for Document AI. Each processor defines how to
+ * extract structural information from a document.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Processor} @@ -201,7 +201,9 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor is enabled.
+     * The processor is enabled, i.e., has an enabled version which can
+     * currently serve processing requests and all the feature dependencies have
+     * been successfully initialized.
      * 
* * ENABLED = 1; @@ -241,7 +243,11 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor is being created.
+     * The processor is being created, will become either ENABLED (for
+     * successful creation) or FAILED (for failed ones).
+     * Once a processor is in this state, it can then be used for document
+     * processing, but the feature dependencies of the processor might not be
+     * fully created yet.
      * 
* * CREATING = 5; @@ -251,7 +257,9 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor failed during creation.
+     * The processor failed during creation or initialization of feature
+     * dependencies. The user should delete the processor and recreate one as
+     * all the functionalities of the processor are disabled.
      * 
* * FAILED = 6; @@ -284,7 +292,9 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor is enabled.
+     * The processor is enabled, i.e., has an enabled version which can
+     * currently serve processing requests and all the feature dependencies have
+     * been successfully initialized.
      * 
* * ENABLED = 1; @@ -324,7 +334,11 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor is being created.
+     * The processor is being created, will become either ENABLED (for
+     * successful creation) or FAILED (for failed ones).
+     * Once a processor is in this state, it can then be used for document
+     * processing, but the feature dependencies of the processor might not be
+     * fully created yet.
      * 
* * CREATING = 5; @@ -334,7 +348,9 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The processor failed during creation.
+     * The processor failed during creation or initialization of feature
+     * dependencies. The user should delete the processor and recreate one as
+     * all the functionalities of the processor are disabled.
      * 
* * FAILED = 6; @@ -451,7 +467,7 @@ private State(int value) { * *
    * Output only. Immutable. The resource name of the processor.
-   * Format: projects/{project}/locations/{location}/processors/{processor}
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
    * 
* * @@ -477,7 +493,7 @@ public java.lang.String getName() { * *
    * Output only. Immutable. The resource name of the processor.
-   * Format: projects/{project}/locations/{location}/processors/{processor}
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
    * 
* * @@ -505,7 +521,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * The processor type.
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
    * 
* * string type = 2; @@ -528,7 +546,9 @@ public java.lang.String getType() { * * *
-   * The processor type.
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
    * 
* * string type = 2; @@ -648,7 +668,7 @@ public com.google.cloud.documentai.v1beta3.Processor.State getState() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The defaultProcessorVersion. */ @@ -671,7 +691,7 @@ public java.lang.String getDefaultProcessorVersion() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The bytes for defaultProcessorVersion. */ @@ -1071,8 +1091,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The first-class citizen for DocumentAI. Each processor defines how to extract
-   * structural information from a document.
+   * The first-class citizen for Document AI. Each processor defines how to
+   * extract structural information from a document.
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.Processor} @@ -1286,7 +1306,7 @@ public Builder mergeFrom( * *
      * Output only. Immutable. The resource name of the processor.
-     * Format: projects/{project}/locations/{location}/processors/{processor}
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
      * 
* * @@ -1311,7 +1331,7 @@ public java.lang.String getName() { * *
      * Output only. Immutable. The resource name of the processor.
-     * Format: projects/{project}/locations/{location}/processors/{processor}
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
      * 
* * @@ -1336,7 +1356,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Output only. Immutable. The resource name of the processor.
-     * Format: projects/{project}/locations/{location}/processors/{processor}
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
      * 
* * @@ -1360,7 +1380,7 @@ public Builder setName(java.lang.String value) { * *
      * Output only. Immutable. The resource name of the processor.
-     * Format: projects/{project}/locations/{location}/processors/{processor}
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
      * 
* * @@ -1380,7 +1400,7 @@ public Builder clearName() { * *
      * Output only. Immutable. The resource name of the processor.
-     * Format: projects/{project}/locations/{location}/processors/{processor}
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`
      * 
* * @@ -1406,7 +1426,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * The processor type.
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
      * 
* * string type = 2; @@ -1428,7 +1450,9 @@ public java.lang.String getType() { * * *
-     * The processor type.
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
      * 
* * string type = 2; @@ -1450,7 +1474,9 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * The processor type.
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
      * 
* * string type = 2; @@ -1471,7 +1497,9 @@ public Builder setType(java.lang.String value) { * * *
-     * The processor type.
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
      * 
* * string type = 2; @@ -1488,7 +1516,9 @@ public Builder clearType() { * * *
-     * The processor type.
+     * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+     * To get a list of processors types, see
+     * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
      * 
* * string type = 2; @@ -1724,7 +1754,7 @@ public Builder clearState() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The defaultProcessorVersion. */ @@ -1746,7 +1776,7 @@ public java.lang.String getDefaultProcessorVersion() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The bytes for defaultProcessorVersion. */ @@ -1768,7 +1798,7 @@ public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @param value The defaultProcessorVersion to set. * @return This builder for chaining. @@ -1789,7 +1819,7 @@ public Builder setDefaultProcessorVersion(java.lang.String value) { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -1806,7 +1836,7 @@ public Builder clearDefaultProcessorVersion() { * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @param value The bytes for defaultProcessorVersion to set. * @return This builder for chaining. diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java index 80ac03c3137..8b5433881e6 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java @@ -28,7 +28,7 @@ public interface ProcessorOrBuilder * *
    * Output only. Immutable. The resource name of the processor.
-   * Format: projects/{project}/locations/{location}/processors/{processor}
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
    * 
* * @@ -43,7 +43,7 @@ public interface ProcessorOrBuilder * *
    * Output only. Immutable. The resource name of the processor.
-   * Format: projects/{project}/locations/{location}/processors/{processor}
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`
    * 
* * @@ -58,7 +58,9 @@ public interface ProcessorOrBuilder * * *
-   * The processor type.
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
    * 
* * string type = 2; @@ -70,7 +72,9 @@ public interface ProcessorOrBuilder * * *
-   * The processor type.
+   * The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc.
+   * To get a list of processors types, see
+   * [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes].
    * 
* * string type = 2; @@ -140,7 +144,7 @@ public interface ProcessorOrBuilder * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The defaultProcessorVersion. */ @@ -152,7 +156,7 @@ public interface ProcessorOrBuilder * The default processor version. * * - * string default_processor_version = 9; + * string default_processor_version = 9 [(.google.api.resource_reference) = { ... } * * @return The bytes for defaultProcessorVersion. */ diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java index f314d43e019..e2807c9c4a6 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java @@ -43,6 +43,7 @@ private ProcessorType() { type_ = ""; category_ = ""; availableLocations_ = java.util.Collections.emptyList(); + launchStage_ = 0; } @java.lang.Override @@ -115,6 +116,13 @@ private ProcessorType( allowCreation_ = input.readBool(); break; } + case 64: + { + int rawValue = input.readEnum(); + + launchStage_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -163,7 +171,7 @@ public interface LocationInfoOrBuilder * * *
-     * The location id.
+     * The location id, currently must be one of [us, eu].
      * 
* * string location_id = 1; @@ -175,7 +183,7 @@ public interface LocationInfoOrBuilder * * *
-     * The location id.
+     * The location id, currently must be one of [us, eu].
      * 
* * string location_id = 1; @@ -285,7 +293,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-     * The location id.
+     * The location id, currently must be one of [us, eu].
      * 
* * string location_id = 1; @@ -308,7 +316,7 @@ public java.lang.String getLocationId() { * * *
-     * The location id.
+     * The location id, currently must be one of [us, eu].
      * 
* * string location_id = 1; @@ -660,7 +668,7 @@ public Builder mergeFrom( * * *
-       * The location id.
+       * The location id, currently must be one of [us, eu].
        * 
* * string location_id = 1; @@ -682,7 +690,7 @@ public java.lang.String getLocationId() { * * *
-       * The location id.
+       * The location id, currently must be one of [us, eu].
        * 
* * string location_id = 1; @@ -704,7 +712,7 @@ public com.google.protobuf.ByteString getLocationIdBytes() { * * *
-       * The location id.
+       * The location id, currently must be one of [us, eu].
        * 
* * string location_id = 1; @@ -725,7 +733,7 @@ public Builder setLocationId(java.lang.String value) { * * *
-       * The location id.
+       * The location id, currently must be one of [us, eu].
        * 
* * string location_id = 1; @@ -742,7 +750,7 @@ public Builder clearLocationId() { * * *
-       * The location id.
+       * The location id, currently must be one of [us, eu].
        * 
* * string location_id = 1; @@ -823,6 +831,7 @@ public com.google.protobuf.Parser getParserForType() { * *
    * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
    * 
* * string name = 1; @@ -846,6 +855,7 @@ public java.lang.String getName() { * *
    * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
    * 
* * string name = 1; @@ -871,7 +881,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * The type of the processor.
+   * The type of the processor, e.g., "invoice_parsing".
    * 
* * string type = 2; @@ -894,7 +904,7 @@ public java.lang.String getType() { * * *
-   * The type of the processor.
+   * The type of the processor, e.g., "invoice_parsing".
    * 
* * string type = 2; @@ -920,7 +930,7 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-   * The processor category.
+   * The processor category, used by UI to group processor types.
    * 
* * string category = 3; @@ -943,7 +953,7 @@ public java.lang.String getCategory() { * * *
-   * The processor category.
+   * The processor category, used by UI to group processor types.
    * 
* * string category = 3; @@ -1053,9 +1063,8 @@ public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo getAvailab * * *
-   * Whether the processor type allows creation. If yes, user can create a
-   * processor of this processor type. Otherwise, user needs to require for
-   * whitelisting.
+   * Whether the processor type allows creation. If true, users can create a
+   * processor of this processor type. Otherwise, users need to request access.
    * 
* * bool allow_creation = 6; @@ -1067,6 +1076,41 @@ public boolean getAllowCreation() { return allowCreation_; } + public static final int LAUNCH_STAGE_FIELD_NUMBER = 8; + private int launchStage_; + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + @java.lang.Override + public int getLaunchStageValue() { + return launchStage_; + } + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + @java.lang.Override + public com.google.api.LaunchStage getLaunchStage() { + @SuppressWarnings("deprecation") + com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1096,6 +1140,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (allowCreation_ != false) { output.writeBool(6, allowCreation_); } + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, launchStage_); + } unknownFields.writeTo(output); } @@ -1121,6 +1168,9 @@ public int getSerializedSize() { if (allowCreation_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowCreation_); } + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, launchStage_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1142,6 +1192,7 @@ public boolean equals(final java.lang.Object obj) { if (!getCategory().equals(other.getCategory())) return false; if (!getAvailableLocationsList().equals(other.getAvailableLocationsList())) return false; if (getAllowCreation() != other.getAllowCreation()) return false; + if (launchStage_ != other.launchStage_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1165,6 +1216,8 @@ public int hashCode() { } hash = (37 * hash) + ALLOW_CREATION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCreation()); + hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER; + hash = (53 * hash) + launchStage_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1327,6 +1380,8 @@ public Builder clear() { } allowCreation_ = false; + launchStage_ = 0; + return this; } @@ -1368,6 +1423,7 @@ public com.google.cloud.documentai.v1beta3.ProcessorType buildPartial() { result.availableLocations_ = availableLocationsBuilder_.build(); } result.allowCreation_ = allowCreation_; + result.launchStage_ = launchStage_; onBuilt(); return result; } @@ -1460,6 +1516,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ProcessorType other if (other.getAllowCreation() != false) { setAllowCreation(other.getAllowCreation()); } + if (other.launchStage_ != 0) { + setLaunchStageValue(other.getLaunchStageValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1498,6 +1557,7 @@ public Builder mergeFrom( * *
      * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
      * 
* * string name = 1; @@ -1520,6 +1580,7 @@ public java.lang.String getName() { * *
      * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
      * 
* * string name = 1; @@ -1542,6 +1603,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
      * 
* * string name = 1; @@ -1563,6 +1625,7 @@ public Builder setName(java.lang.String value) { * *
      * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
      * 
* * string name = 1; @@ -1580,6 +1643,7 @@ public Builder clearName() { * *
      * The resource name of the processor type.
+     * Format: projects/{project}/processorTypes/{processor_type}
      * 
* * string name = 1; @@ -1603,7 +1667,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * The type of the processor.
+     * The type of the processor, e.g., "invoice_parsing".
      * 
* * string type = 2; @@ -1625,7 +1689,7 @@ public java.lang.String getType() { * * *
-     * The type of the processor.
+     * The type of the processor, e.g., "invoice_parsing".
      * 
* * string type = 2; @@ -1647,7 +1711,7 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * The type of the processor.
+     * The type of the processor, e.g., "invoice_parsing".
      * 
* * string type = 2; @@ -1668,7 +1732,7 @@ public Builder setType(java.lang.String value) { * * *
-     * The type of the processor.
+     * The type of the processor, e.g., "invoice_parsing".
      * 
* * string type = 2; @@ -1685,7 +1749,7 @@ public Builder clearType() { * * *
-     * The type of the processor.
+     * The type of the processor, e.g., "invoice_parsing".
      * 
* * string type = 2; @@ -1709,7 +1773,7 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { * * *
-     * The processor category.
+     * The processor category, used by UI to group processor types.
      * 
* * string category = 3; @@ -1731,7 +1795,7 @@ public java.lang.String getCategory() { * * *
-     * The processor category.
+     * The processor category, used by UI to group processor types.
      * 
* * string category = 3; @@ -1753,7 +1817,7 @@ public com.google.protobuf.ByteString getCategoryBytes() { * * *
-     * The processor category.
+     * The processor category, used by UI to group processor types.
      * 
* * string category = 3; @@ -1774,7 +1838,7 @@ public Builder setCategory(java.lang.String value) { * * *
-     * The processor category.
+     * The processor category, used by UI to group processor types.
      * 
* * string category = 3; @@ -1791,7 +1855,7 @@ public Builder clearCategory() { * * *
-     * The processor category.
+     * The processor category, used by UI to group processor types.
      * 
* * string category = 3; @@ -2222,9 +2286,8 @@ public Builder removeAvailableLocations(int index) { * * *
-     * Whether the processor type allows creation. If yes, user can create a
-     * processor of this processor type. Otherwise, user needs to require for
-     * whitelisting.
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
      * 
* * bool allow_creation = 6; @@ -2239,9 +2302,8 @@ public boolean getAllowCreation() { * * *
-     * Whether the processor type allows creation. If yes, user can create a
-     * processor of this processor type. Otherwise, user needs to require for
-     * whitelisting.
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
      * 
* * bool allow_creation = 6; @@ -2259,9 +2321,8 @@ public Builder setAllowCreation(boolean value) { * * *
-     * Whether the processor type allows creation. If yes, user can create a
-     * processor of this processor type. Otherwise, user needs to require for
-     * whitelisting.
+     * Whether the processor type allows creation. If true, users can create a
+     * processor of this processor type. Otherwise, users need to request access.
      * 
* * bool allow_creation = 6; @@ -2275,6 +2336,96 @@ public Builder clearAllowCreation() { return this; } + private int launchStage_ = 0; + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + @java.lang.Override + public int getLaunchStageValue() { + return launchStage_; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @param value The enum numeric value on the wire for launchStage to set. + * @return This builder for chaining. + */ + public Builder setLaunchStageValue(int value) { + + launchStage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + @java.lang.Override + public com.google.api.LaunchStage getLaunchStage() { + @SuppressWarnings("deprecation") + com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @param value The launchStage to set. + * @return This builder for chaining. + */ + public Builder setLaunchStage(com.google.api.LaunchStage value) { + if (value == null) { + throw new NullPointerException(); + } + + launchStage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Launch stage of the processor type
+     * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return This builder for chaining. + */ + public Builder clearLaunchStage() { + + launchStage_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java index c3b297bb416..7bca8a86d55 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java @@ -28,6 +28,7 @@ public interface ProcessorTypeOrBuilder * *
    * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
    * 
* * string name = 1; @@ -40,6 +41,7 @@ public interface ProcessorTypeOrBuilder * *
    * The resource name of the processor type.
+   * Format: projects/{project}/processorTypes/{processor_type}
    * 
* * string name = 1; @@ -52,7 +54,7 @@ public interface ProcessorTypeOrBuilder * * *
-   * The type of the processor.
+   * The type of the processor, e.g., "invoice_parsing".
    * 
* * string type = 2; @@ -64,7 +66,7 @@ public interface ProcessorTypeOrBuilder * * *
-   * The type of the processor.
+   * The type of the processor, e.g., "invoice_parsing".
    * 
* * string type = 2; @@ -77,7 +79,7 @@ public interface ProcessorTypeOrBuilder * * *
-   * The processor category.
+   * The processor category, used by UI to group processor types.
    * 
* * string category = 3; @@ -89,7 +91,7 @@ public interface ProcessorTypeOrBuilder * * *
-   * The processor category.
+   * The processor category, used by UI to group processor types.
    * 
* * string category = 3; @@ -166,9 +168,8 @@ public interface ProcessorTypeOrBuilder * * *
-   * Whether the processor type allows creation. If yes, user can create a
-   * processor of this processor type. Otherwise, user needs to require for
-   * whitelisting.
+   * Whether the processor type allows creation. If true, users can create a
+   * processor of this processor type. Otherwise, users need to request access.
    * 
* * bool allow_creation = 6; @@ -176,4 +177,29 @@ public interface ProcessorTypeOrBuilder * @return The allowCreation. */ boolean getAllowCreation(); + + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The enum numeric value on the wire for launchStage. + */ + int getLaunchStageValue(); + /** + * + * + *
+   * Launch stage of the processor type
+   * 
+ * + * .google.api.LaunchStage launch_stage = 8; + * + * @return The launchStage. + */ + com.google.api.LaunchStage getLaunchStage(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersion.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersion.java new file mode 100644 index 00000000000..36868a37359 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersion.java @@ -0,0 +1,3287 @@ +/* + * 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/documentai/v1beta3/processor.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * A processor version is an implementation of a processor. Each processor
+ * can have multiple versions, pre-trained by Google internally or up-trained
+ * by the customer. At a time, a processor can only have one default version
+ * version. So the processor's behavior (when processing documents) is defined
+ * by a default version
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ProcessorVersion} + */ +public final class ProcessorVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ProcessorVersion) + ProcessorVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProcessorVersion.newBuilder() to construct. + private ProcessorVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProcessorVersion() { + name_ = ""; + displayName_ = ""; + state_ = 0; + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProcessorVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProcessorVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyVersionName_ = s; + break; + } + case 88: + { + googleManaged_ = input.readBool(); + break; + } + case 106: + { + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder + subBuilder = null; + if (deprecationInfo_ != null) { + subBuilder = deprecationInfo_.toBuilder(); + } + deprecationInfo_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deprecationInfo_); + deprecationInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorVersion.class, + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder.class); + } + + /** + * + * + *
+   * The possible states of the processor version.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1beta3.ProcessorVersion.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The processor version is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The processor version is deployed and can be used for processing.
+     * 
+ * + * DEPLOYED = 1; + */ + DEPLOYED(1), + /** + * + * + *
+     * The processor version is being deployed.
+     * 
+ * + * DEPLOYING = 2; + */ + DEPLOYING(2), + /** + * + * + *
+     * The processor version is not deployed and cannot be used for processing.
+     * 
+ * + * UNDEPLOYED = 3; + */ + UNDEPLOYED(3), + /** + * + * + *
+     * The processor version is being undeployed.
+     * 
+ * + * UNDEPLOYING = 4; + */ + UNDEPLOYING(4), + /** + * + * + *
+     * The processor version is being created.
+     * 
+ * + * CREATING = 5; + */ + CREATING(5), + /** + * + * + *
+     * The processor version is being deleted.
+     * 
+ * + * DELETING = 6; + */ + DELETING(6), + /** + * + * + *
+     * The processor version failed and is in an indeterminate state.
+     * 
+ * + * FAILED = 7; + */ + FAILED(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The processor version is in an unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The processor version is deployed and can be used for processing.
+     * 
+ * + * DEPLOYED = 1; + */ + public static final int DEPLOYED_VALUE = 1; + /** + * + * + *
+     * The processor version is being deployed.
+     * 
+ * + * DEPLOYING = 2; + */ + public static final int DEPLOYING_VALUE = 2; + /** + * + * + *
+     * The processor version is not deployed and cannot be used for processing.
+     * 
+ * + * UNDEPLOYED = 3; + */ + public static final int UNDEPLOYED_VALUE = 3; + /** + * + * + *
+     * The processor version is being undeployed.
+     * 
+ * + * UNDEPLOYING = 4; + */ + public static final int UNDEPLOYING_VALUE = 4; + /** + * + * + *
+     * The processor version is being created.
+     * 
+ * + * CREATING = 5; + */ + public static final int CREATING_VALUE = 5; + /** + * + * + *
+     * The processor version is being deleted.
+     * 
+ * + * DELETING = 6; + */ + public static final int DELETING_VALUE = 6; + /** + * + * + *
+     * The processor version failed and is in an indeterminate state.
+     * 
+ * + * FAILED = 7; + */ + public static final int FAILED_VALUE = 7; + + 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 DEPLOYED; + case 2: + return DEPLOYING; + case 3: + return UNDEPLOYED; + case 4: + return UNDEPLOYING; + case 5: + return CREATING; + case 6: + return DELETING; + case 7: + return FAILED; + 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.documentai.v1beta3.ProcessorVersion.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.documentai.v1beta3.ProcessorVersion.State) + } + + public interface DeprecationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + boolean hasDeprecationTime(); + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + com.google.protobuf.Timestamp getDeprecationTime(); + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder(); + + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + java.lang.String getReplacementProcessorVersion(); + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + com.google.protobuf.ByteString getReplacementProcessorVersionBytes(); + } + /** + * + * + *
+   * Information about the upcoming deprecation of this processor version.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} + */ + public static final class DeprecationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + DeprecationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeprecationInfo.newBuilder() to construct. + private DeprecationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeprecationInfo() { + replacementProcessorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeprecationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeprecationInfo( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (deprecationTime_ != null) { + subBuilder = deprecationTime_.toBuilder(); + } + deprecationTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deprecationTime_); + deprecationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + replacementProcessorVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.class, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder.class); + } + + public static final int DEPRECATION_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp deprecationTime_; + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + @java.lang.Override + public boolean hasDeprecationTime() { + return deprecationTime_ != null; + } + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeprecationTime() { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } + /** + * + * + *
+     * The time at which this processor version will be deprecated.
+     * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder() { + return getDeprecationTime(); + } + + public static final int REPLACEMENT_PROCESSOR_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object replacementProcessorVersion_; + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + @java.lang.Override + public java.lang.String getReplacementProcessorVersion() { + java.lang.Object ref = replacementProcessorVersion_; + 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(); + replacementProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+     * If set, the processor version that will be used as a replacement.
+     * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplacementProcessorVersionBytes() { + java.lang.Object ref = replacementProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementProcessorVersion_ = 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 (deprecationTime_ != null) { + output.writeMessage(1, getDeprecationTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replacementProcessorVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deprecationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeprecationTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementProcessorVersion_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, replacementProcessorVersion_); + } + 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo other = + (com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) obj; + + if (hasDeprecationTime() != other.hasDeprecationTime()) return false; + if (hasDeprecationTime()) { + if (!getDeprecationTime().equals(other.getDeprecationTime())) return false; + } + if (!getReplacementProcessorVersion().equals(other.getReplacementProcessorVersion())) + 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 (hasDeprecationTime()) { + hash = (37 * hash) + DEPRECATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationTime().hashCode(); + } + hash = (37 * hash) + REPLACEMENT_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getReplacementProcessorVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo 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; + } + /** + * + * + *
+     * Information about the upcoming deprecation of this processor version.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.class, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.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 (deprecationTimeBuilder_ == null) { + deprecationTime_ = null; + } else { + deprecationTime_ = null; + deprecationTimeBuilder_ = null; + } + replacementProcessorVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_DeprecationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo build() { + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo buildPartial() { + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo result = + new com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo(this); + if (deprecationTimeBuilder_ == null) { + result.deprecationTime_ = deprecationTime_; + } else { + result.deprecationTime_ = deprecationTimeBuilder_.build(); + } + result.replacementProcessorVersion_ = replacementProcessorVersion_; + 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo other) { + if (other + == com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + .getDefaultInstance()) return this; + if (other.hasDeprecationTime()) { + mergeDeprecationTime(other.getDeprecationTime()); + } + if (!other.getReplacementProcessorVersion().isEmpty()) { + replacementProcessorVersion_ = other.replacementProcessorVersion_; + 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp deprecationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deprecationTimeBuilder_; + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return Whether the deprecationTime field is set. + */ + public boolean hasDeprecationTime() { + return deprecationTimeBuilder_ != null || deprecationTime_ != null; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + * + * @return The deprecationTime. + */ + public com.google.protobuf.Timestamp getDeprecationTime() { + if (deprecationTimeBuilder_ == null) { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } else { + return deprecationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder setDeprecationTime(com.google.protobuf.Timestamp value) { + if (deprecationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deprecationTime_ = value; + onChanged(); + } else { + deprecationTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder setDeprecationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deprecationTimeBuilder_ == null) { + deprecationTime_ = builderForValue.build(); + onChanged(); + } else { + deprecationTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder mergeDeprecationTime(com.google.protobuf.Timestamp value) { + if (deprecationTimeBuilder_ == null) { + if (deprecationTime_ != null) { + deprecationTime_ = + com.google.protobuf.Timestamp.newBuilder(deprecationTime_) + .mergeFrom(value) + .buildPartial(); + } else { + deprecationTime_ = value; + } + onChanged(); + } else { + deprecationTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public Builder clearDeprecationTime() { + if (deprecationTimeBuilder_ == null) { + deprecationTime_ = null; + onChanged(); + } else { + deprecationTime_ = null; + deprecationTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getDeprecationTimeBuilder() { + + onChanged(); + return getDeprecationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getDeprecationTimeOrBuilder() { + if (deprecationTimeBuilder_ != null) { + return deprecationTimeBuilder_.getMessageOrBuilder(); + } else { + return deprecationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deprecationTime_; + } + } + /** + * + * + *
+       * The time at which this processor version will be deprecated.
+       * 
+ * + * .google.protobuf.Timestamp deprecation_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeprecationTimeFieldBuilder() { + if (deprecationTimeBuilder_ == null) { + deprecationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeprecationTime(), getParentForChildren(), isClean()); + deprecationTime_ = null; + } + return deprecationTimeBuilder_; + } + + private java.lang.Object replacementProcessorVersion_ = ""; + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The replacementProcessorVersion. + */ + public java.lang.String getReplacementProcessorVersion() { + java.lang.Object ref = replacementProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replacementProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for replacementProcessorVersion. + */ + public com.google.protobuf.ByteString getReplacementProcessorVersionBytes() { + java.lang.Object ref = replacementProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @param value The replacementProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setReplacementProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replacementProcessorVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearReplacementProcessorVersion() { + + replacementProcessorVersion_ = getDefaultInstance().getReplacementProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, the processor version that will be used as a replacement.
+       * 
+ * + * string replacement_processor_version = 2 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for replacementProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setReplacementProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replacementProcessorVersion_ = 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.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + private static final com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo(); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeprecationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeprecationInfo(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.documentai.v1beta3.ProcessorVersion.DeprecationInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ProcessorVersion.State result = + com.google.cloud.documentai.v1beta3.ProcessorVersion.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.ProcessorVersion.State.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 9; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 10; + private volatile java.lang.Object kmsKeyVersionName_; + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + 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(); + kmsKeyVersionName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GOOGLE_MANAGED_FIELD_NUMBER = 11; + private boolean googleManaged_; + /** + * + * + *
+   * Denotes that this ProcessorVersion is managed by google.
+   * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + @java.lang.Override + public boolean getGoogleManaged() { + return googleManaged_; + } + + public static final int DEPRECATION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecationInfo_; + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + @java.lang.Override + public boolean hasDeprecationInfo() { + return deprecationInfo_ != null; + } + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo getDeprecationInfo() { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.getDefaultInstance() + : deprecationInfo_; + } + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder() { + return getDeprecationInfo(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1beta3.ProcessorVersion.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, state_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, kmsKeyVersionName_); + } + if (googleManaged_ != false) { + output.writeBool(11, googleManaged_); + } + if (deprecationInfo_ != null) { + output.writeMessage(13, getDeprecationInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1beta3.ProcessorVersion.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, kmsKeyVersionName_); + } + if (googleManaged_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, googleManaged_); + } + if (deprecationInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getDeprecationInfo()); + } + 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.documentai.v1beta3.ProcessorVersion)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ProcessorVersion other = + (com.google.cloud.documentai.v1beta3.ProcessorVersion) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (getGoogleManaged() != other.getGoogleManaged()) return false; + if (hasDeprecationInfo() != other.hasDeprecationInfo()) return false; + if (hasDeprecationInfo()) { + if (!getDeprecationInfo().equals(other.getDeprecationInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (37 * hash) + GOOGLE_MANAGED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGoogleManaged()); + if (hasDeprecationInfo()) { + hash = (37 * hash) + DEPRECATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion 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.documentai.v1beta3.ProcessorVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion 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.documentai.v1beta3.ProcessorVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion 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.documentai.v1beta3.ProcessorVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion 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.documentai.v1beta3.ProcessorVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion 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.documentai.v1beta3.ProcessorVersion 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 processor version is an implementation of a processor. Each processor
+   * can have multiple versions, pre-trained by Google internally or up-trained
+   * by the customer. At a time, a processor can only have one default version
+   * version. So the processor's behavior (when processing documents) is defined
+   * by a default version
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ProcessorVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ProcessorVersion) + com.google.cloud.documentai.v1beta3.ProcessorVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorVersion.class, + com.google.cloud.documentai.v1beta3.ProcessorVersion.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.ProcessorVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + kmsKeyName_ = ""; + + kmsKeyVersionName_ = ""; + + googleManaged_ = false; + + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = null; + } else { + deprecationInfo_ = null; + deprecationInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_ProcessorVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ProcessorVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion build() { + com.google.cloud.documentai.v1beta3.ProcessorVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion buildPartial() { + com.google.cloud.documentai.v1beta3.ProcessorVersion result = + new com.google.cloud.documentai.v1beta3.ProcessorVersion(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.kmsKeyName_ = kmsKeyName_; + result.kmsKeyVersionName_ = kmsKeyVersionName_; + result.googleManaged_ = googleManaged_; + if (deprecationInfoBuilder_ == null) { + result.deprecationInfo_ = deprecationInfo_; + } else { + result.deprecationInfo_ = deprecationInfoBuilder_.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.documentai.v1beta3.ProcessorVersion) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ProcessorVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ProcessorVersion other) { + if (other == com.google.cloud.documentai.v1beta3.ProcessorVersion.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + onChanged(); + } + if (other.getGoogleManaged() != false) { + setGoogleManaged(other.getGoogleManaged()); + } + if (other.hasDeprecationInfo()) { + mergeDeprecationInfo(other.getDeprecationInfo()); + } + 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.documentai.v1beta3.ProcessorVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ProcessorVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the processor version.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @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 processor version.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorVersion.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ProcessorVersion.State result = + com.google.cloud.documentai.v1beta3.ProcessorVersion.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.ProcessorVersion.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1beta3.ProcessorVersion.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the processor version.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the processor version was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 9; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersionName_ = ""; + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 10; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + + private boolean googleManaged_; + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + @java.lang.Override + public boolean getGoogleManaged() { + return googleManaged_; + } + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @param value The googleManaged to set. + * @return This builder for chaining. + */ + public Builder setGoogleManaged(boolean value) { + + googleManaged_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Denotes that this ProcessorVersion is managed by google.
+     * 
+ * + * bool google_managed = 11; + * + * @return This builder for chaining. + */ + public Builder clearGoogleManaged() { + + googleManaged_ = false; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder> + deprecationInfoBuilder_; + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + public boolean hasDeprecationInfo() { + return deprecationInfoBuilder_ != null || deprecationInfo_ != null; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + getDeprecationInfo() { + if (deprecationInfoBuilder_ == null) { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + .getDefaultInstance() + : deprecationInfo_; + } else { + return deprecationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder setDeprecationInfo( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo value) { + if (deprecationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deprecationInfo_ = value; + onChanged(); + } else { + deprecationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder setDeprecationInfo( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder + builderForValue) { + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = builderForValue.build(); + onChanged(); + } else { + deprecationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder mergeDeprecationInfo( + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo value) { + if (deprecationInfoBuilder_ == null) { + if (deprecationInfo_ != null) { + deprecationInfo_ = + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.newBuilder( + deprecationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + deprecationInfo_ = value; + } + onChanged(); + } else { + deprecationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public Builder clearDeprecationInfo() { + if (deprecationInfoBuilder_ == null) { + deprecationInfo_ = null; + onChanged(); + } else { + deprecationInfo_ = null; + deprecationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder + getDeprecationInfoBuilder() { + + onChanged(); + return getDeprecationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder() { + if (deprecationInfoBuilder_ != null) { + return deprecationInfoBuilder_.getMessageOrBuilder(); + } else { + return deprecationInfo_ == null + ? com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + .getDefaultInstance() + : deprecationInfo_; + } + } + /** + * + * + *
+     * If set, information about the eventual deprecation of this version.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder> + getDeprecationInfoFieldBuilder() { + if (deprecationInfoBuilder_ == null) { + deprecationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder>( + getDeprecationInfo(), getParentForChildren(), isClean()); + deprecationInfo_ = null; + } + return deprecationInfoBuilder_; + } + + @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.documentai.v1beta3.ProcessorVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessorVersion) + private static final com.google.cloud.documentai.v1beta3.ProcessorVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ProcessorVersion(); + } + + public static com.google.cloud.documentai.v1beta3.ProcessorVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProcessorVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProcessorVersion(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.documentai.v1beta3.ProcessorVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionName.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionName.java new file mode 100644 index 00000000000..7217eab4480 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProcessorVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String processor; + private final String processorVersion; + + @Deprecated + protected ProcessorVersionName() { + project = null; + location = null; + processor = null; + processorVersion = null; + } + + private ProcessorVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + processor = Preconditions.checkNotNull(builder.getProcessor()); + processorVersion = Preconditions.checkNotNull(builder.getProcessorVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProcessorVersionName of( + String project, String location, String processor, String processorVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .build(); + } + + public static String format( + String project, String location, String processor, String processorVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .build() + .toString(); + } + + public static ProcessorVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.validatedMatch( + formattedString, "ProcessorVersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("processor"), + matchMap.get("processor_version")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProcessorVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (processor != null) { + fieldMapBuilder.put("processor", processor); + } + if (processorVersion != null) { + fieldMapBuilder.put("processor_version", processorVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION.instantiate( + "project", + project, + "location", + location, + "processor", + processor, + "processor_version", + processorVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProcessorVersionName that = ((ProcessorVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.processor, that.processor) + && Objects.equals(this.processorVersion, that.processorVersion); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(processor); + h *= 1000003; + h ^= Objects.hashCode(processorVersion); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}. + */ + public static class Builder { + private String project; + private String location; + private String processor; + private String processorVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProcessor(String processor) { + this.processor = processor; + return this; + } + + public Builder setProcessorVersion(String processorVersion) { + this.processorVersion = processorVersion; + return this; + } + + private Builder(ProcessorVersionName processorVersionName) { + this.project = processorVersionName.project; + this.location = processorVersionName.location; + this.processor = processorVersionName.processor; + this.processorVersion = processorVersionName.processorVersion; + } + + public ProcessorVersionName build() { + return new ProcessorVersionName(this); + } + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionOrBuilder.java new file mode 100644 index 00000000000..ffdc82a3669 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorVersionOrBuilder.java @@ -0,0 +1,241 @@ +/* + * 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/documentai/v1beta3/processor.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ProcessorVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ProcessorVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the processor version.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the processor version.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the processor version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.State state = 6; + * + * @return The state. + */ + com.google.cloud.documentai.v1beta3.ProcessorVersion.State getState(); + + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the processor version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 9; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 10; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); + + /** + * + * + *
+   * Denotes that this ProcessorVersion is managed by google.
+   * 
+ * + * bool google_managed = 11; + * + * @return The googleManaged. + */ + boolean getGoogleManaged(); + + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return Whether the deprecationInfo field is set. + */ + boolean hasDeprecationInfo(); + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + * + * @return The deprecationInfo. + */ + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo getDeprecationInfo(); + /** + * + * + *
+   * If set, information about the eventual deprecation of this version.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * + */ + com.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfoOrBuilder + getDeprecationInfoOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadata.java index 82abf7cca20..87516aac768 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadata.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadata.java @@ -638,7 +638,7 @@ public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMeta * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -661,7 +661,7 @@ public java.lang.String getQuestionId() { * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -1901,7 +1901,7 @@ public Builder clearCommonMetadata() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -1923,7 +1923,7 @@ public java.lang.String getQuestionId() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -1945,7 +1945,7 @@ public com.google.protobuf.ByteString getQuestionIdBytes() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -1966,7 +1966,7 @@ public Builder setQuestionId(java.lang.String value) { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; @@ -1983,7 +1983,7 @@ public Builder clearQuestionId() { * * *
-     * The question ID.
+     * The Crowd Compute question ID.
      * 
* * string question_id = 6; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadataOrBuilder.java index 4e1a24781f8..e19fd508c9f 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadataOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentOperationMetadataOrBuilder.java @@ -184,7 +184,7 @@ public interface ReviewDocumentOperationMetadataOrBuilder * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; @@ -196,7 +196,7 @@ public interface ReviewDocumentOperationMetadataOrBuilder * * *
-   * The question ID.
+   * The Crowd Compute question ID.
    * 
* * string question_id = 6; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java index 9b84741b757..2a3f82f6f69 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java @@ -23,7 +23,6 @@ * *
  * Request message for review document method.
- * Next Id: 6.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.ReviewDocumentRequest} @@ -121,6 +120,23 @@ private ReviewDocumentRequest( int rawValue = input.readEnum(); priority_ = rawValue; + break; + } + case 50: + { + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder subBuilder = null; + if (documentSchema_ != null) { + subBuilder = documentSchema_.toBuilder(); + } + documentSchema_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.DocumentSchema.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentSchema_); + documentSchema_ = subBuilder.buildPartial(); + } + break; } default: @@ -460,7 +476,7 @@ public com.google.protobuf.ByteString getHumanReviewConfigBytes() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return Whether the document field is set. */ @java.lang.Override @@ -478,7 +494,7 @@ public boolean hasDocument() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return The document. */ @java.lang.Override @@ -559,6 +575,54 @@ public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority getPri : result; } + public static final int DOCUMENT_SCHEMA_FIELD_NUMBER = 6; + private com.google.cloud.documentai.v1beta3.DocumentSchema documentSchema_; + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + @java.lang.Override + public boolean hasDocumentSchema() { + return documentSchema_ != null; + } + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchema getDocumentSchema() { + return documentSchema_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + return getDocumentSchema(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -589,6 +653,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { output.writeEnum(5, priority_); } + if (documentSchema_ != null) { + output.writeMessage(6, getDocumentSchema()); + } unknownFields.writeTo(output); } @@ -616,6 +683,9 @@ public int getSerializedSize() { != com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, priority_); } + if (documentSchema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDocumentSchema()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -639,6 +709,10 @@ public boolean equals(final java.lang.Object obj) { } if (getEnableSchemaValidation() != other.getEnableSchemaValidation()) return false; if (priority_ != other.priority_) return false; + if (hasDocumentSchema() != other.hasDocumentSchema()) return false; + if (hasDocumentSchema()) { + if (!getDocumentSchema().equals(other.getDocumentSchema())) return false; + } if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 4: @@ -668,6 +742,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSchemaValidation()); hash = (37 * hash) + PRIORITY_FIELD_NUMBER; hash = (53 * hash) + priority_; + if (hasDocumentSchema()) { + hash = (37 * hash) + DOCUMENT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchema().hashCode(); + } switch (sourceCase_) { case 4: hash = (37 * hash) + INLINE_DOCUMENT_FIELD_NUMBER; @@ -782,7 +860,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Request message for review document method.
-   * Next Id: 6.
    * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.ReviewDocumentRequest} @@ -835,6 +912,12 @@ public Builder clear() { priority_ = 0; + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } sourceCase_ = 0; source_ = null; return this; @@ -879,6 +962,11 @@ public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest buildPartial() } result.enableSchemaValidation_ = enableSchemaValidation_; result.priority_ = priority_; + if (documentSchemaBuilder_ == null) { + result.documentSchema_ = documentSchema_; + } else { + result.documentSchema_ = documentSchemaBuilder_.build(); + } result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -943,6 +1031,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ReviewDocumentReque if (other.priority_ != 0) { setPriorityValue(other.getPriorityValue()); } + if (other.hasDocumentSchema()) { + mergeDocumentSchema(other.getDocumentSchema()); + } switch (other.getSourceCase()) { case INLINE_DOCUMENT: { @@ -1345,7 +1436,7 @@ public Builder setHumanReviewConfigBytes(com.google.protobuf.ByteString value) { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return Whether the document field is set. */ @java.lang.Deprecated @@ -1362,7 +1453,7 @@ public boolean hasDocument() { * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return The document. */ @java.lang.Deprecated @@ -1673,6 +1764,193 @@ public Builder clearPriority() { return this; } + private com.google.cloud.documentai.v1beta3.DocumentSchema documentSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema, + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder> + documentSchemaBuilder_; + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + public boolean hasDocumentSchema() { + return documentSchemaBuilder_ != null || documentSchema_ != null; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema getDocumentSchema() { + if (documentSchemaBuilder_ == null) { + return documentSchema_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.getDefaultInstance() + : documentSchema_; + } else { + return documentSchemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public Builder setDocumentSchema(com.google.cloud.documentai.v1beta3.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentSchema_ = value; + onChanged(); + } else { + documentSchemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public Builder setDocumentSchema( + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder builderForValue) { + if (documentSchemaBuilder_ == null) { + documentSchema_ = builderForValue.build(); + onChanged(); + } else { + documentSchemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public Builder mergeDocumentSchema(com.google.cloud.documentai.v1beta3.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (documentSchema_ != null) { + documentSchema_ = + com.google.cloud.documentai.v1beta3.DocumentSchema.newBuilder(documentSchema_) + .mergeFrom(value) + .buildPartial(); + } else { + documentSchema_ = value; + } + onChanged(); + } else { + documentSchemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public Builder clearDocumentSchema() { + if (documentSchemaBuilder_ == null) { + documentSchema_ = null; + onChanged(); + } else { + documentSchema_ = null; + documentSchemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public com.google.cloud.documentai.v1beta3.DocumentSchema.Builder getDocumentSchemaBuilder() { + + onChanged(); + return getDocumentSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + public com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder + getDocumentSchemaOrBuilder() { + if (documentSchemaBuilder_ != null) { + return documentSchemaBuilder_.getMessageOrBuilder(); + } else { + return documentSchema_ == null + ? com.google.cloud.documentai.v1beta3.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + } + /** + * + * + *
+     * The document schema of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema, + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder> + getDocumentSchemaFieldBuilder() { + if (documentSchemaBuilder_ == null) { + documentSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.DocumentSchema, + com.google.cloud.documentai.v1beta3.DocumentSchema.Builder, + com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder>( + getDocumentSchema(), getParentForChildren(), isClean()); + documentSchema_ = null; + } + return documentSchemaBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java index 47a291c853d..07a27ea0c27 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java @@ -99,7 +99,7 @@ public interface ReviewDocumentRequestOrBuilder * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return Whether the document field is set. */ @java.lang.Deprecated @@ -114,7 +114,7 @@ public interface ReviewDocumentRequestOrBuilder * .google.cloud.documentai.v1beta3.Document document = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1beta3.ReviewDocumentRequest.document is deprecated. See - * google/cloud/documentai/v1beta3/document_processor_service.proto;l=518 + * google/cloud/documentai/v1beta3/document_processor_service.proto;l=799 * @return The document. */ @java.lang.Deprecated @@ -169,5 +169,40 @@ public interface ReviewDocumentRequestOrBuilder */ com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority getPriority(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return Whether the documentSchema field is set. + */ + boolean hasDocumentSchema(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + * + * @return The documentSchema. + */ + com.google.cloud.documentai.v1beta3.DocumentSchema getDocumentSchema(); + /** + * + * + *
+   * The document schema of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.DocumentSchema document_schema = 6; + */ + com.google.cloud.documentai.v1beta3.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder(); + public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.SourceCase getSourceCase(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponse.java index ee8c2f75282..6df4a9a76a5 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponse.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponse.java @@ -39,6 +39,8 @@ private ReviewDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder private ReviewDocumentResponse() { gcsDestination_ = ""; + state_ = 0; + rejectionReason_ = ""; } @java.lang.Override @@ -77,6 +79,20 @@ private ReviewDocumentResponse( gcsDestination_ = s; break; } + case 16: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + rejectionReason_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -113,13 +129,173 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.Builder.class); } + /** + * + * + *
+   * Possible states of the review operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1beta3.ReviewDocumentResponse.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The review operation is rejected by the reviewer.
+     * 
+ * + * REJECTED = 1; + */ + REJECTED(1), + /** + * + * + *
+     * The review operation is succeeded.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The review operation is rejected by the reviewer.
+     * 
+ * + * REJECTED = 1; + */ + public static final int REJECTED_VALUE = 1; + /** + * + * + *
+     * The review operation is succeeded.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + + 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 REJECTED; + case 2: + return SUCCEEDED; + 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.documentai.v1beta3.ReviewDocumentResponse.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.documentai.v1beta3.ReviewDocumentResponse.State) + } + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; private volatile java.lang.Object gcsDestination_; /** * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -142,7 +318,8 @@ public java.lang.String getGcsDestination() { * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -162,6 +339,93 @@ public com.google.protobuf.ByteString getGcsDestinationBytes() { } } + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State result = + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.UNRECOGNIZED + : result; + } + + public static final int REJECTION_REASON_FIELD_NUMBER = 3; + private volatile java.lang.Object rejectionReason_; + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + @java.lang.Override + public java.lang.String getRejectionReason() { + java.lang.Object ref = rejectionReason_; + 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(); + rejectionReason_ = s; + return s; + } + } + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRejectionReasonBytes() { + java.lang.Object ref = rejectionReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rejectionReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -179,6 +443,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsDestination_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsDestination_); } + if (state_ + != com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rejectionReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rejectionReason_); + } unknownFields.writeTo(output); } @@ -191,6 +463,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsDestination_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsDestination_); } + if (state_ + != com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rejectionReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rejectionReason_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -208,6 +488,8 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.documentai.v1beta3.ReviewDocumentResponse) obj; if (!getGcsDestination().equals(other.getGcsDestination())) return false; + if (state_ != other.state_) return false; + if (!getRejectionReason().equals(other.getRejectionReason())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -221,6 +503,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; hash = (53 * hash) + getGcsDestination().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + REJECTION_REASON_FIELD_NUMBER; + hash = (53 * hash) + getRejectionReason().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -369,6 +655,10 @@ public Builder clear() { super.clear(); gcsDestination_ = ""; + state_ = 0; + + rejectionReason_ = ""; + return this; } @@ -397,6 +687,8 @@ public com.google.cloud.documentai.v1beta3.ReviewDocumentResponse buildPartial() com.google.cloud.documentai.v1beta3.ReviewDocumentResponse result = new com.google.cloud.documentai.v1beta3.ReviewDocumentResponse(this); result.gcsDestination_ = gcsDestination_; + result.state_ = state_; + result.rejectionReason_ = rejectionReason_; onBuilt(); return result; } @@ -451,6 +743,13 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ReviewDocumentRespo gcsDestination_ = other.gcsDestination_; onChanged(); } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getRejectionReason().isEmpty()) { + rejectionReason_ = other.rejectionReason_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -486,7 +785,8 @@ public Builder mergeFrom( * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -508,7 +808,8 @@ public java.lang.String getGcsDestination() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -530,7 +831,8 @@ public com.google.protobuf.ByteString getGcsDestinationBytes() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -551,7 +853,8 @@ public Builder setGcsDestination(java.lang.String value) { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -568,7 +871,8 @@ public Builder clearGcsDestination() { * * *
-     * The Cloud Storage uri for the human reviewed document.
+     * The Cloud Storage uri for the human reviewed document if the review is
+     * succeeded.
      * 
* * string gcs_destination = 1; @@ -587,6 +891,206 @@ public Builder setGcsDestinationBytes(com.google.protobuf.ByteString value) { return this; } + private int state_ = 0; + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @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 review operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State result = + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the review operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object rejectionReason_ = ""; + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + public java.lang.String getRejectionReason() { + java.lang.Object ref = rejectionReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rejectionReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + public com.google.protobuf.ByteString getRejectionReasonBytes() { + java.lang.Object ref = rejectionReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rejectionReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @param value The rejectionReason to set. + * @return This builder for chaining. + */ + public Builder setRejectionReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rejectionReason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @return This builder for chaining. + */ + public Builder clearRejectionReason() { + + rejectionReason_ = getDefaultInstance().getRejectionReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why the review is rejected by reviewer.
+     * 
+ * + * string rejection_reason = 3; + * + * @param value The bytes for rejectionReason to set. + * @return This builder for chaining. + */ + public Builder setRejectionReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rejectionReason_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponseOrBuilder.java index 3d0832cde26..ae3496a25bc 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponseOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentResponseOrBuilder.java @@ -27,7 +27,8 @@ public interface ReviewDocumentResponseOrBuilder * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -39,7 +40,8 @@ public interface ReviewDocumentResponseOrBuilder * * *
-   * The Cloud Storage uri for the human reviewed document.
+   * The Cloud Storage uri for the human reviewed document if the review is
+   * succeeded.
    * 
* * string gcs_destination = 1; @@ -47,4 +49,54 @@ public interface ReviewDocumentResponseOrBuilder * @return The bytes for gcsDestination. */ com.google.protobuf.ByteString getGcsDestinationBytes(); + + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the review operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentResponse.State state = 2; + * + * @return The state. + */ + com.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State getState(); + + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The rejectionReason. + */ + java.lang.String getRejectionReason(); + /** + * + * + *
+   * The reason why the review is rejected by reviewer.
+   * 
+ * + * string rejection_reason = 3; + * + * @return The bytes for rejectionReason. + */ + com.google.protobuf.ByteString getRejectionReasonBytes(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadata.java new file mode 100644 index 00000000000..55ded780ec7 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadata.java @@ -0,0 +1,759 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for set default processor version
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} + */ +public final class SetDefaultProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + SetDefaultProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionMetadata.newBuilder() to construct. + private SetDefaultProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionMetadata( + 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.documentai.v1beta3.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata other = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata 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 long running operation metadata for set default processor version
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata build() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata result = + new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1beta3.SetDefaultProcessorVersionMetadata) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + .getDefaultInstance()) return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1beta3.SetDefaultProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.newBuilder( + commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionMetadata(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.documentai.v1beta3.SetDefaultProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..babc518eb14 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface SetDefaultProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequest.java new file mode 100644 index 00000000000..beb5f976dbc --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequest.java @@ -0,0 +1,872 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for the set default processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} + */ +public final class SetDefaultProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + SetDefaultProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionRequest.newBuilder() to construct. + private SetDefaultProcessorVersionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionRequest() { + processor_ = ""; + defaultProcessorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + processor_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + defaultProcessorVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.Builder.class); + } + + public static final int PROCESSOR_FIELD_NUMBER = 1; + private volatile java.lang.Object processor_; + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + @java.lang.Override + public java.lang.String getProcessor() { + java.lang.Object ref = processor_; + 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(); + processor_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProcessorBytes() { + java.lang.Object ref = processor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object defaultProcessorVersion_; + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + @java.lang.Override + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + 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(); + defaultProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, processor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultProcessorVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(processor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, processor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultProcessorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultProcessorVersion_); + } + 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.documentai.v1beta3.SetDefaultProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest other = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) obj; + + if (!getProcessor().equals(other.getProcessor())) return false; + if (!getDefaultProcessorVersion().equals(other.getDefaultProcessorVersion())) 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) + PROCESSOR_FIELD_NUMBER; + hash = (53 * hash) + getProcessor().hashCode(); + hash = (37 * hash) + DEFAULT_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDefaultProcessorVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest 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.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest 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.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest 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.documentai.v1beta3.SetDefaultProcessorVersionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + 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.documentai.v1beta3.SetDefaultProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest 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.documentai.v1beta3.SetDefaultProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the set default processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.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(); + processor_ = ""; + + defaultProcessorVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest build() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest result = + new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest(this); + result.processor_ = processor_; + result.defaultProcessorVersion_ = defaultProcessorVersion_; + 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.documentai.v1beta3.SetDefaultProcessorVersionRequest) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + .getDefaultInstance()) return this; + if (!other.getProcessor().isEmpty()) { + processor_ = other.processor_; + onChanged(); + } + if (!other.getDefaultProcessorVersion().isEmpty()) { + defaultProcessorVersion_ = other.defaultProcessorVersion_; + 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.documentai.v1beta3.SetDefaultProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object processor_ = ""; + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + public java.lang.String getProcessor() { + java.lang.Object ref = processor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + processor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + public com.google.protobuf.ByteString getProcessorBytes() { + java.lang.Object ref = processor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The processor to set. + * @return This builder for chaining. + */ + public Builder setProcessor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + processor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProcessor() { + + processor_ = getDefaultInstance().getProcessor(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+     * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for processor to set. + * @return This builder for chaining. + */ + public Builder setProcessorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + processor_ = value; + onChanged(); + return this; + } + + private java.lang.Object defaultProcessorVersion_ = ""; + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + public java.lang.String getDefaultProcessorVersion() { + java.lang.Object ref = defaultProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + public com.google.protobuf.ByteString getDefaultProcessorVersionBytes() { + java.lang.Object ref = defaultProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + defaultProcessorVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDefaultProcessorVersion() { + + defaultProcessorVersion_ = getDefaultInstance().getDefaultProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+     * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for defaultProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setDefaultProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + defaultProcessorVersion_ = 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.documentai.v1beta3.SetDefaultProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + private static final com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionRequest(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.documentai.v1beta3.SetDefaultProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..de3a13825f7 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface SetDefaultProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processor. + */ + java.lang.String getProcessor(); + /** + * + * + *
+   * Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
+   * 
+ * + * + * string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processor. + */ + com.google.protobuf.ByteString getProcessorBytes(); + + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The defaultProcessorVersion. + */ + java.lang.String getDefaultProcessorVersion(); + /** + * + * + *
+   * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
+   * 
+ * + * + * string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for defaultProcessorVersion. + */ + com.google.protobuf.ByteString getDefaultProcessorVersionBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponse.java new file mode 100644 index 00000000000..ee9cc730b6d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponse.java @@ -0,0 +1,472 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Response message for set default processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} + */ +public final class SetDefaultProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + SetDefaultProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultProcessorVersionResponse.newBuilder() to construct. + private SetDefaultProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1beta3.SetDefaultProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse other = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse 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.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse 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.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse 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.documentai.v1beta3.SetDefaultProcessorVersionResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + 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.documentai.v1beta3.SetDefaultProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse 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.documentai.v1beta3.SetDefaultProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for set default processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_SetDefaultProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse build() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse result = + new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse(this); + 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.documentai.v1beta3.SetDefaultProcessorVersionResponse) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + .getDefaultInstance()) return this; + 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.documentai.v1beta3.SetDefaultProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1beta3.SetDefaultProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + private static final com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultProcessorVersionResponse(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.documentai.v1beta3.SetDefaultProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..972c3db07da --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/SetDefaultProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface SetDefaultProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadata.java new file mode 100644 index 00000000000..518b8e79a3f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadata.java @@ -0,0 +1,758 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for the undeploy processor version
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} + */ +public final class UndeployProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + UndeployProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionMetadata.newBuilder() to construct. + private UndeployProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionMetadata( + 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.documentai.v1beta3.CommonOperationMetadata.Builder subBuilder = null; + if (commonMetadata_ != null) { + subBuilder = commonMetadata_.toBuilder(); + } + commonMetadata_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonMetadata_); + commonMetadata_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return getCommonMetadata(); + } + + 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + 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.documentai.v1beta3.UndeployProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata other = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) 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 (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata 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.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata 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.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata 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.documentai.v1beta3.UndeployProcessorVersionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + 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.documentai.v1beta3.UndeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata 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.documentai.v1beta3.UndeployProcessorVersionMetadata 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 long running operation metadata for the undeploy processor version
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.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 (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata build() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata result = + new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata(this); + if (commonMetadataBuilder_ == null) { + result.commonMetadata_ = commonMetadata_; + } else { + result.commonMetadata_ = commonMetadataBuilder_.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.documentai.v1beta3.UndeployProcessorVersionMetadata) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + .getDefaultInstance()) return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + 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.documentai.v1beta3.UndeployProcessorVersionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return commonMetadataBuilder_ != null || commonMetadata_ != null; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + onChanged(); + } else { + commonMetadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + onChanged(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1beta3.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (commonMetadata_ != null) { + commonMetadata_ = + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.newBuilder( + commonMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + commonMetadata_ = value; + } + onChanged(); + } else { + commonMetadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = null; + onChanged(); + } else { + commonMetadata_ = null; + commonMetadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1beta3.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long running operation.
+     * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.CommonOperationMetadata, + com.google.cloud.documentai.v1beta3.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @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.documentai.v1beta3.UndeployProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionMetadata(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.documentai.v1beta3.UndeployProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadataOrBuilder.java new file mode 100644 index 00000000000..81c3f73e989 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface UndeployProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequest.java new file mode 100644 index 00000000000..c02c127d797 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequest.java @@ -0,0 +1,665 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Request message for the undeploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} + */ +public final class UndeployProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + UndeployProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionRequest.newBuilder() to construct. + private UndeployProcessorVersionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest other = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest 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.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest 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.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest 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.documentai.v1beta3.UndeployProcessorVersionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + 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.documentai.v1beta3.UndeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest 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.documentai.v1beta3.UndeployProcessorVersionRequest 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; + } + /** + * + * + *
+   * Request message for the undeploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest build() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest result = + new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be undeployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + private static final com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionRequest(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.documentai.v1beta3.UndeployProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequestOrBuilder.java new file mode 100644 index 00000000000..b085d5f6760 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface UndeployProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be undeployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponse.java new file mode 100644 index 00000000000..3b3db960c4e --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponse.java @@ -0,0 +1,471 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * Response message for the undeploy processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} + */ +public final class UndeployProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + UndeployProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployProcessorVersionResponse.newBuilder() to construct. + private UndeployProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployProcessorVersionResponse( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.documentai.v1beta3.UndeployProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse other = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse 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.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse 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.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse 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.documentai.v1beta3.UndeployProcessorVersionResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + 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.documentai.v1beta3.UndeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse 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.documentai.v1beta3.UndeployProcessorVersionResponse 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; + } + /** + * + * + *
+   * Response message for the undeploy processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_UndeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse build() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse result = + new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse(this); + 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.documentai.v1beta3.UndeployProcessorVersionResponse) { + return mergeFrom( + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + .getDefaultInstance()) return this; + 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.documentai.v1beta3.UndeployProcessorVersionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.documentai.v1beta3.UndeployProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + private static final com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployProcessorVersionResponse(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.documentai.v1beta3.UndeployProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponseOrBuilder.java new file mode 100644 index 00000000000..2a423269cf4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/UndeployProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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/documentai/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface UndeployProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/barcode.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/barcode.proto new file mode 100644 index 00000000000..7c7050a868b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/barcode.proto @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1beta3; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; +option java_multiple_files = true; +option java_outer_classname = "BarcodeProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// Encodes the detailed information of a barcode. +message Barcode { + // Format of a barcode. + // The supported formats are: + // CODE_128: Code 128 type. + // CODE_39: Code 39 type. + // CODE_93: Code 93 type. + // CODABAR: Codabar type. + // DATA_MATRIX: 2D Data Matrix type. + // ITF: ITF type. + // EAN_13: EAN-13 type. + // EAN_8: EAN-8 type. + // QR_CODE: 2D QR code type. + // UPC_A: UPC-A type. + // UPC_E: UPC-E type. + // PDF417: PDF417 type. + // AZTEC: 2D Aztec code type. + // DATABAR: GS1 DataBar code type. + string format = 1; + + // Value format describes the format of the value that a barcode + // encodes. + // The supported formats are: + // CONTACT_INFO: Contact information. + // EMAIL: Email address. + // ISBN: ISBN identifier. + // PHONE: Phone number. + // PRODUCT: Product. + // SMS: SMS message. + // TEXT: Text string. + // URL: URL address. + // WIFI: Wifi information. + // GEO: Geo-localization. + // CALENDAR_EVENT: Calendar event. + // DRIVER_LICENSE: Driver's license. + string value_format = 2; + + // Raw value encoded in the barcode. + // For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. + string raw_value = 3; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto index f9bec08b90b..809a64ea4c7 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; +import "google/cloud/documentai/v1beta3/barcode.proto"; import "google/cloud/documentai/v1beta3/geometry.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -35,11 +35,10 @@ option java_package = "com.google.cloud.documentai.v1beta3"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; -// Document represents the canonical document resource in Document Understanding -// AI. -// It is an interchange format that provides insights into documents and allows -// for collaboration between users and Document Understanding AI to iterate and -// optimize for quality. +// Document represents the canonical document resource in Document AI. It is an +// interchange format that provides insights into documents and allows for +// collaboration between users and Document AI to iterate and optimize for +// quality. message Document { // For a large document, sharding may be performed to produce several // document shards. Each document shard contains this field to detail which @@ -51,9 +50,8 @@ message Document { // Total number of shards. int64 shard_count = 2; - // The index of the first character in - // [Document.text][google.cloud.documentai.v1beta3.Document.text] in the - // overall document global text. + // The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall + // document global text. int64 text_offset = 3; } @@ -69,8 +67,7 @@ message Document { string unit = 2; } - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1; // Text color. @@ -167,31 +164,25 @@ message Document { PAGE_LEFT = 4; } - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1; - // Confidence of the current - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within - // context of the object this layout is for. e.g. confidence can be for a - // single token, a table, a visual element, etc. depending on context. - // Range [0, 1]. + // Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this + // layout is for. e.g. confidence can be for a single token, a table, + // a visual element, etc. depending on context. Range [0, 1]. float confidence = 2; - // The bounding polygon for the - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. + // The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. BoundingPoly bounding_poly = 3; - // Detected orientation for the - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. + // Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. Orientation orientation = 4; } // A block has a set of lines (collected into paragraphs) that have a // common line-spacing and orientation. message Block { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. Layout layout = 1; // A list of detected languages together with confidence. @@ -203,8 +194,7 @@ message Document { // A collection of lines that a human would perceive as a paragraph. message Paragraph { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph]. Layout layout = 1; // A list of detected languages together with confidence. @@ -217,8 +207,7 @@ message Document { // A collection of tokens that a human would perceive as a line. // Does not cross column boundaries, can be horizontal, vertical, etc. message Line { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. Layout layout = 1; // A list of detected languages together with confidence. @@ -230,8 +219,7 @@ message Document { // A detected token. message Token { - // Detected break at the end of a - // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. message DetectedBreak { // Enum to denote the type of break found. enum Type { @@ -252,12 +240,10 @@ message Document { Type type = 1; } - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. Layout layout = 1; - // Detected break at the end of a - // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. DetectedBreak detected_break = 2; // A list of detected languages together with confidence. @@ -269,8 +255,7 @@ message Document { // A detected symbol. message Symbol { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. Layout layout = 1; // A list of detected languages together with confidence. @@ -280,12 +265,10 @@ message Document { // Detected non-text visual elements e.g. checkbox, signature etc. on the // page. message VisualElement { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. Layout layout = 1; - // Type of the - // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. + // Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. string type = 2; // A list of detected languages together with confidence. @@ -302,8 +285,7 @@ message Document { // A cell representation inside the table. message TableCell { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell]. Layout layout = 1; // How many rows this cell spans. @@ -316,8 +298,7 @@ message Document { repeated DetectedLanguage detected_languages = 4; } - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. Layout layout = 1; // Header rows of the table. @@ -332,14 +313,11 @@ message Document { // A form field detected on the page. message FormField { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] - // name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`, + // `Grand total`, `Phone number`, etc. Layout field_name = 1; - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] - // value. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value. Layout field_value = 2; // A list of detected languages for name together with confidence. @@ -355,10 +333,29 @@ message Document { // - "filled_checkbox" string value_type = 5; + // Created for Labeling UI to export key text. + // If corrections were made to the text identified by the + // `field_name.text_anchor`, this field will contain the correction. + string corrected_key_text = 6; + + // Created for Labeling UI to export value text. + // If corrections were made to the text identified by the + // `field_value.text_anchor`, this field will contain the correction. + string corrected_value_text = 7; + // The history of this annotation. Provenance provenance = 8; } + // A detected barcode. + message DetectedBarcode { + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. + Layout layout = 1; + + // Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. + Barcode barcode = 2; + } + // Detected language for a structural component. message DetectedLanguage { // The BCP-47 language code, such as "en-US" or "sr-Latn". For more @@ -370,11 +367,9 @@ message Document { float confidence = 2; } - // 1-based index for current - // [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent - // [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page - // is taken out of a [Document][google.cloud.documentai.v1beta3.Document] - // for individual processing. + // 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document]. + // Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual + // processing. int32 page_number = 1; // Rendered image for this page. This image is preprocessed to remove any @@ -383,15 +378,13 @@ message Document { Image image = 13; // Transformation matrices that were applied to the original document image - // to produce - // [Page.image][google.cloud.documentai.v1beta3.Document.Page.image]. + // to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image]. repeated Matrix transforms = 14; // Physical dimension of the page. Dimension dimension = 2; - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the - // page. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page. Layout layout = 3; // A list of detected languages together with confidence. @@ -426,6 +419,9 @@ message Document { // A list of visually detected symbols on the page. repeated Symbol symbols = 12; + // A list of detected barcodes. + repeated DetectedBarcode detected_barcodes = 15; + // The history of this page. Provenance provenance = 16; } @@ -460,6 +456,12 @@ message Document { // Boolean value. Can be used for entities with binary values, or for // checkboxes. bool boolean_value = 6; + + // Integer value. + int32 integer_value = 7; + + // Float value. + float float_value = 8; } // Optional. An optional field to store a normalized string. @@ -476,15 +478,14 @@ message Document { } // Optional. Provenance of the entity. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Entity type from a schema e.g. `Address`. string type = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If - // the entity is not present in the document, this field will be empty. + // Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity + // is not present in the document, this field will be empty. string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Deprecated. Use `id` field instead. @@ -493,35 +494,32 @@ message Document { // Optional. Confidence of detected Schema entity. Range [0, 1]. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Represents the provenance of this entity wrt. the location on - // the page where it was found. + // Optional. Represents the provenance of this entity wrt. the location on the + // page where it was found. PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Canonical id. This will be a unique value in the entity list // for this document. string id = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Normalized entity value. Absent if the extracted value could - // not be converted or the type (e.g. address) is not supported for certain + // Optional. Normalized entity value. Absent if the extracted value could not be + // converted or the type (e.g. address) is not supported for certain // parsers. This field is also only populated for certain supported document // types. - NormalizedValue normalized_value = 9 - [(google.api.field_behavior) = OPTIONAL]; + NormalizedValue normalized_value = 9 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Entities can be nested to form a hierarchical data structure - // representing the content in the document. + // Optional. Entities can be nested to form a hierarchical data structure representing + // the content in the document. repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. The history of this annotation. Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Whether the entity will be redacted for de-identification - // purposes. + // Optional. Whether the entity will be redacted for de-identification purposes. bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; } - // Relationship between - // [Entities][google.cloud.documentai.v1beta3.Document.Entity]. + // Relationship between [Entities][google.cloud.documentai.v1beta3.Document.Entity]. message EntityRelation { // Subject entity id. string subject_id = 1; @@ -533,28 +531,21 @@ message Document { string relation = 3; } - // Text reference indexing into the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text reference indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. message TextAnchor { - // A text segment in the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. The - // indices may be out of bounds which indicate that the text extends into - // another document shard for large sharded documents. See - // [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset] + // A text segment in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. The indices may be out of bounds + // which indicate that the text extends into another document shard for + // large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset] message TextSegment { - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] - // start UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. int64 start_index = 1; - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] - // half open end UTF-8 char index in the + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the // [Document.text][google.cloud.documentai.v1beta3.Document.text]. int64 end_index = 2; } - // The text segments from the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text]. repeated TextSegment text_segments = 1; // Contains the content of the text span so that users do @@ -563,9 +554,8 @@ message Document { string content = 2; } - // Referencing the visual context of the entity in the - // [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page - // anchors can be cross-page, consist of multiple bounding polygons and + // Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. + // Page anchors can be cross-page, consist of multiple bounding polygons and // optionally reference specific layout element types. message PageAnchor { // Represents a weak reference to a page element within a document. @@ -575,66 +565,47 @@ message Document { // Layout Unspecified. LAYOUT_TYPE_UNSPECIFIED = 0; - // References a - // [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] - // element. + // References a [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] element. BLOCK = 1; - // References a - // [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] - // element. + // References a [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] element. PARAGRAPH = 2; - // References a - // [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] - // element. + // References a [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] element. LINE = 3; - // References a - // [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] - // element. + // References a [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] element. TOKEN = 4; - // References a - // [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] - // element. + // References a [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] element. VISUAL_ELEMENT = 5; - // Refrrences a - // [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] - // element. + // Refrrences a [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] element. TABLE = 6; - // References a - // [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] - // element. + // References a [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] element. FORM_FIELD = 7; } - // Required. Index into the - // [Document.pages][google.cloud.documentai.v1beta3.Document.pages] - // element, for example using [Document.pages][page_refs.page] to locate - // the related page element. This field is skipped when its value is the - // default 0. See + // Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using + // [Document.pages][page_refs.page] to locate the related page element. + // This field is skipped when its value is the default 0. See // https://developers.google.com/protocol-buffers/docs/proto3#json. int64 page = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The type of the layout element that is being referenced if - // any. + // Optional. The type of the layout element that is being referenced if any. LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Deprecated. Use - // [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] - // instead. - string layout_id = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + // Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead. + string layout_id = 3 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; - // Optional. Identifies the bounding polygon of a layout element on the - // page. + // Optional. Identifies the bounding polygon of a layout element on the page. BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Confidence of detected page element, if applicable. Range [0, - // 1]. + // Optional. Confidence of detected page element, if applicable. Range [0, 1]. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -728,7 +699,12 @@ message Document { // The revisions that this revision is based on. This can include one or // more parent (when documents are merged.) This field represents the // index into the `revisions` field. - repeated int32 parent = 2; + repeated int32 parent = 2 [deprecated = true]; + + // The revisions that this revision is based on. Must include all the ids + // that have anything to do with this revision - eg. there are + // `provenance.parent.revision` fields that index into this field. + repeated string parent_ids = 7; // The time that the revision was created. google.protobuf.Timestamp create_time = 3; @@ -740,11 +716,10 @@ message Document { // This message is used for text changes aka. OCR corrections. message TextChange { // Provenance of the correction. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. There - // can only be a single `TextAnchor.text_segments` element. If the start - // and end index of the text segment are the same, the text change is - // inserted before that index. + // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. There can only be a + // single `TextAnchor.text_segments` element. If the start and + // end index of the text segment are the same, the text change is inserted + // before that index. TextAnchor text_anchor = 1; // The text that replaces the text identified in the `text_anchor`. @@ -777,21 +752,17 @@ message Document { // Optional. UTF-8 encoded text in reading order from the document. string text = 4 [(google.api.field_behavior) = OPTIONAL]; - // Placeholder. Styles for the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Placeholder. Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text]. repeated Style text_styles = 5; - // Visual page layout for the - // [Document][google.cloud.documentai.v1beta3.Document]. + // Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document]. repeated Page pages = 6; - // A list of entities detected on - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. For - // document shards, entities in this list may cross shard boundaries. + // A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards, + // entities in this list may cross shard boundaries. repeated Entity entities = 7; - // Placeholder. Relationship among - // [Document.entities][google.cloud.documentai.v1beta3.Document.entities]. + // Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities]. repeated EntityRelation entity_relations = 8; // Placeholder. A list of text corrections made to [Document.text]. This is diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto index d364d4aba76..a0d410c8cb4 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_io.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; -import "google/api/annotations.proto"; - option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; option java_multiple_files = true; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto index ae589642dc4..952db5904d5 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/documentai/v1beta3/document.proto"; import "google/cloud/documentai/v1beta3/document_io.proto"; +import "google/cloud/documentai/v1beta3/document_schema.proto"; import "google/cloud/documentai/v1beta3/operation_metadata.proto"; import "google/cloud/documentai/v1beta3/processor.proto"; import "google/cloud/documentai/v1beta3/processor_type.proto"; @@ -37,19 +38,14 @@ option java_outer_classname = "DocumentAiProcessorService"; option java_package = "com.google.cloud.documentai.v1beta3"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// (-- aip.dev/not-precedent: This is needed because we have references to -// these resources in our public API, but the resource management is not -// part of the public API (UI access only). So we have to define -// these resource here to avoid any "unable to find resources" error. --) -option (google.api.resource_definition) = { - type: "documentai.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; option (google.api.resource_definition) = { type: "documentai.googleapis.com/HumanReviewConfig" pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig" }; +option (google.api.resource_definition) = { + type: "documentai.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; // Service to call Cloud DocumentAI to process documents according to the // processor's definition. Processors are built using state-of-the-art Google @@ -64,6 +60,10 @@ service DocumentProcessorService { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*}:process" body: "*" + additional_bindings { + post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process" + body: "*" + } }; option (google.api.method_signature) = "name"; } @@ -74,6 +74,10 @@ service DocumentProcessorService { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess" body: "*" + additional_bindings { + post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess" + body: "*" + } }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { @@ -82,7 +86,8 @@ service DocumentProcessorService { }; } - // Fetches processor types. + // Fetches processor types. Note that we do not use ListProcessorTypes here + // because it is not paginated. rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) { option (google.api.http) = { get: "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes" @@ -90,6 +95,14 @@ service DocumentProcessorService { option (google.api.method_signature) = "parent"; } + // Lists the processor types that exist. + rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1beta3/{parent=projects/*/locations/*}/processorTypes" + }; + option (google.api.method_signature) = "parent"; + } + // Lists all processors which belong to this project. rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { option (google.api.http) = { @@ -98,6 +111,69 @@ service DocumentProcessorService { option (google.api.method_signature) = "parent"; } + // Gets a processor detail. + rpc GetProcessor(GetProcessorRequest) returns (Processor) { + option (google.api.http) = { + get: "/v1beta3/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a processor version detail. + rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) { + option (google.api.http) = { + get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all versions of a processor. + rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) { + option (google.api.http) = { + get: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the processor version, all artifacts under the processor version + // will be deleted. + rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteProcessorVersionMetadata" + }; + } + + // Deploys the processor version. + rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeployProcessorVersionResponse" + metadata_type: "DeployProcessorVersionMetadata" + }; + } + + // Undeploys the processor version. + rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UndeployProcessorVersionResponse" + metadata_type: "UndeployProcessorVersionMetadata" + }; + } + // Creates a processor from the type processor that the user chose. // The processor will be at "ENABLED" state by default after its creation. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { @@ -145,6 +221,20 @@ service DocumentProcessorService { }; } + // Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "SetDefaultProcessorVersionResponse" + metadata_type: "SetDefaultProcessorVersionMetadata" + }; + } + // Send a document for Human Review. The input document should be processed by // the specified processor. rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { @@ -171,11 +261,16 @@ message ProcessRequest { RawDocument raw_document = 5; } - // Required. The processor resource name. + // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] + // to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use + // its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format: + // `projects/{project}/locations/{location}/processors/{processor}`, or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" + type: "*" } ]; @@ -185,6 +280,9 @@ message ProcessRequest { // Whether Human Review feature should be skipped for this request. Default to // false. bool skip_human_review = 3; + + // Specifies which fields to include in ProcessResponse's document. + google.protobuf.FieldMask field_mask = 6; } // The status of human review on a processed document. @@ -262,11 +360,15 @@ message BatchProcessRequest { string gcs_destination = 1; } - // Required. The processor resource name. + // Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" + type: "*" } ]; @@ -302,10 +404,10 @@ message BatchProcessMetadata { // document during the process. string input_gcs_source = 1; - // The status of the processing of the document. + // The status processing the document. google.rpc.Status status = 2; - // The output_gcs_destination (in the request as 'output_gcs_destination') + // The output_gcs_destination (in the request as `output_gcs_destination`) // of the processed document if it was successful, otherwise empty. string output_gcs_destination = 3; @@ -363,7 +465,8 @@ message BatchProcessMetadata { // Request message for fetch processor types. message FetchProcessorTypesRequest { // Required. The project of processor type to list. - // Format: projects/{project}/locations/{location} + // The available processor types may depend on the allow-listing on projects. + // Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -378,10 +481,40 @@ message FetchProcessorTypesResponse { repeated ProcessorType processor_types = 1; } +// Request message for list processor types. +message ListProcessorTypesRequest { + // Required. The location of processor type to list. + // The available processor types may depend on the allow-listing on projects. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorType" + } + ]; + + // The maximum number of processor types to return. + // If unspecified, at most 100 processor types will be returned. + // The maximum value is 500; values above 500 will be coerced to 500. + int32 page_size = 2; + + // Used to retrieve the next page of results, empty if at the end of the list. + string page_token = 3; +} + +// Response message for list processor types. +message ListProcessorTypesResponse { + // The processor types. + repeated ProcessorType processor_types = 1; + + // Points to the next page, otherwise empty. + string next_page_token = 2; +} + // Request message for list all processors belongs to a project. message ListProcessorsRequest { // Required. The parent (project and location) which owns this collection of Processors. - // Format: projects/{project}/locations/{location} + // Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -408,12 +541,126 @@ message ListProcessorsResponse { string next_page_token = 2; } +// Request message for get processor. +message GetProcessorRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Request message for get processor version. +message GetProcessorVersionRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Request message for list all processor versions belongs to a processor. +message ListProcessorVersionsRequest { + // Required. The parent (project, location and processor) to list all versions. + // Format: `projects/{project}/locations/{location}/processors/{processor}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // The maximum number of processor versions to return. + // If unspecified, at most 10 processor versions will be returned. + // The maximum value is 20; values above 20 will be coerced to 20. + int32 page_size = 2; + + // We will return the processor versions sorted by creation time. The page + // token will point to the next processor version. + string page_token = 3; +} + +// Response message for list processors. +message ListProcessorVersionsResponse { + // The list of processors. + repeated ProcessorVersion processor_versions = 1; + + // Points to the next processor, otherwise empty. + string next_page_token = 2; +} + +// Request message for the delete processor version method. +message DeleteProcessorVersionRequest { + // Required. The processor version resource name to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// The long running operation metadata for delete processor version method. +message DeleteProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the deploy processor version method. +message DeployProcessorVersionRequest { + // Required. The processor version resource name to be deployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the deploy processor version method. +message DeployProcessorVersionResponse { + +} + +// The long running operation metadata for deploy processor version method. +message DeployProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the undeploy processor version method. +message UndeployProcessorVersionRequest { + // Required. The processor version resource name to be undeployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the undeploy processor version method. +message UndeployProcessorVersionResponse { + +} + +// The long running operation metadata for the undeploy processor version +// method. +message UndeployProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + // Request message for create a processor. Notice this request is sent to // a regionalized backend service, and if the processor type is not available // on that region, the creation will fail. message CreateProcessorRequest { // Required. The parent (project and location) under which to create the processor. - // Format: projects/{project}/locations/{location} + // Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -455,6 +702,7 @@ message EnableProcessorRequest { } // Response message for the enable processor method. +// Intentionally empty proto for adding fields in future. message EnableProcessorResponse { } @@ -477,6 +725,7 @@ message DisableProcessorRequest { } // Response message for the disable processor method. +// Intentionally empty proto for adding fields in future. message DisableProcessorResponse { } @@ -487,8 +736,40 @@ message DisableProcessorMetadata { CommonOperationMetadata common_metadata = 5; } +// Request message for the set default processor version method. +message SetDefaultProcessorVersionRequest { + // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version. + string processor = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + string default_processor_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for set default processor version method. +message SetDefaultProcessorVersionResponse { + +} + +// The long running operation metadata for set default processor version +// method. +message SetDefaultProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + // Request message for review document method. -// Next Id: 6. message ReviewDocumentRequest { // The priority level of the human review task. enum Priority { @@ -523,12 +804,34 @@ message ReviewDocumentRequest { // The priority of the human review task. Priority priority = 5; + + // The document schema of the human review task. + DocumentSchema document_schema = 6; } // Response message for review document method. message ReviewDocumentResponse { - // The Cloud Storage uri for the human reviewed document. + // Possible states of the review operation. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The review operation is rejected by the reviewer. + REJECTED = 1; + + // The review operation is succeeded. + SUCCEEDED = 2; + } + + // The Cloud Storage uri for the human reviewed document if the review is + // succeeded. string gcs_destination = 1; + + // The state of the review operation. + State state = 2; + + // The reason why the review is rejected by reviewer. + string rejection_reason = 3; } // The long running operation metadata for review document method. @@ -570,6 +873,6 @@ message ReviewDocumentOperationMetadata { // The basic metadata of the long running operation. CommonOperationMetadata common_metadata = 5; - // The question ID. + // The Crowd Compute question ID. string question_id = 6; } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_schema.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_schema.proto new file mode 100644 index 00000000000..214e56864de --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_schema.proto @@ -0,0 +1,140 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1beta3; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiDocumentSchema"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// The schema defines the output of the processed document by a processor. +message DocumentSchema { + // EntityType is the wrapper of a label of the corresponding model with + // detailed attributes and limitations for entity-based processors. Multiple + // types can also compose a dependency tree to represent nested types. + message EntityType { + // Defines the a list of enum values. + message EnumValues { + // The individual values that this enum values type can include. + repeated string values = 1; + } + + // Defines properties that can be part of the entity type. + message Property { + // Types of occurrences of the entity type in the document. Note: this + // represents the number of instances of an entity types, not number of + // mentions of a given entity instance. + enum OccurrenceType { + // Unspecified occurrence type. + OCCURRENCE_TYPE_UNSPECIFIED = 0; + + // There will be zero or one instance of this entity type. + OPTIONAL_ONCE = 1; + + // The entity type will appear zero or multiple times. + OPTIONAL_MULTIPLE = 2; + + // The entity type will only appear exactly once. + REQUIRED_ONCE = 3; + + // The entity type will appear once or more times. + REQUIRED_MULTIPLE = 4; + } + + // The name of the property. Follows the same guidelines as the + // EntityType name. + string name = 1; + + // A reference to the value type of the property. This type is subject + // to the same conventions as the `Entity.base_types` field. + string value_type = 2; + + // Occurrence type limits the number of instances an entity type appears + // in the document. + OccurrenceType occurrence_type = 3; + } + + oneof value_source { + // If specified, lists all the possible values for this entity. This + // should not be more than a handful of values. If the number of values + // is >10 or could change frequently use the `EntityType.value_ontology` + // field and specify a list of all possible values in a value ontology + // file. + EnumValues enum_values = 14; + } + + // User defined name for the type. + string display_name = 13; + + // Name of the type. It must be unique within the schema file and + // cannot be a 'Common Type'. Besides that we use the following naming + // conventions: + // - *use snake_casing* + // - name matching is case-insensitive + // - Maximum 64 characters. + // - Must start with a letter. + // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + // compatibility internal infrastructure and tooling can handle any ascii + // character) + // - The '/' is sometimes used to denote a property of a type. For example + // line_item/amount. This convention is deprecated, but will still be + // honored for backward compatibility. + string name = 1; + + // The entity type that this type is derived from. For now, one and only + // one should be set. + repeated string base_types = 2; + + // Describing the nested structure, or composition of an entity. + repeated Property properties = 6; + } + + // Metadata for global schema behavior. + message Metadata { + // If true, a `document` entity type can be applied to subdocument ( + // splitting). Otherwise, it can only be applied to the entire document + // (classification). + bool document_splitter = 1; + + // If true, on a given page, there can be multiple `document` annotations + // covering it. + bool document_allow_multiple_labels = 2; + + // If set, all the nested entities must be prefixed with the parents. + bool prefixed_naming_on_properties = 6; + + // If set, we will skip the naming format validation in the schema. So the + // string values in `DocumentSchema.EntityType.name` and + // `DocumentSchema.EntityType.Property.name` will not be checked. + bool skip_naming_validation = 7; + } + + // Display name to show to users. + string display_name = 1; + + // Description of the schema. + string description = 2; + + // Entity types of the schema. + repeated EntityType entity_types = 3; + + // Metadata of the schema. + Metadata metadata = 4; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/geometry.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/geometry.proto index 91cd956ea98..c42e0cb7a07 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/geometry.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; -import "google/api/annotations.proto"; - option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; option java_multiple_files = true; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/operation_metadata.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/operation_metadata.proto index 1d8624e8f79..cd573a823c4 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/operation_metadata.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/operation_metadata.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; @@ -56,6 +55,9 @@ message CommonOperationMetadata { // A message providing more details about the current state of processing. string state_message = 2; + // A related resource to this operation. + string resource = 5; + // The creation time of the operation. google.protobuf.Timestamp create_time = 3; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto index 61cd14a26e6..b7019bf4d12 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,9 +18,7 @@ package google.cloud.documentai.v1beta3; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/cloud/documentai/v1beta3/document_io.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; @@ -30,8 +28,84 @@ option java_package = "com.google.cloud.documentai.v1beta3"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; -// The first-class citizen for DocumentAI. Each processor defines how to extract -// structural information from a document. +// A processor version is an implementation of a processor. Each processor +// can have multiple versions, pre-trained by Google internally or up-trained +// by the customer. At a time, a processor can only have one default version +// version. So the processor's behavior (when processing documents) is defined +// by a default version +message ProcessorVersion { + option (google.api.resource) = { + type: "documentai.googleapis.com/ProcessorVersion" + pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" + }; + + // Information about the upcoming deprecation of this processor version. + message DeprecationInfo { + // The time at which this processor version will be deprecated. + google.protobuf.Timestamp deprecation_time = 1; + + // If set, the processor version that will be used as a replacement. + string replacement_processor_version = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + } + + // The possible states of the processor version. + enum State { + // The processor version is in an unspecified state. + STATE_UNSPECIFIED = 0; + + // The processor version is deployed and can be used for processing. + DEPLOYED = 1; + + // The processor version is being deployed. + DEPLOYING = 2; + + // The processor version is not deployed and cannot be used for processing. + UNDEPLOYED = 3; + + // The processor version is being undeployed. + UNDEPLOYING = 4; + + // The processor version is being created. + CREATING = 5; + + // The processor version is being deleted. + DELETING = 6; + + // The processor version failed and is in an indeterminate state. + FAILED = 7; + } + + // The resource name of the processor version. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + string name = 1; + + // The display name of the processor version. + string display_name = 2; + + // The state of the processor version. + State state = 6; + + // The time the processor version was created. + google.protobuf.Timestamp create_time = 7; + + // The KMS key name used for encryption. + string kms_key_name = 9; + + // The KMS key version with which data is encrypted. + string kms_key_version_name = 10; + + // Denotes that this ProcessorVersion is managed by google. + bool google_managed = 11; + + // If set, information about the eventual deprecation of this version. + DeprecationInfo deprecation_info = 13; +} + +// The first-class citizen for Document AI. Each processor defines how to +// extract structural information from a document. message Processor { option (google.api.resource) = { type: "documentai.googleapis.com/Processor" @@ -43,7 +117,9 @@ message Processor { // The processor is in an unspecified state. STATE_UNSPECIFIED = 0; - // The processor is enabled. + // The processor is enabled, i.e., has an enabled version which can + // currently serve processing requests and all the feature dependencies have + // been successfully initialized. ENABLED = 1; // The processor is disabled. @@ -55,10 +131,16 @@ message Processor { // The processor is being disabled, will become DISABLED if successful. DISABLING = 4; - // The processor is being created. + // The processor is being created, will become either ENABLED (for + // successful creation) or FAILED (for failed ones). + // Once a processor is in this state, it can then be used for document + // processing, but the feature dependencies of the processor might not be + // fully created yet. CREATING = 5; - // The processor failed during creation. + // The processor failed during creation or initialization of feature + // dependencies. The user should delete the processor and recreate one as + // all the functionalities of the processor are disabled. FAILED = 6; // The processor is being deleted, will be removed if successful. @@ -66,13 +148,15 @@ message Processor { } // Output only. Immutable. The resource name of the processor. - // Format: projects/{project}/locations/{location}/processors/{processor} + // Format: `projects/{project}/locations/{location}/processors/{processor}` string name = 1 [ (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = OUTPUT_ONLY ]; - // The processor type. + // The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc. + // To get a list of processors types, see + // [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes]. string type = 2; // The display name of the processor. @@ -82,7 +166,9 @@ message Processor { State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // The default processor version. - string default_processor_version = 9; + string default_processor_version = 9 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; // Output only. Immutable. The http endpoint that can be called to invoke processing. string process_endpoint = 6 [ diff --git a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto index 4bd4c16ab05..a2799e301a9 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; +import "google/api/launch_stage.proto"; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai"; @@ -37,24 +37,27 @@ message ProcessorType { // The location information about where the processor is available. message LocationInfo { - // The location id. + // The location id, currently must be one of [us, eu]. string location_id = 1; } // The resource name of the processor type. + // Format: projects/{project}/processorTypes/{processor_type} string name = 1; - // The type of the processor. + // The type of the processor, e.g., "invoice_parsing". string type = 2; - // The processor category. + // The processor category, used by UI to group processor types. string category = 3; // The locations in which this processor is available. repeated LocationInfo available_locations = 4; - // Whether the processor type allows creation. If yes, user can create a - // processor of this processor type. Otherwise, user needs to require for - // whitelisting. + // Whether the processor type allows creation. If true, users can create a + // processor of this processor type. Otherwise, users need to request access. bool allow_creation = 6; + + // Launch stage of the processor type + google.api.LaunchStage launch_stage = 8; } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java similarity index 78% rename from java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java rename to java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java index fc0da471306..49a7e140217 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java @@ -16,26 +16,27 @@ package com.google.cloud.documentai.v1.samples; -// [START documentai_v1_generated_documentprocessorserviceclient_batchprocessdocuments_processorname_sync] +// [START documentai_v1_generated_documentprocessorserviceclient_batchprocessdocuments_resourcename_sync] +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1.BatchProcessResponse; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; import com.google.cloud.documentai.v1.ProcessorName; -public class SyncBatchProcessDocumentsProcessorname { +public class SyncBatchProcessDocumentsResourcename { public static void main(String[] args) throws Exception { - syncBatchProcessDocumentsProcessorname(); + syncBatchProcessDocumentsResourcename(); } - public static void syncBatchProcessDocumentsProcessorname() throws Exception { + public static void syncBatchProcessDocumentsResourcename() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); BatchProcessResponse response = documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); } } } -// [END documentai_v1_generated_documentprocessorserviceclient_batchprocessdocuments_processorname_sync] +// [END documentai_v1_generated_documentprocessorserviceclient_batchprocessdocuments_resourcename_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java index 9b24b826221..1ca1b97c89d 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java @@ -19,7 +19,7 @@ // [START documentai_v1_generated_documentprocessorserviceclient_batchprocessdocuments_string_sync] import com.google.cloud.documentai.v1.BatchProcessResponse; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; -import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.HumanReviewConfigName; public class SyncBatchProcessDocumentsString { @@ -32,7 +32,7 @@ public static void syncBatchProcessDocumentsString() throws Exception { // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); BatchProcessResponse response = documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/AsyncCreateProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/AsyncCreateProcessor.java new file mode 100644 index 00000000000..183f21a2e6f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/AsyncCreateProcessor.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_createprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class AsyncCreateProcessor { + + public static void main(String[] args) throws Exception { + asyncCreateProcessor(); + } + + public static void asyncCreateProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setProcessor(Processor.newBuilder().build()) + .build(); + ApiFuture future = + documentProcessorServiceClient.createProcessorCallable().futureCall(request); + // Do something. + Processor response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_createprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessor.java new file mode 100644 index 00000000000..600406b2a79 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_createprocessor_sync] +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncCreateProcessor { + + public static void main(String[] args) throws Exception { + syncCreateProcessor(); + } + + public static void syncCreateProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + CreateProcessorRequest request = + CreateProcessorRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setProcessor(Processor.newBuilder().build()) + .build(); + Processor response = documentProcessorServiceClient.createProcessor(request); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_createprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorLocationnameProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorLocationnameProcessor.java new file mode 100644 index 00000000000..8eb3428c657 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorLocationnameProcessor.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_createprocessor_locationnameprocessor_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncCreateProcessorLocationnameProcessor { + + public static void main(String[] args) throws Exception { + syncCreateProcessorLocationnameProcessor(); + } + + public static void syncCreateProcessorLocationnameProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Processor processor = Processor.newBuilder().build(); + Processor response = documentProcessorServiceClient.createProcessor(parent, processor); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_createprocessor_locationnameprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorStringProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorStringProcessor.java new file mode 100644 index 00000000000..9b347758755 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/createprocessor/SyncCreateProcessorStringProcessor.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_createprocessor_stringprocessor_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncCreateProcessorStringProcessor { + + public static void main(String[] args) throws Exception { + syncCreateProcessorStringProcessor(); + } + + public static void syncCreateProcessorStringProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Processor processor = Processor.newBuilder().build(); + Processor response = documentProcessorServiceClient.createProcessor(parent, processor); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_createprocessor_stringprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessor.java new file mode 100644 index 00000000000..67bc8a2f27d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessor.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.longrunning.Operation; + +public class AsyncDeleteProcessor { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessor(); + } + + public static void asyncDeleteProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorRequest request = + DeleteProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.deleteProcessorCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessorLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessorLRO.java new file mode 100644 index 00000000000..003f53ac3e5 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/AsyncDeleteProcessorLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.Empty; + +public class AsyncDeleteProcessorLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessorLRO(); + } + + public static void asyncDeleteProcessorLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorRequest request = + DeleteProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient.deleteProcessorOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessor.java new file mode 100644 index 00000000000..3cff6e2053a --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessor.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_sync] +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessor { + + public static void main(String[] args) throws Exception { + syncDeleteProcessor(); + } + + public static void syncDeleteProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorRequest request = + DeleteProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + documentProcessorServiceClient.deleteProcessorAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorProcessorname.java new file mode 100644 index 00000000000..151128dbb80 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorProcessorname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_processorname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorProcessorname { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorProcessorname(); + } + + public static void syncDeleteProcessorProcessorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + documentProcessorServiceClient.deleteProcessorAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_processorname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorString.java new file mode 100644 index 00000000000..1b6d8626915 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessor/SyncDeleteProcessorString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorString { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorString(); + } + + public static void syncDeleteProcessorString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + documentProcessorServiceClient.deleteProcessorAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessor_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java new file mode 100644 index 00000000000..c9ed9e282b9 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.longrunning.Operation; + +public class AsyncDeleteProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessorVersion(); + } + + public static void asyncDeleteProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.deleteProcessorVersionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java new file mode 100644 index 00000000000..21ee75e1934 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class AsyncDeleteProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessorVersionLRO(); + } + + public static void asyncDeleteProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .deleteProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java new file mode 100644 index 00000000000..91043ec9415 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_sync] +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersion { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersion(); + } + + public static void syncDeleteProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + documentProcessorServiceClient.deleteProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..1ea393e882f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersionProcessorversionname(); + } + + public static void syncDeleteProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + documentProcessorServiceClient.deleteProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java new file mode 100644 index 00000000000..7ddd67c4c3e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersionString(); + } + + public static void syncDeleteProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + documentProcessorServiceClient.deleteProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deleteprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java new file mode 100644 index 00000000000..f3c3d193b5a --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.longrunning.Operation; + +public class AsyncDeployProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncDeployProcessorVersion(); + } + + public static void asyncDeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.deployProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java new file mode 100644 index 00000000000..311c593c03a --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class AsyncDeployProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncDeployProcessorVersionLRO(); + } + + public static void asyncDeployProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .deployProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + DeployProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java new file mode 100644 index 00000000000..9136a306215 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_sync] +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncDeployProcessorVersion { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersion(); + } + + public static void syncDeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..bf218b08680 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncDeployProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersionProcessorversionname(); + } + + public static void syncDeployProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java new file mode 100644 index 00000000000..f579c532e47 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_string_sync] +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncDeployProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersionString(); + } + + public static void syncDeployProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_deployprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessor.java new file mode 100644 index 00000000000..48fb5d07d2e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessor.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_disableprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.longrunning.Operation; + +public class AsyncDisableProcessor { + + public static void main(String[] args) throws Exception { + asyncDisableProcessor(); + } + + public static void asyncDisableProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.disableProcessorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_disableprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessorLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessorLRO.java new file mode 100644 index 00000000000..5ee318b6d2d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/AsyncDisableProcessorLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_disableprocessor_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; + +public class AsyncDisableProcessorLRO { + + public static void main(String[] args) throws Exception { + asyncDisableProcessorLRO(); + } + + public static void asyncDisableProcessorLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient.disableProcessorOperationCallable().futureCall(request); + // Do something. + DisableProcessorResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_disableprocessor_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/SyncDisableProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/SyncDisableProcessor.java new file mode 100644 index 00000000000..633fdde583a --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/disableprocessor/SyncDisableProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_disableprocessor_sync] +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; + +public class SyncDisableProcessor { + + public static void main(String[] args) throws Exception { + syncDisableProcessor(); + } + + public static void syncDisableProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DisableProcessorRequest request = + DisableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + DisableProcessorResponse response = + documentProcessorServiceClient.disableProcessorAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_disableprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessor.java new file mode 100644 index 00000000000..f04ae7e849d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessor.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_enableprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.longrunning.Operation; + +public class AsyncEnableProcessor { + + public static void main(String[] args) throws Exception { + asyncEnableProcessor(); + } + + public static void asyncEnableProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.enableProcessorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_enableprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessorLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessorLRO.java new file mode 100644 index 00000000000..a6c65700070 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/AsyncEnableProcessorLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_enableprocessor_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.ProcessorName; + +public class AsyncEnableProcessorLRO { + + public static void main(String[] args) throws Exception { + asyncEnableProcessorLRO(); + } + + public static void asyncEnableProcessorLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient.enableProcessorOperationCallable().futureCall(request); + // Do something. + EnableProcessorResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_enableprocessor_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/SyncEnableProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/SyncEnableProcessor.java new file mode 100644 index 00000000000..d27df039d58 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/enableprocessor/SyncEnableProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_enableprocessor_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.ProcessorName; + +public class SyncEnableProcessor { + + public static void main(String[] args) throws Exception { + syncEnableProcessor(); + } + + public static void syncEnableProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EnableProcessorRequest request = + EnableProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + EnableProcessorResponse response = + documentProcessorServiceClient.enableProcessorAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_enableprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/AsyncFetchProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/AsyncFetchProcessorTypes.java new file mode 100644 index 00000000000..4c979fa1d35 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/AsyncFetchProcessorTypes.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.LocationName; + +public class AsyncFetchProcessorTypes { + + public static void main(String[] args) throws Exception { + asyncFetchProcessorTypes(); + } + + public static void asyncFetchProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.fetchProcessorTypesCallable().futureCall(request); + // Do something. + FetchProcessorTypesResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypes.java new file mode 100644 index 00000000000..2197a2fcc17 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypes.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.LocationName; + +public class SyncFetchProcessorTypes { + + public static void main(String[] args) throws Exception { + syncFetchProcessorTypes(); + } + + public static void syncFetchProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + FetchProcessorTypesResponse response = + documentProcessorServiceClient.fetchProcessorTypes(request); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesLocationname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesLocationname.java new file mode 100644 index 00000000000..6525992b506 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_locationname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.LocationName; + +public class SyncFetchProcessorTypesLocationname { + + public static void main(String[] args) throws Exception { + syncFetchProcessorTypesLocationname(); + } + + public static void syncFetchProcessorTypesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + FetchProcessorTypesResponse response = + documentProcessorServiceClient.fetchProcessorTypes(parent); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_locationname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesString.java new file mode 100644 index 00000000000..31646673faf --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/fetchprocessortypes/SyncFetchProcessorTypesString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.LocationName; + +public class SyncFetchProcessorTypesString { + + public static void main(String[] args) throws Exception { + syncFetchProcessorTypesString(); + } + + public static void syncFetchProcessorTypesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + FetchProcessorTypesResponse response = + documentProcessorServiceClient.fetchProcessorTypes(parent); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_fetchprocessortypes_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/AsyncGetLocation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 00000000000..88432051027 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + documentProcessorServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getlocation_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/SyncGetLocation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 00000000000..7fed4240605 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getlocation/SyncGetLocation.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getlocation_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = documentProcessorServiceClient.getLocation(request); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getlocation_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java new file mode 100644 index 00000000000..b3d3d5cbcd0 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorName; + +public class AsyncGetProcessor { + + public static void main(String[] args) throws Exception { + asyncGetProcessor(); + } + + public static void asyncGetProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.getProcessorCallable().futureCall(request); + // Do something. + Processor response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java new file mode 100644 index 00000000000..5c738492e8b --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessor_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorName; + +public class SyncGetProcessor { + + public static void main(String[] args) throws Exception { + syncGetProcessor(); + } + + public static void syncGetProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + Processor response = documentProcessorServiceClient.getProcessor(request); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java new file mode 100644 index 00000000000..1063d3248af --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessor_processorname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorName; + +public class SyncGetProcessorProcessorname { + + public static void main(String[] args) throws Exception { + syncGetProcessorProcessorname(); + } + + public static void syncGetProcessorProcessorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + Processor response = documentProcessorServiceClient.getProcessor(name); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessor_processorname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java new file mode 100644 index 00000000000..3ae6f8809f2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessor_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorName; + +public class SyncGetProcessorString { + + public static void main(String[] args) throws Exception { + syncGetProcessorString(); + } + + public static void syncGetProcessorString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + Processor response = documentProcessorServiceClient.getProcessor(name); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessor_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java new file mode 100644 index 00000000000..f3292848fbd --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class AsyncGetProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncGetProcessorVersion(); + } + + public static void asyncGetProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.getProcessorVersionCallable().futureCall(request); + // Do something. + ProcessorVersion response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java new file mode 100644 index 00000000000..d1f8d76f6d8 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncGetProcessorVersion { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersion(); + } + + public static void syncGetProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(request); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..28276defd58 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncGetProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersionProcessorversionname(); + } + + public static void syncGetProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java new file mode 100644 index 00000000000..2b12b11c34a --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncGetProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersionString(); + } + + public static void syncGetProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_getprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 00000000000..7d129a68703 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listlocations_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 00000000000..f2ac478ac35 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listlocations_paged_async] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + documentProcessorServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listlocations_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/SyncListLocations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 00000000000..874bb39f4b2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listlocations_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : documentProcessorServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listlocations_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessors.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessors.java new file mode 100644 index 00000000000..18bb4e2ba56 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessors_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class AsyncListProcessors { + + public static void main(String[] args) throws Exception { + asyncListProcessors(); + } + + public static void asyncListProcessors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorsRequest request = + ListProcessorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listProcessorsPagedCallable().futureCall(request); + // Do something. + for (Processor element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessors_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessorsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessorsPaged.java new file mode 100644 index 00000000000..8f4550b3f80 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/AsyncListProcessorsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessors_paged_async] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; +import com.google.common.base.Strings; + +public class AsyncListProcessorsPaged { + + public static void main(String[] args) throws Exception { + asyncListProcessorsPaged(); + } + + public static void asyncListProcessorsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorsRequest request = + ListProcessorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListProcessorsResponse response = + documentProcessorServiceClient.listProcessorsCallable().call(request); + for (Processor element : response.getProcessorsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessors_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessors.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessors.java new file mode 100644 index 00000000000..8f24c8abb51 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessors.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessors_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncListProcessors { + + public static void main(String[] args) throws Exception { + syncListProcessors(); + } + + public static void syncListProcessors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorsRequest request = + ListProcessorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Processor element : + documentProcessorServiceClient.listProcessors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessors_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsLocationname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsLocationname.java new file mode 100644 index 00000000000..99c4bc4b8fb --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsLocationname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessors_locationname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncListProcessorsLocationname { + + public static void main(String[] args) throws Exception { + syncListProcessorsLocationname(); + } + + public static void syncListProcessorsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessors_locationname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsString.java new file mode 100644 index 00000000000..416f72567f7 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessors/SyncListProcessorsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessors_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.Processor; + +public class SyncListProcessorsString { + + public static void main(String[] args) throws Exception { + syncListProcessorsString(); + } + + public static void syncListProcessorsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Processor element : documentProcessorServiceClient.listProcessors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessors_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java new file mode 100644 index 00000000000..75c5ea187c3 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.ProcessorType; + +public class AsyncListProcessorTypes { + + public static void main(String[] args) throws Exception { + asyncListProcessorTypes(); + } + + public static void asyncListProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listProcessorTypesPagedCallable().futureCall(request); + // Do something. + for (ProcessorType element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java new file mode 100644 index 00000000000..aba09d65d23 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_paged_async] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.ProcessorType; +import com.google.common.base.Strings; + +public class AsyncListProcessorTypesPaged { + + public static void main(String[] args) throws Exception { + asyncListProcessorTypesPaged(); + } + + public static void asyncListProcessorTypesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListProcessorTypesResponse response = + documentProcessorServiceClient.listProcessorTypesCallable().call(request); + for (ProcessorType element : response.getProcessorTypesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java new file mode 100644 index 00000000000..da8e0b43825 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.ProcessorType; + +public class SyncListProcessorTypes { + + public static void main(String[] args) throws Exception { + syncListProcessorTypes(); + } + + public static void syncListProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java new file mode 100644 index 00000000000..ce9dc2c61b9 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_locationname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.ProcessorType; + +public class SyncListProcessorTypesLocationname { + + public static void main(String[] args) throws Exception { + syncListProcessorTypesLocationname(); + } + + public static void syncListProcessorTypesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_locationname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java new file mode 100644 index 00000000000..7289715ca86 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.LocationName; +import com.google.cloud.documentai.v1.ProcessorType; + +public class SyncListProcessorTypesString { + + public static void main(String[] args) throws Exception { + syncListProcessorTypesString(); + } + + public static void syncListProcessorTypesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessortypes_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java new file mode 100644 index 00000000000..9f943ac68ef --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; + +public class AsyncListProcessorVersions { + + public static void main(String[] args) throws Exception { + asyncListProcessorVersions(); + } + + public static void asyncListProcessorVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listProcessorVersionsPagedCallable().futureCall(request); + // Do something. + for (ProcessorVersion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java new file mode 100644 index 00000000000..ff81ea27b8e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_paged_async] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.common.base.Strings; + +public class AsyncListProcessorVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListProcessorVersionsPaged(); + } + + public static void asyncListProcessorVersionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListProcessorVersionsResponse response = + documentProcessorServiceClient.listProcessorVersionsCallable().call(request); + for (ProcessorVersion element : response.getProcessorVersionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java new file mode 100644 index 00000000000..25c70d930e4 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; + +public class SyncListProcessorVersions { + + public static void main(String[] args) throws Exception { + syncListProcessorVersions(); + } + + public static void syncListProcessorVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java new file mode 100644 index 00000000000..38c2e742324 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_processorname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; + +public class SyncListProcessorVersionsProcessorname { + + public static void main(String[] args) throws Exception { + syncListProcessorVersionsProcessorname(); + } + + public static void syncListProcessorVersionsProcessorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_processorname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java new file mode 100644 index 00000000000..f134a2dd063 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; + +public class SyncListProcessorVersionsString { + + public static void main(String[] args) throws Exception { + syncListProcessorVersionsString(); + } + + public static void syncListProcessorVersionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_listprocessorversions_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java index 29358a643da..76f0ea744e2 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java @@ -22,6 +22,7 @@ import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.FieldMask; public class AsyncProcessDocument { @@ -38,6 +39,7 @@ public static void asyncProcessDocument() throws Exception { ProcessRequest.newBuilder() .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setSkipHumanReview(true) + .setFieldMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = documentProcessorServiceClient.processDocumentCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocument.java index cba90962c20..fd39dd017d9 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocument.java @@ -21,6 +21,7 @@ import com.google.cloud.documentai.v1.ProcessRequest; import com.google.cloud.documentai.v1.ProcessResponse; import com.google.cloud.documentai.v1.ProcessorName; +import com.google.protobuf.FieldMask; public class SyncProcessDocument { @@ -37,6 +38,7 @@ public static void syncProcessDocument() throws Exception { ProcessRequest.newBuilder() .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setSkipHumanReview(true) + .setFieldMask(FieldMask.newBuilder().build()) .build(); ProcessResponse response = documentProcessorServiceClient.processDocument(request); } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java similarity index 79% rename from java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java rename to java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java index 6f94a5ab2ac..a13a6e7a560 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java @@ -16,25 +16,26 @@ package com.google.cloud.documentai.v1.samples; -// [START documentai_v1_generated_documentprocessorserviceclient_processdocument_processorname_sync] +// [START documentai_v1_generated_documentprocessorserviceclient_processdocument_resourcename_sync] +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; import com.google.cloud.documentai.v1.ProcessResponse; import com.google.cloud.documentai.v1.ProcessorName; -public class SyncProcessDocumentProcessorname { +public class SyncProcessDocumentResourcename { public static void main(String[] args) throws Exception { - syncProcessDocumentProcessorname(); + syncProcessDocumentResourcename(); } - public static void syncProcessDocumentProcessorname() throws Exception { + public static void syncProcessDocumentResourcename() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); ProcessResponse response = documentProcessorServiceClient.processDocument(name); } } } -// [END documentai_v1_generated_documentprocessorserviceclient_processdocument_processorname_sync] +// [END documentai_v1_generated_documentprocessorserviceclient_processdocument_resourcename_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java index 54dc9fcfc26..0c1f42910b3 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java @@ -18,8 +18,8 @@ // [START documentai_v1_generated_documentprocessorserviceclient_processdocument_string_sync] import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.HumanReviewConfigName; import com.google.cloud.documentai.v1.ProcessResponse; -import com.google.cloud.documentai.v1.ProcessorName; public class SyncProcessDocumentString { @@ -32,7 +32,7 @@ public static void syncProcessDocumentString() throws Exception { // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); ProcessResponse response = documentProcessorServiceClient.processDocument(name); } } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java index c0691f642f4..e6654c21324 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java @@ -19,6 +19,7 @@ // [START documentai_v1_generated_documentprocessorserviceclient_reviewdocument_async] import com.google.api.core.ApiFuture; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; import com.google.cloud.documentai.v1.HumanReviewConfigName; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.longrunning.Operation; @@ -39,6 +40,7 @@ public static void asyncReviewDocument() throws Exception { .setHumanReviewConfig( HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); ApiFuture future = documentProcessorServiceClient.reviewDocumentCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java index a6db4fa2ca8..1d3a56dcd29 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java @@ -19,6 +19,7 @@ // [START documentai_v1_generated_documentprocessorserviceclient_reviewdocument_lro_async] import com.google.api.gax.longrunning.OperationFuture; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; import com.google.cloud.documentai.v1.HumanReviewConfigName; import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1.ReviewDocumentRequest; @@ -40,6 +41,7 @@ public static void asyncReviewDocumentLRO() throws Exception { .setHumanReviewConfig( HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); OperationFuture future = documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java index 68714cea4de..ea0a5598c93 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java @@ -18,6 +18,7 @@ // [START documentai_v1_generated_documentprocessorserviceclient_reviewdocument_sync] import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; import com.google.cloud.documentai.v1.HumanReviewConfigName; import com.google.cloud.documentai.v1.ReviewDocumentRequest; import com.google.cloud.documentai.v1.ReviewDocumentResponse; @@ -38,6 +39,7 @@ public static void syncReviewDocument() throws Exception { .setHumanReviewConfig( HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); ReviewDocumentResponse response = documentProcessorServiceClient.reviewDocumentAsync(request).get(); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java new file mode 100644 index 00000000000..fdc895accf2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.longrunning.Operation; + +public class AsyncSetDefaultProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncSetDefaultProcessorVersion(); + } + + public static void asyncSetDefaultProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.setDefaultProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java new file mode 100644 index 00000000000..e036159a83e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; + +public class AsyncSetDefaultProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncSetDefaultProcessorVersionLRO(); + } + + public static void asyncSetDefaultProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture + future = + documentProcessorServiceClient + .setDefaultProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + SetDefaultProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java new file mode 100644 index 00000000000..46bb58f3f0d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; + +public class SyncSetDefaultProcessorVersion { + + public static void main(String[] args) throws Exception { + syncSetDefaultProcessorVersion(); + } + + public static void syncSetDefaultProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + SetDefaultProcessorVersionResponse response = + documentProcessorServiceClient.setDefaultProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_setdefaultprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java new file mode 100644 index 00000000000..ea4faef46c7 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.longrunning.Operation; + +public class AsyncUndeployProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncUndeployProcessorVersion(); + } + + public static void asyncUndeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.undeployProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java new file mode 100644 index 00000000000..7282b700043 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; + +public class AsyncUndeployProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncUndeployProcessorVersionLRO(); + } + + public static void asyncUndeployProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .undeployProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + UndeployProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java new file mode 100644 index 00000000000..c05e88f394e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersion { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersion(); + } + + public static void syncUndeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..abf97f0c0fc --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersionProcessorversionname(); + } + + public static void syncUndeployProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java new file mode 100644 index 00000000000..ab45c00fa7d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_string_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersionString(); + } + + public static void syncUndeployProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1_generated_documentprocessorserviceclient_undeployprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java similarity index 78% rename from java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java rename to java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java index 8dbb9858bb0..2b95a7c0b94 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsProcessorname.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsResourcename.java @@ -16,26 +16,27 @@ package com.google.cloud.documentai.v1beta3.samples; -// [START documentai_v1beta3_generated_documentprocessorserviceclient_batchprocessdocuments_processorname_sync] +// [START documentai_v1beta3_generated_documentprocessorserviceclient_batchprocessdocuments_resourcename_sync] +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1beta3.BatchProcessResponse; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; import com.google.cloud.documentai.v1beta3.ProcessorName; -public class SyncBatchProcessDocumentsProcessorname { +public class SyncBatchProcessDocumentsResourcename { public static void main(String[] args) throws Exception { - syncBatchProcessDocumentsProcessorname(); + syncBatchProcessDocumentsResourcename(); } - public static void syncBatchProcessDocumentsProcessorname() throws Exception { + public static void syncBatchProcessDocumentsResourcename() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); BatchProcessResponse response = documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); } } } -// [END documentai_v1beta3_generated_documentprocessorserviceclient_batchprocessdocuments_processorname_sync] +// [END documentai_v1beta3_generated_documentprocessorserviceclient_batchprocessdocuments_resourcename_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java index 7859be7894a..5d9757f05cd 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/batchprocessdocuments/SyncBatchProcessDocumentsString.java @@ -19,7 +19,7 @@ // [START documentai_v1beta3_generated_documentprocessorserviceclient_batchprocessdocuments_string_sync] import com.google.cloud.documentai.v1beta3.BatchProcessResponse; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; -import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.HumanReviewConfigName; public class SyncBatchProcessDocumentsString { @@ -32,7 +32,7 @@ public static void syncBatchProcessDocumentsString() throws Exception { // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); BatchProcessResponse response = documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java new file mode 100644 index 00000000000..06cafc31408 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.longrunning.Operation; + +public class AsyncDeleteProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessorVersion(); + } + + public static void asyncDeleteProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.deleteProcessorVersionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java new file mode 100644 index 00000000000..87cc390f805 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/AsyncDeleteProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class AsyncDeleteProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteProcessorVersionLRO(); + } + + public static void asyncDeleteProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .deleteProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java new file mode 100644 index 00000000000..6fb1eaabfe0 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_sync] +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersion { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersion(); + } + + public static void syncDeleteProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeleteProcessorVersionRequest request = + DeleteProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + documentProcessorServiceClient.deleteProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..996ec24c7f4 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionProcessorversionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersionProcessorversionname(); + } + + public static void syncDeleteProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + documentProcessorServiceClient.deleteProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java new file mode 100644 index 00000000000..57750311203 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deleteprocessorversion/SyncDeleteProcessorVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncDeleteProcessorVersionString(); + } + + public static void syncDeleteProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + documentProcessorServiceClient.deleteProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deleteprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java new file mode 100644 index 00000000000..eac54ab26a5 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.longrunning.Operation; + +public class AsyncDeployProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncDeployProcessorVersion(); + } + + public static void asyncDeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.deployProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java new file mode 100644 index 00000000000..844fd7f2eec --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/AsyncDeployProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class AsyncDeployProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncDeployProcessorVersionLRO(); + } + + public static void asyncDeployProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .deployProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + DeployProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java new file mode 100644 index 00000000000..7d82c576bf9 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_sync] +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncDeployProcessorVersion { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersion(); + } + + public static void syncDeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + DeployProcessorVersionRequest request = + DeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..696e2484e93 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionProcessorversionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncDeployProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersionProcessorversionname(); + } + + public static void syncDeployProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java new file mode 100644 index 00000000000..7f2cbd8a945 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/deployprocessorversion/SyncDeployProcessorVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_string_sync] +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncDeployProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncDeployProcessorVersionString(); + } + + public static void syncDeployProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + DeployProcessorVersionResponse response = + documentProcessorServiceClient.deployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_deployprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/AsyncGetLocation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 00000000000..8f8331c3e23 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + documentProcessorServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getlocation_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/SyncGetLocation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 00000000000..b34e545cb66 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getlocation/SyncGetLocation.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getlocation_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = documentProcessorServiceClient.getLocation(request); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getlocation_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java new file mode 100644 index 00000000000..1f2533dc951 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/AsyncGetProcessor.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorName; + +public class AsyncGetProcessor { + + public static void main(String[] args) throws Exception { + asyncGetProcessor(); + } + + public static void asyncGetProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.getProcessorCallable().futureCall(request); + // Do something. + Processor response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java new file mode 100644 index 00000000000..0e8af6bac2c --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessor.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorName; + +public class SyncGetProcessor { + + public static void main(String[] args) throws Exception { + syncGetProcessor(); + } + + public static void syncGetProcessor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorRequest request = + GetProcessorRequest.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .build(); + Processor response = documentProcessorServiceClient.getProcessor(request); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java new file mode 100644 index 00000000000..9ef141449dd --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorProcessorname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_processorname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorName; + +public class SyncGetProcessorProcessorname { + + public static void main(String[] args) throws Exception { + syncGetProcessorProcessorname(); + } + + public static void syncGetProcessorProcessorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + Processor response = documentProcessorServiceClient.getProcessor(name); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_processorname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java new file mode 100644 index 00000000000..fbbcf362e7b --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessor/SyncGetProcessorString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorName; + +public class SyncGetProcessorString { + + public static void main(String[] args) throws Exception { + syncGetProcessorString(); + } + + public static void syncGetProcessorString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + Processor response = documentProcessorServiceClient.getProcessor(name); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessor_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java new file mode 100644 index 00000000000..ca8b39bad6c --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/AsyncGetProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class AsyncGetProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncGetProcessorVersion(); + } + + public static void asyncGetProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.getProcessorVersionCallable().futureCall(request); + // Do something. + ProcessorVersion response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java new file mode 100644 index 00000000000..fea4d2c037c --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncGetProcessorVersion { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersion(); + } + + public static void syncGetProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetProcessorVersionRequest request = + GetProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(request); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..c2ab1dd70fc --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionProcessorversionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncGetProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersionProcessorversionname(); + } + + public static void syncGetProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java new file mode 100644 index 00000000000..66bf637c88f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/getprocessorversion/SyncGetProcessorVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; + +public class SyncGetProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncGetProcessorVersionString(); + } + + public static void syncGetProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + ProcessorVersion response = documentProcessorServiceClient.getProcessorVersion(name); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_getprocessorversion_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 00000000000..a4a824ebdc7 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 00000000000..416b95fc1ee --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_paged_async] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + documentProcessorServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/SyncListLocations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 00000000000..1b9b8f773a8 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : documentProcessorServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listlocations_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java new file mode 100644 index 00000000000..642e1d477be --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypes.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.LocationName; +import com.google.cloud.documentai.v1beta3.ProcessorType; + +public class AsyncListProcessorTypes { + + public static void main(String[] args) throws Exception { + asyncListProcessorTypes(); + } + + public static void asyncListProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listProcessorTypesPagedCallable().futureCall(request); + // Do something. + for (ProcessorType element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java new file mode 100644 index 00000000000..74817c657b9 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/AsyncListProcessorTypesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_paged_async] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.LocationName; +import com.google.cloud.documentai.v1beta3.ProcessorType; +import com.google.common.base.Strings; + +public class AsyncListProcessorTypesPaged { + + public static void main(String[] args) throws Exception { + asyncListProcessorTypesPaged(); + } + + public static void asyncListProcessorTypesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListProcessorTypesResponse response = + documentProcessorServiceClient.listProcessorTypesCallable().call(request); + for (ProcessorType element : response.getProcessorTypesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java new file mode 100644 index 00000000000..0405e67ccae --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypes.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.LocationName; +import com.google.cloud.documentai.v1beta3.ProcessorType; + +public class SyncListProcessorTypes { + + public static void main(String[] args) throws Exception { + syncListProcessorTypes(); + } + + public static void syncListProcessorTypes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorTypesRequest request = + ListProcessorTypesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java new file mode 100644 index 00000000000..6784fa2ce6d --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesLocationname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_locationname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.LocationName; +import com.google.cloud.documentai.v1beta3.ProcessorType; + +public class SyncListProcessorTypesLocationname { + + public static void main(String[] args) throws Exception { + syncListProcessorTypesLocationname(); + } + + public static void syncListProcessorTypesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_locationname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java new file mode 100644 index 00000000000..c6bce525fa4 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessortypes/SyncListProcessorTypesString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.LocationName; +import com.google.cloud.documentai.v1beta3.ProcessorType; + +public class SyncListProcessorTypesString { + + public static void main(String[] args) throws Exception { + syncListProcessorTypesString(); + } + + public static void syncListProcessorTypesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ProcessorType element : + documentProcessorServiceClient.listProcessorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessortypes_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java new file mode 100644 index 00000000000..a9db7dcc0cd --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; + +public class AsyncListProcessorVersions { + + public static void main(String[] args) throws Exception { + asyncListProcessorVersions(); + } + + public static void asyncListProcessorVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listProcessorVersionsPagedCallable().futureCall(request); + // Do something. + for (ProcessorVersion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java new file mode 100644 index 00000000000..b55a28fa3f2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/AsyncListProcessorVersionsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_paged_async] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.common.base.Strings; + +public class AsyncListProcessorVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListProcessorVersionsPaged(); + } + + public static void asyncListProcessorVersionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListProcessorVersionsResponse response = + documentProcessorServiceClient.listProcessorVersionsCallable().call(request); + for (ProcessorVersion element : response.getProcessorVersionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java new file mode 100644 index 00000000000..6bf43452146 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersions.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; + +public class SyncListProcessorVersions { + + public static void main(String[] args) throws Exception { + syncListProcessorVersions(); + } + + public static void syncListProcessorVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListProcessorVersionsRequest request = + ListProcessorVersionsRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java new file mode 100644 index 00000000000..5983f652212 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsProcessorname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_processorname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; + +public class SyncListProcessorVersionsProcessorname { + + public static void main(String[] args) throws Exception { + syncListProcessorVersionsProcessorname(); + } + + public static void syncListProcessorVersionsProcessorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_processorname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java new file mode 100644 index 00000000000..e1d853e223f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/listprocessorversions/SyncListProcessorVersionsString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; + +public class SyncListProcessorVersionsString { + + public static void main(String[] args) throws Exception { + syncListProcessorVersionsString(); + } + + public static void syncListProcessorVersionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + for (ProcessorVersion element : + documentProcessorServiceClient.listProcessorVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_listprocessorversions_string_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java index 290511bf34f..cdb420dcfb5 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/AsyncProcessDocument.java @@ -23,6 +23,7 @@ import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.protobuf.FieldMask; public class AsyncProcessDocument { @@ -40,6 +41,7 @@ public static void asyncProcessDocument() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setDocument(Document.newBuilder().build()) .setSkipHumanReview(true) + .setFieldMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = documentProcessorServiceClient.processDocumentCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocument.java index b378eb25075..b50e72fa646 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocument.java @@ -22,6 +22,7 @@ import com.google.cloud.documentai.v1beta3.ProcessRequest; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.protobuf.FieldMask; public class SyncProcessDocument { @@ -39,6 +40,7 @@ public static void syncProcessDocument() throws Exception { .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setDocument(Document.newBuilder().build()) .setSkipHumanReview(true) + .setFieldMask(FieldMask.newBuilder().build()) .build(); ProcessResponse response = documentProcessorServiceClient.processDocument(request); } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java similarity index 78% rename from java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java rename to java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java index 4d71676dfa6..9cb611032ec 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentProcessorname.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentResourcename.java @@ -16,25 +16,26 @@ package com.google.cloud.documentai.v1beta3.samples; -// [START documentai_v1beta3_generated_documentprocessorserviceclient_processdocument_processorname_sync] +// [START documentai_v1beta3_generated_documentprocessorserviceclient_processdocument_resourcename_sync] +import com.google.api.resourcenames.ResourceName; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; import com.google.cloud.documentai.v1beta3.ProcessResponse; import com.google.cloud.documentai.v1beta3.ProcessorName; -public class SyncProcessDocumentProcessorname { +public class SyncProcessDocumentResourcename { public static void main(String[] args) throws Exception { - syncProcessDocumentProcessorname(); + syncProcessDocumentResourcename(); } - public static void syncProcessDocumentProcessorname() throws Exception { + public static void syncProcessDocumentResourcename() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ResourceName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); ProcessResponse response = documentProcessorServiceClient.processDocument(name); } } } -// [END documentai_v1beta3_generated_documentprocessorserviceclient_processdocument_processorname_sync] +// [END documentai_v1beta3_generated_documentprocessorserviceclient_processdocument_resourcename_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java index 405e9c152a2..e4dec8427cb 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/processdocument/SyncProcessDocumentString.java @@ -18,8 +18,8 @@ // [START documentai_v1beta3_generated_documentprocessorserviceclient_processdocument_string_sync] import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.HumanReviewConfigName; import com.google.cloud.documentai.v1beta3.ProcessResponse; -import com.google.cloud.documentai.v1beta3.ProcessorName; public class SyncProcessDocumentString { @@ -32,7 +32,7 @@ public static void syncProcessDocumentString() throws Exception { // It may require modifications to work in your environment. try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); ProcessResponse response = documentProcessorServiceClient.processDocument(name); } } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java index 083634698b7..1c87df559d9 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocument.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFuture; import com.google.cloud.documentai.v1beta3.Document; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.DocumentSchema; import com.google.cloud.documentai.v1beta3.HumanReviewConfigName; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.longrunning.Operation; @@ -41,6 +42,7 @@ public static void asyncReviewDocument() throws Exception { HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setDocument(Document.newBuilder().build()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); ApiFuture future = documentProcessorServiceClient.reviewDocumentCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java index 46124a1022b..47dc474fce9 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/AsyncReviewDocumentLRO.java @@ -20,6 +20,7 @@ import com.google.api.gax.longrunning.OperationFuture; import com.google.cloud.documentai.v1beta3.Document; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.DocumentSchema; import com.google.cloud.documentai.v1beta3.HumanReviewConfigName; import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; @@ -42,6 +43,7 @@ public static void asyncReviewDocumentLRO() throws Exception { HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setDocument(Document.newBuilder().build()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); OperationFuture future = documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java index ec43c9acd46..71c6d18da91 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/reviewdocument/SyncReviewDocument.java @@ -19,6 +19,7 @@ // [START documentai_v1beta3_generated_documentprocessorserviceclient_reviewdocument_sync] import com.google.cloud.documentai.v1beta3.Document; import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.DocumentSchema; import com.google.cloud.documentai.v1beta3.HumanReviewConfigName; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; @@ -40,6 +41,7 @@ public static void syncReviewDocument() throws Exception { HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) .setDocument(Document.newBuilder().build()) .setEnableSchemaValidation(true) + .setDocumentSchema(DocumentSchema.newBuilder().build()) .build(); ReviewDocumentResponse response = documentProcessorServiceClient.reviewDocumentAsync(request).get(); diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java new file mode 100644 index 00000000000..f505abde352 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersion.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.longrunning.Operation; + +public class AsyncSetDefaultProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncSetDefaultProcessorVersion(); + } + + public static void asyncSetDefaultProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.setDefaultProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java new file mode 100644 index 00000000000..daa47d6f9a1 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/AsyncSetDefaultProcessorVersionLRO.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; + +public class AsyncSetDefaultProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncSetDefaultProcessorVersionLRO(); + } + + public static void asyncSetDefaultProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture + future = + documentProcessorServiceClient + .setDefaultProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + SetDefaultProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java new file mode 100644 index 00000000000..d85a63e600f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/setdefaultprocessorversion/SyncSetDefaultProcessorVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorName; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; + +public class SyncSetDefaultProcessorVersion { + + public static void main(String[] args) throws Exception { + syncSetDefaultProcessorVersion(); + } + + public static void syncSetDefaultProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + SetDefaultProcessorVersionRequest request = + SetDefaultProcessorVersionRequest.newBuilder() + .setProcessor(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setDefaultProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + SetDefaultProcessorVersionResponse response = + documentProcessorServiceClient.setDefaultProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_setdefaultprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java new file mode 100644 index 00000000000..e8ffc8c5adc --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.longrunning.Operation; + +public class AsyncUndeployProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncUndeployProcessorVersion(); + } + + public static void asyncUndeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.undeployProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java new file mode 100644 index 00000000000..3e6a46c7bc2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/AsyncUndeployProcessorVersionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + +public class AsyncUndeployProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncUndeployProcessorVersionLRO(); + } + + public static void asyncUndeployProcessorVersionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .undeployProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + UndeployProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_lro_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java new file mode 100644 index 00000000000..153b4414fca --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersion { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersion(); + } + + public static void syncUndeployProcessorVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + UndeployProcessorVersionRequest request = + UndeployProcessorVersionRequest.newBuilder() + .setName( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .build(); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java new file mode 100644 index 00000000000..354e99f40c2 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionProcessorversionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_processorversionname_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersionProcessorversionname(); + } + + public static void syncUndeployProcessorVersionProcessorversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java new file mode 100644 index 00000000000..51aab1a126e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1beta3/documentprocessorserviceclient/undeployprocessorversion/SyncUndeployProcessorVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1beta3.samples; + +// [START documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_string_sync] +import com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1beta3.ProcessorVersionName; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + +public class SyncUndeployProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncUndeployProcessorVersionString(); + } + + public static void syncUndeployProcessorVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + UndeployProcessorVersionResponse response = + documentProcessorServiceClient.undeployProcessorVersionAsync(name).get(); + } + } +} +// [END documentai_v1beta3_generated_documentprocessorserviceclient_undeployprocessorversion_string_sync]