diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java index c3e1fd8b..5cf936fd 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java @@ -16,16 +16,26 @@ package com.google.cloud.documentai.v1beta3; +import com.google.api.core.ApiFunction; +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.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.cloud.documentai.v1beta3.stub.DocumentProcessorServiceStub; import com.google.cloud.documentai.v1beta3.stub.DocumentProcessorServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; import java.io.IOException; +import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -406,6 +416,646 @@ public final UnaryCallable batchProcessDocuments return stub.batchProcessDocumentsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches processor types. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FetchProcessorTypesResponse response =
+   *       documentProcessorServiceClient.fetchProcessorTypes(parent);
+   * }
+   * }
+ * + * @param parent Required. The project of processor type to list. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return fetchProcessorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches processor types. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent =
+   *       ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString();
+   *   FetchProcessorTypesResponse response =
+   *       documentProcessorServiceClient.fetchProcessorTypes(parent);
+   * }
+   * }
+ * + * @param parent Required. The project of processor type to list. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) { + FetchProcessorTypesRequest request = + FetchProcessorTypesRequest.newBuilder().setParent(parent).build(); + return fetchProcessorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches processor types. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   FetchProcessorTypesRequest request =
+   *       FetchProcessorTypesRequest.newBuilder()
+   *           .setParent(
+   *               ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
+   *           .build();
+   *   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 FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypesRequest request) { + return fetchProcessorTypesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches processor types. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   FetchProcessorTypesRequest request =
+   *       FetchProcessorTypesRequest.newBuilder()
+   *           .setParent(
+   *               ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.fetchProcessorTypesCallable().futureCall(request);
+   *   // Do something.
+   *   FetchProcessorTypesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + fetchProcessorTypesCallable() { + return stub.fetchProcessorTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * 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); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all processors which belong to this project. + * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListProcessorsRequest request =
+   *       ListProcessorsRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListProcessorsResponse response =
+   *         documentProcessorServiceClient.listProcessorsCallable().call(request);
+   *     for (Processor element : response.getResponsesList()) {
+   *       // 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. + /** + * 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
+   * 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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   CreateProcessorRequest request =
+   *       CreateProcessorRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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. /** * Send a document for Human Review. The input document should be processed by the specified @@ -479,6 +1129,7 @@ public final UnaryCallable batchProcessDocuments * .setHumanReviewConfig( * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) + * .setEnableSchemaValidation(true) * .build(); * ReviewDocumentResponse response = * documentProcessorServiceClient.reviewDocumentAsync(request).get(); @@ -508,6 +1159,7 @@ public final UnaryCallable batchProcessDocuments * .setHumanReviewConfig( * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) + * .setEnableSchemaValidation(true) * .build(); * OperationFuture future = * documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request); @@ -537,6 +1189,7 @@ public final UnaryCallable batchProcessDocuments * .setHumanReviewConfig( * HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) * .setDocument(Document.newBuilder().build()) + * .setEnableSchemaValidation(true) * .build(); * ApiFuture future = * documentProcessorServiceClient.reviewDocumentCallable().futureCall(request); @@ -578,4 +1231,85 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } + + 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, + new ApiFunction() { + @Override + public ListProcessorsPagedResponse apply(ListProcessorsPage input) { + return 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); + } + } } diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java index 02121ae1..1ef54e0c 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java @@ -16,6 +16,8 @@ package com.google.cloud.documentai.v1beta3; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -25,10 +27,12 @@ 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.v1beta3.stub.DocumentProcessorServiceStubSettings; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -89,6 +93,62 @@ 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 listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorsSettings(); + } + + /** 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 reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return ((DocumentProcessorServiceStubSettings) getStubSettings()).reviewDocumentSettings(); @@ -219,6 +279,60 @@ 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 listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return getStubSettingsBuilder().listProcessorsSettings(); + } + + /** 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 reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return getStubSettingsBuilder().reviewDocumentSettings(); diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json index 7fc33b6f..31b3fba1 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json @@ -13,6 +13,24 @@ "BatchProcessDocuments": { "methods": ["batchProcessDocumentsAsync", "batchProcessDocumentsAsync", "batchProcessDocumentsAsync", "batchProcessDocumentsOperationCallable", "batchProcessDocumentsCallable"] }, + "CreateProcessor": { + "methods": ["createProcessor", "createProcessor", "createProcessor", "createProcessorCallable"] + }, + "DeleteProcessor": { + "methods": ["deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorAsync", "deleteProcessorOperationCallable", "deleteProcessorCallable"] + }, + "DisableProcessor": { + "methods": ["disableProcessorAsync", "disableProcessorOperationCallable", "disableProcessorCallable"] + }, + "EnableProcessor": { + "methods": ["enableProcessorAsync", "enableProcessorOperationCallable", "enableProcessorCallable"] + }, + "FetchProcessorTypes": { + "methods": ["fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypesCallable"] + }, + "ListProcessors": { + "methods": ["listProcessors", "listProcessors", "listProcessors", "listProcessorsPagedCallable", "listProcessorsCallable"] + }, "ProcessDocument": { "methods": ["processDocument", "processDocument", "processDocument", "processDocumentCallable"] }, diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java index c8588ad4..7c4a04af 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java @@ -16,6 +16,8 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; @@ -23,13 +25,28 @@ import com.google.cloud.documentai.v1beta3.BatchProcessMetadata; import com.google.cloud.documentai.v1beta3.BatchProcessRequest; import com.google.cloud.documentai.v1beta3.BatchProcessResponse; +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.DisableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; +import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; +import com.google.cloud.documentai.v1beta3.EnableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.EnableProcessorRequest; +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.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.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; 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. @@ -60,6 +77,52 @@ public UnaryCallable batchProcessDocumentsCallab throw new UnsupportedOperationException("Not implemented: batchProcessDocumentsCallable()"); } + public UnaryCallable + fetchProcessorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: fetchProcessorTypesCallable()"); + } + + public UnaryCallable + listProcessorsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorsPagedCallable()"); + } + + public UnaryCallable listProcessorsCallable() { + throw new UnsupportedOperationException("Not implemented: listProcessorsCallable()"); + } + + 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< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationCallable() { diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java index 816206cd..8939a3d8 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java @@ -16,7 +16,10 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.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; @@ -28,18 +31,38 @@ 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.v1beta3.BatchProcessMetadata; import com.google.cloud.documentai.v1beta3.BatchProcessRequest; import com.google.cloud.documentai.v1beta3.BatchProcessResponse; +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.DisableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; +import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; +import com.google.cloud.documentai.v1beta3.EnableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.EnableProcessorRequest; +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.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.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; @@ -48,6 +71,7 @@ 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; @@ -99,11 +123,82 @@ public class DocumentProcessorServiceStubSettings private final OperationCallSettings< BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> batchProcessDocumentsOperationSettings; + private final UnaryCallSettings + fetchProcessorTypesSettings; + private final PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings; + 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 reviewDocumentSettings; private final OperationCallSettings< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + 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 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); + } + }; + /** Returns the object with the settings used for calls to processDocument. */ public UnaryCallSettings processDocumentSettings() { return processDocumentSettings; @@ -120,6 +215,59 @@ 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 listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return listProcessorsSettings; + } + + /** 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 reviewDocument. */ public UnaryCallSettings reviewDocumentSettings() { return reviewDocumentSettings; @@ -210,6 +358,15 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I batchProcessDocumentsSettings = settingsBuilder.batchProcessDocumentsSettings().build(); batchProcessDocumentsOperationSettings = settingsBuilder.batchProcessDocumentsOperationSettings().build(); + fetchProcessorTypesSettings = settingsBuilder.fetchProcessorTypesSettings().build(); + listProcessorsSettings = settingsBuilder.listProcessorsSettings().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(); reviewDocumentSettings = settingsBuilder.reviewDocumentSettings().build(); reviewDocumentOperationSettings = settingsBuilder.reviewDocumentOperationSettings().build(); } @@ -225,6 +382,28 @@ public static class Builder private final OperationCallSettings.Builder< BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> batchProcessDocumentsOperationSettings; + private final UnaryCallSettings.Builder + fetchProcessorTypesSettings; + private final PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings; + 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 reviewDocumentSettings; private final OperationCallSettings.Builder< @@ -241,6 +420,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(); } @@ -260,6 +440,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(); } @@ -273,12 +455,29 @@ protected Builder(ClientContext clientContext) { processDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchProcessDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder(); + fetchProcessorTypesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProcessorsSettings = PagedCallSettings.newBuilder(LIST_PROCESSORS_PAGE_STR_FACT); + createProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProcessorOperationSettings = OperationCallSettings.newBuilder(); + enableProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + enableProcessorOperationSettings = OperationCallSettings.newBuilder(); + disableProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + disableProcessorOperationSettings = OperationCallSettings.newBuilder(); reviewDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); reviewDocumentOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - processDocumentSettings, batchProcessDocumentsSettings, reviewDocumentSettings); + processDocumentSettings, + batchProcessDocumentsSettings, + fetchProcessorTypesSettings, + listProcessorsSettings, + createProcessorSettings, + deleteProcessorSettings, + enableProcessorSettings, + disableProcessorSettings, + reviewDocumentSettings); initDefaults(this); } @@ -289,12 +488,29 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { batchProcessDocumentsSettings = settings.batchProcessDocumentsSettings.toBuilder(); batchProcessDocumentsOperationSettings = settings.batchProcessDocumentsOperationSettings.toBuilder(); + fetchProcessorTypesSettings = settings.fetchProcessorTypesSettings.toBuilder(); + listProcessorsSettings = settings.listProcessorsSettings.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(); reviewDocumentSettings = settings.reviewDocumentSettings.toBuilder(); reviewDocumentOperationSettings = settings.reviewDocumentOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - processDocumentSettings, batchProcessDocumentsSettings, reviewDocumentSettings); + processDocumentSettings, + batchProcessDocumentsSettings, + fetchProcessorTypesSettings, + listProcessorsSettings, + createProcessorSettings, + deleteProcessorSettings, + enableProcessorSettings, + disableProcessorSettings, + reviewDocumentSettings); } private static Builder createDefault() { @@ -321,6 +537,36 @@ 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 + .listProcessorsSettings() + .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 .reviewDocumentSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) @@ -350,6 +596,78 @@ private static Builder initDefaults(Builder builder) { .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 .reviewDocumentOperationSettings() .setInitialCallSettings( @@ -414,6 +732,66 @@ 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 listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return listProcessorsSettings; + } + + /** 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 reviewDocument. */ public UnaryCallSettings.Builder reviewDocumentSettings() { return reviewDocumentSettings; diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java index 15ff5e41..474ff1e5 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java @@ -16,6 +16,8 @@ package com.google.cloud.documentai.v1beta3.stub; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -28,14 +30,29 @@ import com.google.cloud.documentai.v1beta3.BatchProcessMetadata; import com.google.cloud.documentai.v1beta3.BatchProcessRequest; import com.google.cloud.documentai.v1beta3.BatchProcessResponse; +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.DisableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; +import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; +import com.google.cloud.documentai.v1beta3.EnableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.EnableProcessorRequest; +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.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.ReviewDocumentOperationMetadata; import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; 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; @@ -72,6 +89,74 @@ 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.v1beta3.DocumentProcessorService/FetchProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessors") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService/DisableProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(DisableProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor reviewDocumentMethodDescriptor = MethodDescriptor.newBuilder() @@ -87,6 +172,23 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt private final UnaryCallable batchProcessDocumentsCallable; private final OperationCallable batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + 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 reviewDocumentCallable; private final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> @@ -163,6 +265,86 @@ public Map extract(BatchProcessRequest request) { } }) .build(); + GrpcCallSettings + fetchProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(FetchProcessorTypesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listProcessorsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListProcessorsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateProcessorRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProcessorRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings enableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(EnableProcessorRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings disableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DisableProcessorRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings reviewDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(reviewDocumentMethodDescriptor) @@ -192,6 +374,47 @@ public Map extract(ReviewDocumentRequest request) { settings.batchProcessDocumentsOperationSettings(), clientContext, operationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + 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.reviewDocumentCallable = callableFactory.createUnaryCallable( reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); @@ -226,6 +449,62 @@ public UnaryCallable batchProcessDocumentsCallab return batchProcessDocumentsOperationCallable; } + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @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 reviewDocumentCallable() { return reviewDocumentCallable; diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java index bfbb4626..be4910f6 100644 --- a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java @@ -16,6 +16,8 @@ package com.google.cloud.documentai.v1beta3; +import static com.google.cloud.documentai.v1beta3.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,11 +26,15 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +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.List; import java.util.UUID; @@ -246,6 +252,446 @@ public void batchProcessDocumentsExceptionTest2() throws Exception { } } + @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 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 createProcessorTest() throws Exception { + Processor expectedResponse = + Processor.newBuilder() + .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setType("type3575610") + .setDisplayName("displayName1714148973") + .setDefaultProcessorVersion("defaultProcessorVersion-1428555705") + .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("defaultProcessorVersion-1428555705") + .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 reviewDocumentTest() throws Exception { ReviewDocumentResponse expectedResponse = diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java index a4d05ec0..09113e55 100644 --- a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java @@ -101,6 +101,133 @@ 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 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 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 reviewDocument( ReviewDocumentRequest request, StreamObserver responseObserver) { diff --git a/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java b/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java index 581a61a4..5b2e629d 100644 --- a/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java +++ b/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java @@ -137,6 +137,298 @@ private DocumentProcessorServiceGrpc() {} return getBatchProcessDocumentsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchProcessorTypes", + requestType = com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "FetchProcessorTypes")) + .build(); + } + } + } + return getFetchProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse> + getListProcessorsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessors", + requestType = com.google.cloud.documentai.v1beta3.ListProcessorsRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListProcessorsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse> + getListProcessorsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorsRequest, + com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ListProcessors")) + .build(); + } + } + } + return getListProcessorsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getCreateProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProcessor", + requestType = com.google.cloud.documentai.v1beta3.CreateProcessorRequest.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.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getCreateProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("CreateProcessor")) + .build(); + } + } + } + return getCreateProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest, + com.google.longrunning.Operation> + getDeleteProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessor", + requestType = com.google.cloud.documentai.v1beta3.DeleteProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest, + com.google.longrunning.Operation> + getDeleteProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.EnableProcessorRequest, + com.google.longrunning.Operation> + getEnableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EnableProcessor", + requestType = com.google.cloud.documentai.v1beta3.EnableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.EnableProcessorRequest, + com.google.longrunning.Operation> + getEnableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DisableProcessorRequest, + com.google.longrunning.Operation> + getDisableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DisableProcessor", + requestType = com.google.cloud.documentai.v1beta3.DisableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DisableProcessorRequest, + com.google.longrunning.Operation> + getDisableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.ReviewDocumentRequest, com.google.longrunning.Operation> @@ -267,6 +559,95 @@ public void batchProcessDocuments( getBatchProcessDocumentsMethod(), responseObserver); } + /** + * + * + *
+     * Fetches processor types.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchProcessorTypesMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorsMethod(), 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.v1beta3.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.v1beta3.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public void enableProcessor( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEnableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public void disableProcessor( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDisableProcessorMethod(), responseObserver); + } + /** * * @@ -298,6 +679,45 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.documentai.v1beta3.BatchProcessRequest, com.google.longrunning.Operation>(this, METHODID_BATCH_PROCESS_DOCUMENTS))) + .addMethod( + getFetchProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse>( + this, METHODID_FETCH_PROCESSOR_TYPES))) + .addMethod( + getListProcessorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse>( + this, METHODID_LIST_PROCESSORS))) + .addMethod( + getCreateProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor>( + this, METHODID_CREATE_PROCESSOR))) + .addMethod( + getDeleteProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_PROCESSOR))) + .addMethod( + getEnableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.EnableProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_ENABLE_PROCESSOR))) + .addMethod( + getDisableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DisableProcessorRequest, + com.google.longrunning.Operation>(this, METHODID_DISABLE_PROCESSOR))) .addMethod( getReviewDocumentMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -364,6 +784,107 @@ public void batchProcessDocuments( responseObserver); } + /** + * + * + *
+     * Fetches processor types.
+     * 
+ */ + 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 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); + } + + /** + * + * + *
+     * 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.v1beta3.CreateProcessorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProcessorMethod(), getCallOptions()), + request, + 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.v1beta3.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public void enableProcessor( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnableProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public void disableProcessor( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -432,6 +953,86 @@ public com.google.longrunning.Operation batchProcessDocuments( getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Fetches processor types.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListProcessorsResponse listProcessors( + com.google.cloud.documentai.v1beta3.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorsMethod(), 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.cloud.documentai.v1beta3.Processor createProcessor( + com.google.cloud.documentai.v1beta3.CreateProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), 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.longrunning.Operation deleteProcessor( + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public com.google.longrunning.Operation enableProcessor( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnableProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public com.google.longrunning.Operation disableProcessor( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDisableProcessorMethod(), getCallOptions(), request); + } + /** * * @@ -498,6 +1099,90 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Fetches processor types.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse> + fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListProcessorsResponse> + listProcessors(com.google.cloud.documentai.v1beta3.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorsMethod(), 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.v1beta3.Processor> + createProcessor(com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DisableProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), request); + } + /** * * @@ -515,7 +1200,13 @@ 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_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 class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -545,6 +1236,41 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.documentai.v1beta3.BatchProcessRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_FETCH_PROCESSOR_TYPES: + serviceImpl.fetchProcessorTypes( + (com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse>) + responseObserver); + break; + case METHODID_LIST_PROCESSORS: + serviceImpl.listProcessors( + (com.google.cloud.documentai.v1beta3.ListProcessorsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorsResponse>) + responseObserver); + break; + case METHODID_CREATE_PROCESSOR: + serviceImpl.createProcessor( + (com.google.cloud.documentai.v1beta3.CreateProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR: + serviceImpl.deleteProcessor( + (com.google.cloud.documentai.v1beta3.DeleteProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ENABLE_PROCESSOR: + serviceImpl.enableProcessor( + (com.google.cloud.documentai.v1beta3.EnableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_PROCESSOR: + serviceImpl.disableProcessor( + (com.google.cloud.documentai.v1beta3.DisableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_REVIEW_DOCUMENT: serviceImpl.reviewDocument( (com.google.cloud.documentai.v1beta3.ReviewDocumentRequest) request, @@ -616,6 +1342,12 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new DocumentProcessorServiceFileDescriptorSupplier()) .addMethod(getProcessDocumentMethod()) .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getFetchProcessorTypesMethod()) + .addMethod(getListProcessorsMethod()) + .addMethod(getCreateProcessorMethod()) + .addMethod(getDeleteProcessorMethod()) + .addMethod(getEnableProcessorMethod()) + .addMethod(getDisableProcessorMethod()) .addMethod(getReviewDocumentMethod()) .build(); } diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java new file mode 100644 index 00000000..a441d526 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequest.java @@ -0,0 +1,976 @@ +/* + * 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 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.v1beta3.CreateProcessorRequest} + */ +public final class CreateProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.v1beta3.Processor.Builder subBuilder = null; + if (processor_ != null) { + subBuilder = processor_.toBuilder(); + } + processor_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.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 (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_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.CreateProcessorRequest.class, + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor getProcessor() { + return processor_ == null + ? com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.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 (!getParentBytes().isEmpty()) { + 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 (!getParentBytes().isEmpty()) { + 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.v1beta3.CreateProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.CreateProcessorRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.CreateProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.CreateProcessorRequest) + com.google.cloud.documentai.v1beta3.CreateProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.CreateProcessorRequest.class, + com.google.cloud.documentai.v1beta3.CreateProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CreateProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.CreateProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CreateProcessorRequest build() { + com.google.cloud.documentai.v1beta3.CreateProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.CreateProcessorRequest buildPartial() { + com.google.cloud.documentai.v1beta3.CreateProcessorRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.CreateProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.CreateProcessorRequest other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + public com.google.cloud.documentai.v1beta3.Processor getProcessor() { + if (processorBuilder_ == null) { + return processor_ == null + ? com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor(com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor( + com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProcessor(com.google.cloud.documentai.v1beta3.Processor value) { + if (processorBuilder_ == null) { + if (processor_ != null) { + processor_ = + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorOrBuilder getProcessorOrBuilder() { + if (processorBuilder_ != null) { + return processorBuilder_.getMessageOrBuilder(); + } else { + return processor_ == null + ? com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.ProcessorOrBuilder> + getProcessorFieldBuilder() { + if (processorBuilder_ == null) { + processorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.CreateProcessorRequest) + private static final com.google.cloud.documentai.v1beta3.CreateProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.CreateProcessorRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.CreateProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/CreateProcessorRequestOrBuilder.java new file mode 100644 index 00000000..b6447d19 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface CreateProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1beta3.ProcessorOrBuilder getProcessorOrBuilder(); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorMetadata.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorMetadata.java new file mode 100644 index 00000000..ba296301 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for delete processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorMetadata} + */ +public final class DeleteProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.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 (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_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + @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(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.v1beta3.DeleteProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DeleteProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeleteProcessorMetadata) + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata build() { + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata) 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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.DeleteProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeleteProcessorMetadata) + private static final com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeleteProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorMetadataOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorMetadataOrBuilder.java new file mode 100644 index 00000000..fd8cf919 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeleteProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DeleteProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorRequest.java new file mode 100644 index 00000000..175b4256 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorRequest.java @@ -0,0 +1,651 @@ +/* + * 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 method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DeleteProcessorRequest} + */ +public final class DeleteProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1beta3.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 (!getNameBytes().isEmpty()) { + 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 (!getNameBytes().isEmpty()) { + 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.DeleteProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DeleteProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DeleteProcessorRequest) + com.google.cloud.documentai.v1beta3.DeleteProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DeleteProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorRequest build() { + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DeleteProcessorRequest buildPartial() { + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DeleteProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DeleteProcessorRequest other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DeleteProcessorRequest) + private static final com.google.cloud.documentai.v1beta3.DeleteProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DeleteProcessorRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DeleteProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DeleteProcessorRequestOrBuilder.java new file mode 100644 index 00000000..89fd0d2d --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DeleteProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorMetadata.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorMetadata.java new file mode 100644 index 00000000..3f8ece41 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorMetadata.java @@ -0,0 +1,745 @@ +/* + * 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 disable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorMetadata} + */ +public final class DisableProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.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 (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_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + @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(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.v1beta3.DisableProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DisableProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DisableProcessorMetadata) + com.google.cloud.documentai.v1beta3.DisableProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DisableProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorMetadata build() { + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.DisableProcessorMetadata result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DisableProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DisableProcessorMetadata other) { + if (other + == com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.DisableProcessorMetadata) 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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.DisableProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DisableProcessorMetadata) + private static final com.google.cloud.documentai.v1beta3.DisableProcessorMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DisableProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorMetadataOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorMetadataOrBuilder.java new file mode 100644 index 00000000..ca7ca5c6 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DisableProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DisableProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorRequest.java new file mode 100644 index 00000000..65bee6be --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorRequest.java @@ -0,0 +1,651 @@ +/* + * 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 disable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorRequest} + */ +public final class DisableProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest.class, + com.google.cloud.documentai.v1beta3.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 (!getNameBytes().isEmpty()) { + 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 (!getNameBytes().isEmpty()) { + 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.DisableProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DisableProcessorRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DisableProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DisableProcessorRequest) + com.google.cloud.documentai.v1beta3.DisableProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest.class, + com.google.cloud.documentai.v1beta3.DisableProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DisableProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorRequest build() { + com.google.cloud.documentai.v1beta3.DisableProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorRequest buildPartial() { + com.google.cloud.documentai.v1beta3.DisableProcessorRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DisableProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DisableProcessorRequest other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DisableProcessorRequest) + private static final com.google.cloud.documentai.v1beta3.DisableProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DisableProcessorRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorRequestOrBuilder.java new file mode 100644 index 00000000..e9f04327 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DisableProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java new file mode 100644 index 00000000..4cd30c61 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponse.java @@ -0,0 +1,460 @@ +/* + * 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 disable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorResponse} + */ +public final class DisableProcessorResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorResponse.class, + com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.DisableProcessorResponse other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.DisableProcessorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.DisableProcessorResponse) + com.google.cloud.documentai.v1beta3.DisableProcessorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.DisableProcessorResponse.class, + com.google.cloud.documentai.v1beta3.DisableProcessorResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.DisableProcessorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorResponse build() { + com.google.cloud.documentai.v1beta3.DisableProcessorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.DisableProcessorResponse buildPartial() { + com.google.cloud.documentai.v1beta3.DisableProcessorResponse result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.DisableProcessorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.DisableProcessorResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.DisableProcessorResponse) + private static final com.google.cloud.documentai.v1beta3.DisableProcessorResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.DisableProcessorResponse(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.DisableProcessorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DisableProcessorResponseOrBuilder.java new file mode 100644 index 00000000..ab943270 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface DisableProcessorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.DisableProcessorResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java index f89147db..5a72ddb3 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Document.java @@ -4809,6 +4809,41 @@ com.google.cloud.documentai.v1beta3.Document.Page.ParagraphOrBuilder getParagrap */ com.google.cloud.documentai.v1beta3.Document.Page.FormFieldOrBuilder getFormFieldsOrBuilder( int index); + + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return Whether the provenance field is set. + */ + boolean hasProvenance(); + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return The provenance. + */ + com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance(); + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder getProvenanceOrBuilder(); } /** * @@ -5054,6 +5089,23 @@ private Page( extensionRegistry)); break; } + case 130: + { + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder subBuilder = null; + if (provenance_ != null) { + subBuilder = provenance_.toBuilder(); + } + provenance_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.Document.Provenance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provenance_); + provenance_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -24891,6 +24943,41 @@ com.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage getValueDetec * @return The bytes for valueType. */ com.google.protobuf.ByteString getValueTypeBytes(); + + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return Whether the provenance field is set. + */ + boolean hasProvenance(); + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return The provenance. + */ + com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance(); + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder getProvenanceOrBuilder(); } /** * @@ -25018,6 +25105,23 @@ private FormField( java.lang.String s = input.readStringRequireUtf8(); valueType_ = s; + break; + } + case 66: + { + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder subBuilder = null; + if (provenance_ != null) { + subBuilder = provenance_.toBuilder(); + } + provenance_ = + input.readMessage( + com.google.cloud.documentai.v1beta3.Document.Provenance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provenance_); + provenance_ = subBuilder.buildPartial(); + } + break; } default: @@ -25388,6 +25492,55 @@ public com.google.protobuf.ByteString getValueTypeBytes() { } } + public static final int PROVENANCE_FIELD_NUMBER = 8; + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return Whether the provenance field is set. + */ + @java.lang.Override + public boolean hasProvenance() { + return provenance_ != null; + } + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return The provenance. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance() { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } + /** + * + * + *
+       * The history of this annotation.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder + getProvenanceOrBuilder() { + return getProvenance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -25417,6 +25570,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getValueTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueType_); } + if (provenance_ != null) { + output.writeMessage(8, getProvenance()); + } unknownFields.writeTo(output); } @@ -25445,6 +25601,9 @@ public int getSerializedSize() { if (!getValueTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueType_); } + if (provenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getProvenance()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -25474,6 +25633,10 @@ public boolean equals(final java.lang.Object obj) { if (!getValueDetectedLanguagesList().equals(other.getValueDetectedLanguagesList())) return false; if (!getValueType().equals(other.getValueType())) return false; + if (hasProvenance() != other.hasProvenance()) return false; + if (hasProvenance()) { + if (!getProvenance().equals(other.getProvenance())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -25503,6 +25666,10 @@ public int hashCode() { } hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + getValueType().hashCode(); + if (hasProvenance()) { + hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getProvenance().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -25680,6 +25847,12 @@ public Builder clear() { } valueType_ = ""; + if (provenanceBuilder_ == null) { + provenance_ = null; + } else { + provenance_ = null; + provenanceBuilder_ = null; + } return this; } @@ -25740,6 +25913,11 @@ public com.google.cloud.documentai.v1beta3.Document.Page.FormField buildPartial( result.valueDetectedLanguages_ = valueDetectedLanguagesBuilder_.build(); } result.valueType_ = valueType_; + if (provenanceBuilder_ == null) { + result.provenance_ = provenance_; + } else { + result.provenance_ = provenanceBuilder_.build(); + } onBuilt(); return result; } @@ -25858,6 +26036,9 @@ public Builder mergeFrom( valueType_ = other.valueType_; onChanged(); } + if (other.hasProvenance()) { + mergeProvenance(other.getProvenance()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -27238,6 +27419,196 @@ public Builder setValueTypeBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder> + provenanceBuilder_; + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return Whether the provenance field is set. + */ + public boolean hasProvenance() { + return provenanceBuilder_ != null || provenance_ != null; + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + * + * @return The provenance. + */ + public com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance() { + if (provenanceBuilder_ == null) { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } else { + return provenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public Builder setProvenance( + com.google.cloud.documentai.v1beta3.Document.Provenance value) { + if (provenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provenance_ = value; + onChanged(); + } else { + provenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public Builder setProvenance( + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder builderForValue) { + if (provenanceBuilder_ == null) { + provenance_ = builderForValue.build(); + onChanged(); + } else { + provenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public Builder mergeProvenance( + com.google.cloud.documentai.v1beta3.Document.Provenance value) { + if (provenanceBuilder_ == null) { + if (provenance_ != null) { + provenance_ = + com.google.cloud.documentai.v1beta3.Document.Provenance.newBuilder(provenance_) + .mergeFrom(value) + .buildPartial(); + } else { + provenance_ = value; + } + onChanged(); + } else { + provenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public Builder clearProvenance() { + if (provenanceBuilder_ == null) { + provenance_ = null; + onChanged(); + } else { + provenance_ = null; + provenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public com.google.cloud.documentai.v1beta3.Document.Provenance.Builder + getProvenanceBuilder() { + + onChanged(); + return getProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + public com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder + getProvenanceOrBuilder() { + if (provenanceBuilder_ != null) { + return provenanceBuilder_.getMessageOrBuilder(); + } else { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } + } + /** + * + * + *
+         * The history of this annotation.
+         * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder> + getProvenanceFieldBuilder() { + if (provenanceBuilder_ == null) { + provenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder>( + getProvenance(), getParentForChildren(), isClean()); + provenance_ = null; + } + return provenanceBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -28960,6 +29331,55 @@ public com.google.cloud.documentai.v1beta3.Document.Page.FormField getFormFields return formFields_.get(index); } + public static final int PROVENANCE_FIELD_NUMBER = 16; + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return Whether the provenance field is set. + */ + @java.lang.Override + public boolean hasProvenance() { + return provenance_ != null; + } + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return The provenance. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance() { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } + /** + * + * + *
+     * The history of this page.
+     * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder + getProvenanceOrBuilder() { + return getProvenance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -29013,6 +29433,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)); } + if (provenance_ != null) { + output.writeMessage(16, getProvenance()); + } unknownFields.writeTo(output); } @@ -29062,6 +29485,9 @@ public int getSerializedSize() { for (int i = 0; i < transforms_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, transforms_.get(i)); } + if (provenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getProvenance()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -29100,6 +29526,10 @@ public boolean equals(final java.lang.Object obj) { if (!getVisualElementsList().equals(other.getVisualElementsList())) return false; if (!getTablesList().equals(other.getTablesList())) return false; if (!getFormFieldsList().equals(other.getFormFieldsList())) return false; + if (hasProvenance() != other.hasProvenance()) return false; + if (hasProvenance()) { + if (!getProvenance().equals(other.getProvenance())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -29161,6 +29591,10 @@ public int hashCode() { hash = (37 * hash) + FORM_FIELDS_FIELD_NUMBER; hash = (53 * hash) + getFormFieldsList().hashCode(); } + if (hasProvenance()) { + hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getProvenance().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -29392,6 +29826,12 @@ public Builder clear() { } else { formFieldsBuilder_.clear(); } + if (provenanceBuilder_ == null) { + provenance_ = null; + } else { + provenance_ = null; + provenanceBuilder_ = null; + } return this; } @@ -29517,6 +29957,11 @@ public com.google.cloud.documentai.v1beta3.Document.Page buildPartial() { } else { result.formFields_ = formFieldsBuilder_.build(); } + if (provenanceBuilder_ == null) { + result.provenance_ = provenance_; + } else { + result.provenance_ = provenanceBuilder_.build(); + } onBuilt(); return result; } @@ -29824,6 +30269,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Document.Page other } } } + if (other.hasProvenance()) { + mergeProvenance(other.getProvenance()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -34040,6 +34488,195 @@ public Builder removeFormFields(int index) { return formFieldsBuilder_; } + private com.google.cloud.documentai.v1beta3.Document.Provenance provenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder> + provenanceBuilder_; + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return Whether the provenance field is set. + */ + public boolean hasProvenance() { + return provenanceBuilder_ != null || provenance_ != null; + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + * + * @return The provenance. + */ + public com.google.cloud.documentai.v1beta3.Document.Provenance getProvenance() { + if (provenanceBuilder_ == null) { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } else { + return provenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public Builder setProvenance(com.google.cloud.documentai.v1beta3.Document.Provenance value) { + if (provenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provenance_ = value; + onChanged(); + } else { + provenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public Builder setProvenance( + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder builderForValue) { + if (provenanceBuilder_ == null) { + provenance_ = builderForValue.build(); + onChanged(); + } else { + provenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public Builder mergeProvenance( + com.google.cloud.documentai.v1beta3.Document.Provenance value) { + if (provenanceBuilder_ == null) { + if (provenance_ != null) { + provenance_ = + com.google.cloud.documentai.v1beta3.Document.Provenance.newBuilder(provenance_) + .mergeFrom(value) + .buildPartial(); + } else { + provenance_ = value; + } + onChanged(); + } else { + provenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public Builder clearProvenance() { + if (provenanceBuilder_ == null) { + provenance_ = null; + onChanged(); + } else { + provenance_ = null; + provenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public com.google.cloud.documentai.v1beta3.Document.Provenance.Builder + getProvenanceBuilder() { + + onChanged(); + return getProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + public com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder + getProvenanceOrBuilder() { + if (provenanceBuilder_ != null) { + return provenanceBuilder_.getMessageOrBuilder(); + } else { + return provenance_ == null + ? com.google.cloud.documentai.v1beta3.Document.Provenance.getDefaultInstance() + : provenance_; + } + } + /** + * + * + *
+       * The history of this page.
+       * 
+ * + * .google.cloud.documentai.v1beta3.Document.Provenance provenance = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder> + getProvenanceFieldBuilder() { + if (provenanceBuilder_ == null) { + provenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Document.Provenance, + com.google.cloud.documentai.v1beta3.Document.Provenance.Builder, + com.google.cloud.documentai.v1beta3.Document.ProvenanceOrBuilder>( + getProvenance(), getParentForChildren(), isClean()); + provenance_ = null; + } + return provenanceBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -43290,6 +43927,8 @@ 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
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* * int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -43818,6 +44457,8 @@ 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
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
        * 
* * int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -44418,6 +45059,8 @@ 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
+         * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* * int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -44434,6 +45077,8 @@ 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
+         * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* * int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -44453,6 +45098,8 @@ 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
+         * https://developers.google.com/protocol-buffers/docs/proto3#json.
          * 
* * int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -45913,10 +46560,11 @@ public interface ProvenanceOrBuilder * revision. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ + @java.lang.Deprecated int getId(); /** @@ -46395,6 +47043,20 @@ public interface ParentOrBuilder */ int getRevision(); + /** + * + * + *
+       * The index of the parent revisions corresponding collection of items
+       * (eg. list of entities, properties within entities, etc.)
+       * 
+ * + * int32 index = 3; + * + * @return The index. + */ + int getIndex(); + /** * * @@ -46402,10 +47064,11 @@ public interface ParentOrBuilder * The id of the parent provenance. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ + @java.lang.Deprecated int getId(); } /** @@ -46470,6 +47133,11 @@ private Parent( id_ = input.readInt32(); break; } + case 24: + { + index_ = input.readInt32(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -46523,6 +47191,25 @@ public int getRevision() { return revision_; } + public static final int INDEX_FIELD_NUMBER = 3; + private int index_; + /** + * + * + *
+       * The index of the parent revisions corresponding collection of items
+       * (eg. list of entities, properties within entities, etc.)
+       * 
+ * + * int32 index = 3; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + public static final int ID_FIELD_NUMBER = 2; private int id_; /** @@ -46532,11 +47219,12 @@ public int getRevision() { * The id of the parent provenance. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ @java.lang.Override + @java.lang.Deprecated public int getId() { return id_; } @@ -46561,6 +47249,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (id_ != 0) { output.writeInt32(2, id_); } + if (index_ != 0) { + output.writeInt32(3, index_); + } unknownFields.writeTo(output); } @@ -46576,6 +47267,9 @@ public int getSerializedSize() { if (id_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, id_); } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, index_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -46593,6 +47287,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.documentai.v1beta3.Document.Provenance.Parent) obj; if (getRevision() != other.getRevision()) return false; + if (getIndex() != other.getIndex()) return false; if (getId() != other.getId()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -46607,6 +47302,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + REVISION_FIELD_NUMBER; hash = (53 * hash) + getRevision(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId(); hash = (29 * hash) + unknownFields.hashCode(); @@ -46764,6 +47461,8 @@ public Builder clear() { super.clear(); revision_ = 0; + index_ = 0; + id_ = 0; return this; @@ -46796,6 +47495,7 @@ public com.google.cloud.documentai.v1beta3.Document.Provenance.Parent buildParti com.google.cloud.documentai.v1beta3.Document.Provenance.Parent result = new com.google.cloud.documentai.v1beta3.Document.Provenance.Parent(this); result.revision_ = revision_; + result.index_ = index_; result.id_ = id_; onBuilt(); return result; @@ -46855,6 +47555,9 @@ public Builder mergeFrom( if (other.getRevision() != 0) { setRevision(other.getRevision()); } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } if (other.getId() != 0) { setId(other.getId()); } @@ -46941,6 +47644,61 @@ public Builder clearRevision() { return this; } + private int index_; + /** + * + * + *
+         * The index of the parent revisions corresponding collection of items
+         * (eg. list of entities, properties within entities, etc.)
+         * 
+ * + * int32 index = 3; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + /** + * + * + *
+         * The index of the parent revisions corresponding collection of items
+         * (eg. list of entities, properties within entities, etc.)
+         * 
+ * + * int32 index = 3; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + index_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The index of the parent revisions corresponding collection of items
+         * (eg. list of entities, properties within entities, etc.)
+         * 
+ * + * int32 index = 3; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + + index_ = 0; + onChanged(); + return this; + } + private int id_; /** * @@ -46949,11 +47707,12 @@ public Builder clearRevision() { * The id of the parent provenance. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ @java.lang.Override + @java.lang.Deprecated public int getId() { return id_; } @@ -46964,11 +47723,12 @@ public int getId() { * The id of the parent provenance. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @param value The id to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setId(int value) { id_ = value; @@ -46982,10 +47742,11 @@ public Builder setId(int value) { * The id of the parent provenance. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearId() { id_ = 0; @@ -47076,11 +47837,12 @@ public int getRevision() { * revision. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ @java.lang.Override + @java.lang.Deprecated public int getId() { return id_; } @@ -47678,11 +48440,12 @@ public Builder clearRevision() { * revision. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return The id. */ @java.lang.Override + @java.lang.Deprecated public int getId() { return id_; } @@ -47694,11 +48457,12 @@ public int getId() { * revision. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @param value The id to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setId(int value) { id_ = value; @@ -47713,10 +48477,11 @@ public Builder setId(int value) { * revision. * * - * int32 id = 2; + * int32 id = 2 [deprecated = true]; * * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearId() { id_ = 0; diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java new file mode 100644 index 00000000..8991e55f --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessor.java @@ -0,0 +1,109 @@ +/* + * 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 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_v1beta3_Processor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_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/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" + }; + 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.cloud.documentai.v1beta3.DocumentIoProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_documentai_v1beta3_Processor_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1beta3_Processor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1beta3_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); + 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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java index 1d6d8843..601340aa 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentAiProcessorService.java @@ -63,6 +63,58 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1beta3_BatchProcessMetadata_IndividualProcessStatus_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1beta3_BatchProcessMetadata_IndividualProcessStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_ListProcessorsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_CreateProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_CreateProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DeleteProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DisableProcessorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1beta3_DisableProcessorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_ReviewDocumentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -93,116 +145,184 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v1beta3/document.proto\0321google/cloud/doc" + "umentai/v1beta3/document_io.proto\0328googl" + "e/cloud/documentai/v1beta3/operation_met" - + "adata.proto\032#google/longrunning/operatio" - + "ns.proto\032 google/protobuf/field_mask.pro" - + "to\032\037google/protobuf/timestamp.proto\032\027goo" - + "gle/rpc/status.proto\"\275\002\n\016ProcessRequest\022" - + "D\n\017inline_document\030\004 \001(\0132).google.cloud." - + "documentai.v1beta3.DocumentH\000\022D\n\014raw_doc" - + "ument\030\005 \001(\0132,.google.cloud.documentai.v1" - + "beta3.RawDocumentH\000\0229\n\004name\030\001 \001(\tB+\340A\002\372A" - + "%\n#documentai.googleapis.com/Processor\022?" - + "\n\010document\030\002 \001(\0132).google.cloud.document" - + "ai.v1beta3.DocumentB\002\030\001\022\031\n\021skip_human_re" - + "view\030\003 \001(\010B\010\n\006source\"\363\001\n\021HumanReviewStat" - + "us\022G\n\005state\030\001 \001(\01628.google.cloud.documen" - + "tai.v1beta3.HumanReviewStatus.State\022\025\n\rs" - + "tate_message\030\002 \001(\t\022\036\n\026human_review_opera" - + "tion\030\003 \001(\t\"^\n\005State\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\017ProcessRe" - + "sponse\022;\n\010document\030\001 \001(\0132).google.cloud." - + "documentai.v1beta3.Document\022\"\n\026human_rev" - + "iew_operation\030\002 \001(\tB\002\030\001\022O\n\023human_review_" - + "status\030\003 \001(\01322.google.cloud.documentai.v" - + "1beta3.HumanReviewStatus\"\315\004\n\023BatchProces" - + "sRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#document" - + "ai.googleapis.com/Processor\022`\n\rinput_con" - + "figs\030\002 \003(\0132E.google.cloud.documentai.v1b" - + "eta3.BatchProcessRequest.BatchInputConfi" - + "gB\002\030\001\022a\n\routput_config\030\003 \001(\0132F.google.cl" - + "oud.documentai.v1beta3.BatchProcessReque" - + "st.BatchOutputConfigB\002\030\001\022S\n\017input_docume" - + "nts\030\005 \001(\0132:.google.cloud.documentai.v1be" - + "ta3.BatchDocumentsInputConfig\022U\n\026documen" - + "t_output_config\030\006 \001(\01325.google.cloud.doc" - + "umentai.v1beta3.DocumentOutputConfig\022\031\n\021" - + "skip_human_review\030\004 \001(\010\032=\n\020BatchInputCon" - + "fig\022\022\n\ngcs_source\030\001 \001(\t\022\021\n\tmime_type\030\002 \001" - + "(\t:\002\030\001\0320\n\021BatchOutputConfig\022\027\n\017gcs_desti" - + "nation\030\001 \001(\t:\002\030\001\"\026\n\024BatchProcessResponse" - + "\"\262\005\n\024BatchProcessMetadata\022J\n\005state\030\001 \001(\016" - + "2;.google.cloud.documentai.v1beta3.Batch" - + "ProcessMetadata.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\022r\n\033individual_pro" - + "cess_statuses\030\005 \003(\0132M.google.cloud.docum" - + "entai.v1beta3.BatchProcessMetadata.Indiv" - + "idualProcessStatus\032\354\001\n\027IndividualProcess" - + "Status\022\030\n\020input_gcs_source\030\001 \001(\t\022\"\n\006stat" - + "us\030\002 \001(\0132\022.google.rpc.Status\022\036\n\026output_g" - + "cs_destination\030\003 \001(\t\022\"\n\026human_review_ope" - + "ration\030\004 \001(\tB\002\030\001\022O\n\023human_review_status\030" - + "\005 \001(\01322.google.cloud.documentai.v1beta3." - + "HumanReviewStatus\"r\n\005State\022\025\n\021STATE_UNSP" - + "ECIFIED\020\000\022\013\n\007WAITING\020\001\022\013\n\007RUNNING\020\002\022\r\n\tS" - + "UCCEEDED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020" - + "\005\022\n\n\006FAILED\020\006\"\372\001\n\025ReviewDocumentRequest\022" - + "D\n\017inline_document\030\004 \001(\0132).google.cloud." - + "documentai.v1beta3.DocumentH\000\022P\n\023human_r" - + "eview_config\030\001 \001(\tB3\340A\002\372A-\n+documentai.g" - + "oogleapis.com/HumanReviewConfig\022?\n\010docum" - + "ent\030\002 \001(\0132).google.cloud.documentai.v1be" - + "ta3.DocumentB\002\030\001B\010\n\006source\"1\n\026ReviewDocu" - + "mentResponse\022\027\n\017gcs_destination\030\001 \001(\t\"\253\003" - + "\n\037ReviewDocumentOperationMetadata\022U\n\005sta" - + "te\030\001 \001(\0162F.google.cloud.documentai.v1bet" - + "a3.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\013upda" - + "te_time\030\004 \001(\0132\032.google.protobuf.Timestam" - + "p\022Q\n\017common_metadata\030\005 \001(\01328.google.clou" - + "d.documentai.v1beta3.CommonOperationMeta" - + "data\"e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007" - + "RUNNING\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\0052\317\006\n\030Document" - + "ProcessorService\022\303\001\n\017ProcessDocument\022/.g" - + "oogle.cloud.documentai.v1beta3.ProcessRe" - + "quest\0320.google.cloud.documentai.v1beta3." - + "ProcessResponse\"M\202\323\344\223\002@\";/v1beta3/{name=" - + "projects/*/locations/*/processors/*}:pro" - + "cess:\001*\332A\004name\022\360\001\n\025BatchProcessDocuments" - + "\0224.google.cloud.documentai.v1beta3.Batch" - + "ProcessRequest\032\035.google.longrunning.Oper" - + "ation\"\201\001\202\323\344\223\002E\"@/v1beta3/{name=projects/" - + "*/locations/*/processors/*}:batchProcess" - + ":\001*\332A\004name\312A,\n\024BatchProcessResponse\022\024Bat" - + "chProcessMetadata\022\252\002\n\016ReviewDocument\0226.g" - + "oogle.cloud.documentai.v1beta3.ReviewDoc" - + "umentRequest\032\035.google.longrunning.Operat" - + "ion\"\300\001\202\323\344\223\002h\"c/v1beta3/{human_review_con" - + "fig=projects/*/locations/*/processors/*/" - + "humanReviewConfig}:reviewDocument:\001*\332A\023h" - + "uman_review_config\312A9\n\026ReviewDocumentRes" - + "ponse\022\037ReviewDocumentOperationMetadata\032M" - + "\312A\031documentai.googleapis.com\322A.https://w" - + "ww.googleapis.com/auth/cloud-platformB\261\004" - + "\n#com.google.cloud.documentai.v1beta3B\032D" - + "ocumentAiProcessorServiceP\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::" - + "V1beta3\352AM\n\"documentai.googleapis.com/Lo" - + "cation\022\'projects/{project}/locations/{lo" - + "cation}\352Ae\n#documentai.googleapis.com/Pr" - + "ocessor\022>projects/{project}/locations/{l" - + "ocation}/processors/{processor}\352A\177\n+docu" - + "mentai.googleapis.com/HumanReviewConfig\022" - + "Pprojects/{project}/locations/{location}" - + "/processors/{processor}/humanReviewConfi" - + "gb\006proto3" + + "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" + + "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\"\253\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\"e\n\005State\022\025\n\021STATE_UNS" + + "PECIFIED\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" + + "\0052\207\021\n\030DocumentProcessorService\022\303\001\n\017Proce" + + "ssDocument\022/.google.cloud.documentai.v1b" + + "eta3.ProcessRequest\0320.google.cloud.docum" + + "entai.v1beta3.ProcessResponse\"M\202\323\344\223\002@\";/" + + "v1beta3/{name=projects/*/locations/*/pro" + + "cessors/*}:process:\001*\332A\004name\022\360\001\n\025BatchPr" + + "ocessDocuments\0224.google.cloud.documentai" + + ".v1beta3.BatchProcessRequest\032\035.google.lo" + + "ngrunning.Operation\"\201\001\202\323\344\223\002E\"@/v1beta3/{" + + "name=projects/*/locations/*/processors/*" + + "}:batchProcess:\001*\332A\004name\312A,\n\024BatchProces" + + "sResponse\022\024BatchProcessMetadata\022\337\001\n\023Fetc" + + "hProcessorTypes\022;.google.cloud.documenta" + + "i.v1beta3.FetchProcessorTypesRequest\032<.g" + + "oogle.cloud.documentai.v1beta3.FetchProc" + + "essorTypesResponse\"M\202\323\344\223\002>\022.google.cloud.documentai" - + ".v1beta3.Document.Page.Table.TableCell\032\323" - + "\001\n\tTableCell\022E\n\006layout\030\001 \001(\01325.google.cl" - + "oud.documentai.v1beta3.Document.Page.Lay" - + "out\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.clo" - + "ud.documentai.v1beta3.Document.Page.Dete" - + "ctedLanguage\032\373\002\n\tFormField\022I\n\nfield_name" - + "\030\001 \001(\01325.google.cloud.documentai.v1beta3" - + ".Document.Page.Layout\022J\n\013field_value\030\002 \001" - + "(\01325.google.cloud.documentai.v1beta3.Doc" - + "ument.Page.Layout\022`\n\027name_detected_langu" - + "ages\030\003 \003(\0132?.google.cloud.documentai.v1b" - + "eta3.Document.Page.DetectedLanguage\022a\n\030v" - + "alue_detected_languages\030\004 \003(\0132?.google.c" - + "loud.documentai.v1beta3.Document.Page.De" - + "tectedLanguage\022\022\n\nvalue_type\030\005 \001(\t\032=\n\020De" - + "tectedLanguage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n" - + "\nconfidence\030\002 \001(\002\032\264\006\n\006Entity\022N\n\013text_anc" + + "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\354\002\n\006Layout\022I\n\013text_anc" + "hor\030\001 \001(\01324.google.cloud.documentai.v1be" - + "ta3.Document.TextAnchorB\003\340A\001\022\014\n\004type\030\002 \001" - + "(\t\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\002B\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\377\002\n\nProvenance\022\020\n\010" - + "revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\022L\n\007parents\030\003 " - + "\003(\0132;.google.cloud.documentai.v1beta3.Do" - + "cument.Provenance.Parent\022P\n\004type\030\004 \001(\0162B" - + ".google.cloud.documentai.v1beta3.Documen" - + "t.Provenance.OperationType\032&\n\006Parent\022\020\n\010" - + "revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\"\212\001\n\rOperation" - + "Type\022\036\n\032OPERATION_TYPE_UNSPECIFIED\020\000\022\007\n\003" - + "ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_R" - + "EQUESTED\020\004\022\021\n\rEVAL_APPROVED\020\005\022\020\n\014EVAL_SK" - + "IPPED\020\006\032\222\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\006parent" - + "\030\002 \003(\005\022/\n\013create_time\030\003 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022T\n\014human_review\030\006 \001(\0132>." + + "ta3.Document.TextAnchor\022\022\n\nconfidence\030\002 " + + "\001(\002\022D\n\rbounding_poly\030\003 \001(\0132-.google.clou" + + "d.documentai.v1beta3.BoundingPoly\022V\n\013ori" + + "entation\030\004 \001(\0162A.google.cloud.documentai" + + ".v1beta3.Document.Page.Layout.Orientatio" + + "n\"e\n\013Orientation\022\033\n\027ORIENTATION_UNSPECIF" + + "IED\020\000\022\013\n\007PAGE_UP\020\001\022\016\n\nPAGE_RIGHT\020\002\022\r\n\tPA" + + "GE_DOWN\020\003\022\r\n\tPAGE_LEFT\020\004\032\365\001\n\005Block\022E\n\006la" + + "yout\030\001 \001(\01325.google.cloud.documentai.v1b" + + "eta3.Document.Page.Layout\022[\n\022detected_la" + + "nguages\030\002 \003(\0132?.google.cloud.documentai." + + "v1beta3.Document.Page.DetectedLanguage\022H" + + "\n\nprovenance\030\003 \001(\01324.google.cloud.docume" + + "ntai.v1beta3.Document.Provenance\032\371\001\n\tPar" + + "agraph\022E\n\006layout\030\001 \001(\01325.google.cloud.do" + + "cumentai.v1beta3.Document.Page.Layout\022[\n" + + "\022detected_languages\030\002 \003(\0132?.google.cloud" + + ".documentai.v1beta3.Document.Page.Detect" + + "edLanguage\022H\n\nprovenance\030\003 \001(\01324.google." + + "cloud.documentai.v1beta3.Document.Proven" + + "ance\032\364\001\n\004Line\022E\n\006layout\030\001 \001(\01325.google.c" + + "loud.documentai.v1beta3.Document.Page.La" + + "yout\022[\n\022detected_languages\030\002 \003(\0132?.googl" + + "e.cloud.documentai.v1beta3.Document.Page" + + ".DetectedLanguage\022H\n\nprovenance\030\003 \001(\01324." + + "google.cloud.documentai.v1beta3.Document" + + ".Provenance\032\377\003\n\005Token\022E\n\006layout\030\001 \001(\01325." + "google.cloud.documentai.v1beta3.Document" - + ".Revision.HumanReview\0323\n\013HumanReview\022\r\n\005" - + "state\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006so" - + "urce\032\267\001\n\nTextChange\022I\n\013text_anchor\030\001 \001(\013" - + "24.google.cloud.documentai.v1beta3.Docum" - + "ent.TextAnchor\022\024\n\014changed_text\030\002 \001(\t\022H\n\n" - + "provenance\030\003 \003(\01324.google.cloud.document" - + "ai.v1beta3.Document.ProvenanceB\010\n\006source" - + "B\352\001\n#com.google.cloud.documentai.v1beta3" - + "B\rDocumentProtoP\001ZIgoogle.golang.org/gen" - + "proto/googleapis/cloud/documentai/v1beta" - + "3;documentai\252\002\037Google.Cloud.DocumentAI.V" - + "1Beta3\312\002\037Google\\Cloud\\DocumentAI\\V1beta3" - + "\352\002\"Google::Cloud::DocumentAI::V1beta3b\006p" - + "roto3" + + ".Page.Layout\022Z\n\016detected_break\030\002 \001(\0132B.g" + + "oogle.cloud.documentai.v1beta3.Document." + + "Page.Token.DetectedBreak\022[\n\022detected_lan" + + "guages\030\003 \003(\0132?.google.cloud.documentai.v" + + "1beta3.Document.Page.DetectedLanguage\022H\n" + + "\nprovenance\030\004 \001(\01324.google.cloud.documen" + + "tai.v1beta3.Document.Provenance\032\253\001\n\rDete" + + "ctedBreak\022U\n\004type\030\001 \001(\0162G.google.cloud.d" + + "ocumentai.v1beta3.Document.Page.Token.De" + + "tectedBreak.Type\"C\n\004Type\022\024\n\020TYPE_UNSPECI" + + "FIED\020\000\022\t\n\005SPACE\020\001\022\016\n\nWIDE_SPACE\020\002\022\n\n\006HYP" + + "HEN\020\003\032\301\001\n\rVisualElement\022E\n\006layout\030\001 \001(\0132" + + "5.google.cloud.documentai.v1beta3.Docume" + + "nt.Page.Layout\022\014\n\004type\030\002 \001(\t\022[\n\022detected" + + "_languages\030\003 \003(\0132?.google.cloud.document" + + "ai.v1beta3.Document.Page.DetectedLanguag" + + "e\032\202\005\n\005Table\022E\n\006layout\030\001 \001(\01325.google.clo" + + "ud.documentai.v1beta3.Document.Page.Layo" + + "ut\022R\n\013header_rows\030\002 \003(\0132=.google.cloud.d" + + "ocumentai.v1beta3.Document.Page.Table.Ta" + + "bleRow\022P\n\tbody_rows\030\003 \003(\0132=.google.cloud" + + ".documentai.v1beta3.Document.Page.Table." + + "TableRow\022[\n\022detected_languages\030\004 \003(\0132?.g" + + "oogle.cloud.documentai.v1beta3.Document." + + "Page.DetectedLanguage\032Y\n\010TableRow\022M\n\005cel" + + "ls\030\001 \003(\0132>.google.cloud.documentai.v1bet" + + "a3.Document.Page.Table.TableCell\032\323\001\n\tTab" + + "leCell\022E\n\006layout\030\001 \001(\01325.google.cloud.do" + + "cumentai.v1beta3.Document.Page.Layout\022\020\n" + + "\010row_span\030\002 \001(\005\022\020\n\010col_span\030\003 \001(\005\022[\n\022det" + + "ected_languages\030\004 \003(\0132?.google.cloud.doc" + + "umentai.v1beta3.Document.Page.DetectedLa" + + "nguage\032\305\003\n\tFormField\022I\n\nfield_name\030\001 \001(\013" + + "25.google.cloud.documentai.v1beta3.Docum" + + "ent.Page.Layout\022J\n\013field_value\030\002 \001(\01325.g" + + "oogle.cloud.documentai.v1beta3.Document." + + "Page.Layout\022`\n\027name_detected_languages\030\003" + + " \003(\0132?.google.cloud.documentai.v1beta3.D" + + "ocument.Page.DetectedLanguage\022a\n\030value_d" + + "etected_languages\030\004 \003(\0132?.google.cloud.d" + + "ocumentai.v1beta3.Document.Page.Detected" + + "Language\022\022\n\nvalue_type\030\005 \001(\t\022H\n\nprovenan" + + "ce\030\010 \001(\01324.google.cloud.documentai.v1bet" + + "a3.Document.Provenance\032=\n\020DetectedLangua" + + "ge\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\nconfidence\030" + + "\002 \001(\002\032\264\006\n\006Entity\022N\n\013text_anchor\030\001 \001(\01324." + + "google.cloud.documentai.v1beta3.Document" + + ".TextAnchorB\003\340A\001\022\014\n\004type\030\002 \001(\t\022\031\n\014mentio" + + "n_text\030\003 \001(\tB\003\340A\001\022\027\n\nmention_id\030\004 \001(\tB\003\340" + + "A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\022N\n\013page_anch" + + "or\030\006 \001(\01324.google.cloud.documentai.v1bet" + + "a3.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.Document.Entity" + + ".NormalizedValueB\003\340A\001\022I\n\nproperties\030\n \003(" + + "\01320.google.cloud.documentai.v1beta3.Docu" + + "ment.EntityB\003\340A\001\022M\n\nprovenance\030\013 \001(\01324.g" + + "oogle.cloud.documentai.v1beta3.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\ndate_value\030\003 \001(" + + "\0132\021.google.type.DateH\000\022/\n\016datetime_value" + + "\030\004 \001(\0132\025.google.type.DateTimeH\000\0223\n\raddre" + + "ss_value\030\005 \001(\0132\032.google.type.PostalAddre" + + "ssH\000\022\027\n\rboolean_value\030\006 \001(\010H\000\022\021\n\004text\030\001 " + + "\001(\tB\003\340A\002B\022\n\020structured_value\032I\n\016EntityRe" + + "lation\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.doc" + + "umentai.v1beta3.Document.TextAnchor.Text" + + "Segment\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" + + "\347\003\n\nPageAnchor\022O\n\tpage_refs\030\001 \003(\0132<.goog" + + "le.cloud.documentai.v1beta3.Document.Pag" + + "eAnchor.PageRef\032\207\003\n\007PageRef\022\021\n\004page\030\001 \001(" + + "\003B\003\340A\002\022a\n\013layout_type\030\002 \001(\0162G.google.clo" + + "ud.documentai.v1beta3.Document.PageAncho" + + "r.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-.goo" + + "gle.cloud.documentai.v1beta3.BoundingPol" + + "yB\003\340A\001\022\027\n\nconfidence\030\005 \001(\002B\003\340A\001\"\207\001\n\nLayo" + + "utType\022\033\n\027LAYOUT_TYPE_UNSPECIFIED\020\000\022\t\n\005B" + + "LOCK\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\nFOR" + + "M_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\007parents\030\003 \003(\0132;.go" + + "ogle.cloud.documentai.v1beta3.Document.P" + + "rovenance.Parent\022P\n\004type\030\004 \001(\0162B.google." + + "cloud.documentai.v1beta3.Document.Proven" + + "ance.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_UNSPEC" + + "IFIED\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\rEVAL_APPROVED\020\005" + + "\022\020\n\014EVAL_SKIPPED\020\006\032\222\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\006parent\030\002 \003(\005\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( @@ -456,6 +460,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "VisualElements", "Tables", "FormFields", + "Provenance", }); internal_static_google_cloud_documentai_v1beta3_Document_Page_Dimension_descriptor = internal_static_google_cloud_documentai_v1beta3_Document_Page_descriptor @@ -600,6 +605,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "NameDetectedLanguages", "ValueDetectedLanguages", "ValueType", + "Provenance", }); internal_static_google_cloud_documentai_v1beta3_Document_Page_DetectedLanguage_descriptor = internal_static_google_cloud_documentai_v1beta3_Document_Page_descriptor @@ -705,7 +711,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1beta3_Document_Provenance_Parent_descriptor, new java.lang.String[] { - "Revision", "Id", + "Revision", "Index", "Id", }); internal_static_google_cloud_documentai_v1beta3_Document_Revision_descriptor = internal_static_google_cloud_documentai_v1beta3_Document_descriptor.getNestedTypes().get(8); diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorMetadata.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorMetadata.java new file mode 100644 index 00000000..4667d030 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * The long running operation metadata for enable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorMetadata} + */ +public final class EnableProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.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 (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_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1beta3.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + @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(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.v1beta3.EnableProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.EnableProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.EnableProcessorMetadata) + com.google.cloud.documentai.v1beta3.EnableProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata.class, + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.EnableProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorMetadata build() { + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1beta3.EnableProcessorMetadata result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1beta3.EnableProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.EnableProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.EnableProcessorMetadata) 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 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.v1beta3.CommonOperationMetadata common_metadata = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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.EnableProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.EnableProcessorMetadata) + private static final com.google.cloud.documentai.v1beta3.EnableProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.EnableProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorMetadataOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorMetadataOrBuilder.java new file mode 100644 index 00000000..65859552 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface EnableProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.EnableProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long running operation.
+   * 
+ * + * .google.cloud.documentai.v1beta3.CommonOperationMetadata common_metadata = 5; + * + * @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 = 5; + */ + com.google.cloud.documentai.v1beta3.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorRequest.java new file mode 100644 index 00000000..cdb42d30 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorRequest.java @@ -0,0 +1,651 @@ +/* + * 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 enable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorRequest} + */ +public final class EnableProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest.class, + com.google.cloud.documentai.v1beta3.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 (!getNameBytes().isEmpty()) { + 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 (!getNameBytes().isEmpty()) { + 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.EnableProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.EnableProcessorRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.EnableProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.EnableProcessorRequest) + com.google.cloud.documentai.v1beta3.EnableProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest.class, + com.google.cloud.documentai.v1beta3.EnableProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.EnableProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorRequest build() { + com.google.cloud.documentai.v1beta3.EnableProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorRequest buildPartial() { + com.google.cloud.documentai.v1beta3.EnableProcessorRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.EnableProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.EnableProcessorRequest other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.EnableProcessorRequest) + private static final com.google.cloud.documentai.v1beta3.EnableProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.EnableProcessorRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorRequestOrBuilder.java new file mode 100644 index 00000000..4db20765 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface EnableProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java new file mode 100644 index 00000000..14c87c9d --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponse.java @@ -0,0 +1,457 @@ +/* + * 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 enable processor method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorResponse} + */ +public final class EnableProcessorResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorResponse.class, + com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.EnableProcessorResponse other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.EnableProcessorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.EnableProcessorResponse) + com.google.cloud.documentai.v1beta3.EnableProcessorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.EnableProcessorResponse.class, + com.google.cloud.documentai.v1beta3.EnableProcessorResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_EnableProcessorResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.EnableProcessorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorResponse build() { + com.google.cloud.documentai.v1beta3.EnableProcessorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.EnableProcessorResponse buildPartial() { + com.google.cloud.documentai.v1beta3.EnableProcessorResponse result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.EnableProcessorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.EnableProcessorResponse other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.EnableProcessorResponse) + private static final com.google.cloud.documentai.v1beta3.EnableProcessorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.EnableProcessorResponse(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.EnableProcessorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/EnableProcessorResponseOrBuilder.java new file mode 100644 index 00000000..04127ba6 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface EnableProcessorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.EnableProcessorResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java new file mode 100644 index 00000000..b7d2ab77 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequest.java @@ -0,0 +1,664 @@ +/* + * 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 fetch processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} + */ +public final class FetchProcessorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.class, + com.google.cloud.documentai.v1beta3.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.
+   * 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.
+   * 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 (!getParentBytes().isEmpty()) { + 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 (!getParentBytes().isEmpty()) { + 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.v1beta3.FetchProcessorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.FetchProcessorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.class, + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest build() { + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest buildPartial() { + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest other) { + if (other + == com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.
+     * 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.
+     * 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.
+     * 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.
+     * 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.
+     * 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.v1beta3.FetchProcessorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) + private static final com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java new file mode 100644 index 00000000..28c3e471 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 FetchProcessorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project of processor type to list.
+   * 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.
+   * 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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponse.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponse.java new file mode 100644 index 00000000..dcf5d97e --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponse.java @@ -0,0 +1,973 @@ +/* + * 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 fetch processor types.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} + */ +public final class FetchProcessorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.v1beta3.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 (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_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.class, + com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List getProcessorTypesList() { + return processorTypes_; + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public java.util.List + getProcessorTypesOrBuilderList() { + return processorTypes_; + } + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + @java.lang.Override + public int getProcessorTypesCount() { + return processorTypes_.size(); + } + /** + * + * + *
+   * The list of 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 list of 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); + } + + 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.v1beta3.FetchProcessorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.FetchProcessorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.class, + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_FetchProcessorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse build() { + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse buildPartial() { + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse other) { + if (other + == com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder, + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder> + processorTypesBuilder_; + + /** + * + * + *
+     * The list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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 list of 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_; + } + + @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.FetchProcessorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) + private static final com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.FetchProcessorTypesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponseOrBuilder.java new file mode 100644 index 00000000..c52e8007 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface FetchProcessorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + java.util.List getProcessorTypesList(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorType getProcessorTypes(int index); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + int getProcessorTypesCount(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + java.util.List + getProcessorTypesOrBuilderList(); + /** + * + * + *
+   * The list of processor types.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1; + */ + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder getProcessorTypesOrBuilder(int index); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java new file mode 100644 index 00000000..0ebc127d --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequest.java @@ -0,0 +1,942 @@ +/* + * 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 processors belongs to a project.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ListProcessorsRequest} + */ +public final class ListProcessorsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorsRequest.class, + com.google.cloud.documentai.v1beta3.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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + 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 (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + 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.ListProcessorsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorsRequest other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.ListProcessorsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorsRequest) + com.google.cloud.documentai.v1beta3.ListProcessorsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorsRequest.class, + com.google.cloud.documentai.v1beta3.ListProcessorsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsRequest build() { + com.google.cloud.documentai.v1beta3.ListProcessorsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsRequest buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorsRequest result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ListProcessorsRequest other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorsRequest) + private static final com.google.cloud.documentai.v1beta3.ListProcessorsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorsRequest(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsRequestOrBuilder.java new file mode 100644 index 00000000..157b8446 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsResponse.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsResponse.java new file mode 100644 index 00000000..19246e68 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsResponse.java @@ -0,0 +1,1133 @@ +/* + * 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.ListProcessorsResponse} + */ +public final class ListProcessorsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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.v1beta3.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 (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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorsResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse.Builder.class); + } + + public static final int PROCESSORS_FIELD_NUMBER = 1; + private java.util.List processors_; + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + @java.lang.Override + public java.util.List getProcessorsList() { + return processors_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + @java.lang.Override + public java.util.List + getProcessorsOrBuilderList() { + return processors_; + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + @java.lang.Override + public int getProcessorsCount() { + return processors_.size(); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor getProcessors(int index) { + return processors_.get(index); + } + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.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 (!getNextPageTokenBytes().isEmpty()) { + 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 (!getNextPageTokenBytes().isEmpty()) { + 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.ListProcessorsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ListProcessorsResponse other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.ListProcessorsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ListProcessorsResponse) + com.google.cloud.documentai.v1beta3.ListProcessorsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ListProcessorsResponse.class, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1beta3_ListProcessorsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ListProcessorsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsResponse build() { + com.google.cloud.documentai.v1beta3.ListProcessorsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ListProcessorsResponse buildPartial() { + com.google.cloud.documentai.v1beta3.ListProcessorsResponse result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ListProcessorsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ListProcessorsResponse other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.ProcessorOrBuilder> + processorsBuilder_; + + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public int getProcessorsCount() { + if (processorsBuilder_ == null) { + return processors_.size(); + } else { + return processorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + public com.google.cloud.documentai.v1beta3.Processor getProcessors(int index) { + if (processorsBuilder_ == null) { + return processors_.get(index); + } else { + return processorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + public Builder setProcessors(int index, com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public Builder setProcessors( + int index, com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public Builder addProcessors(com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public Builder addProcessors(int index, com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public Builder addProcessors( + com.google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public Builder addProcessors( + int index, com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Processor processors = 1; + */ + public com.google.cloud.documentai.v1beta3.Processor.Builder getProcessorsBuilder(int index) { + return getProcessorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + public com.google.cloud.documentai.v1beta3.ProcessorOrBuilder getProcessorsOrBuilder( + int index) { + if (processorsBuilder_ == null) { + return processors_.get(index); + } else { + return processorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.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.v1beta3.Processor processors = 1; + */ + public com.google.cloud.documentai.v1beta3.Processor.Builder addProcessorsBuilder() { + return getProcessorsFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + public com.google.cloud.documentai.v1beta3.Processor.Builder addProcessorsBuilder(int index) { + return getProcessorsFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance()); + } + /** + * + * + *
+     * The list of processors.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + public java.util.List + getProcessorsBuilderList() { + return getProcessorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.ProcessorOrBuilder> + getProcessorsFieldBuilder() { + if (processorsBuilder_ == null) { + processorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.Processor, + com.google.cloud.documentai.v1beta3.Processor.Builder, + com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ListProcessorsResponse) + private static final com.google.cloud.documentai.v1beta3.ListProcessorsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ListProcessorsResponse(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ListProcessorsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ListProcessorsResponseOrBuilder.java new file mode 100644 index 00000000..2414e6cb --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/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/v1beta3/document_processor_service.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ListProcessorsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ListProcessorsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + java.util.List getProcessorsList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + com.google.cloud.documentai.v1beta3.Processor getProcessors(int index); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + int getProcessorsCount(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + java.util.List + getProcessorsOrBuilderList(); + /** + * + * + *
+   * The list of processors.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta3.Processor processors = 1; + */ + com.google.cloud.documentai.v1beta3.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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/LocationName.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/LocationName.java new file mode 100644 index 00000000..750b2e48 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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 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) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java new file mode 100644 index 00000000..d5bd9cb3 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/Processor.java @@ -0,0 +1,2282 @@ +/* + * 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; + +/** + * + * + *
+ * The first-class citizen for DocumentAI. Each processor defines how to extract
+ * structural information from a document.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Processor} + */ +public final class Processor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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_Processor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_Processor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Processor.class, + com.google.cloud.documentai.v1beta3.Processor.Builder.class); + } + + /** + * + * + *
+   * The possible states of the processor.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1beta3.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.
+     * 
+ * + * 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.
+     * 
+ * + * CREATING = 5; + */ + CREATING(5), + /** + * + * + *
+     * The processor failed during creation.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * CREATING = 5; + */ + public static final int CREATING_VALUE = 5; + /** + * + * + *
+     * The processor failed during creation.
+     * 
+ * + * 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.v1beta3.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.v1beta3.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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.v1beta3.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.v1beta3.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.Processor.State result = + com.google.cloud.documentai.v1beta3.Processor.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.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; + * + * @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; + * + * @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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1beta3.Processor.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getProcessEndpointBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, processEndpoint_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (!getKmsKeyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, kmsKeyName_); + } + if (!getDefaultProcessorVersionBytes().isEmpty()) { + 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 (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (state_ + != com.google.cloud.documentai.v1beta3.Processor.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getProcessEndpointBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, processEndpoint_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (!getKmsKeyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, kmsKeyName_); + } + if (!getDefaultProcessorVersionBytes().isEmpty()) { + 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.v1beta3.Processor)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.Processor other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 DocumentAI. Each processor defines how to extract
+   * structural information from a document.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.Processor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Processor) + com.google.cloud.documentai.v1beta3.ProcessorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_Processor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_Processor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.Processor.class, + com.google.cloud.documentai.v1beta3.Processor.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessor + .internal_static_google_cloud_documentai_v1beta3_Processor_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor build() { + com.google.cloud.documentai.v1beta3.Processor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor buildPartial() { + com.google.cloud.documentai.v1beta3.Processor result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.Processor) { + return mergeFrom((com.google.cloud.documentai.v1beta3.Processor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Processor other) { + if (other == com.google.cloud.documentai.v1beta3.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.v1beta3.Processor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1beta3.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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The processor type.
+     * 
+ * + * 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.v1beta3.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.v1beta3.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.v1beta3.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.Processor.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.Processor.State result = + com.google.cloud.documentai.v1beta3.Processor.State.valueOf(state_); + return result == null + ? com.google.cloud.documentai.v1beta3.Processor.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The state of the processor.
+     * 
+ * + * + * .google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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; + * + * @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; + * + * @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; + * + * @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; + * + * @return This builder for chaining. + */ + public Builder clearDefaultProcessorVersion() { + + defaultProcessorVersion_ = getDefaultInstance().getDefaultProcessorVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The default processor version.
+     * 
+ * + * string default_processor_version = 9; + * + * @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.v1beta3.Processor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Processor) + private static final com.google.cloud.documentai.v1beta3.Processor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Processor(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.Processor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java new file mode 100644 index 00000000..80ac03c3 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorOrBuilder.java @@ -0,0 +1,251 @@ +/* + * 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 ProcessorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.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.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The processor type.
+   * 
+ * + * 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.v1beta3.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.v1beta3.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.documentai.v1beta3.Processor.State getState(); + + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9; + * + * @return The defaultProcessorVersion. + */ + java.lang.String getDefaultProcessorVersion(); + /** + * + * + *
+   * The default processor version.
+   * 
+ * + * string default_processor_version = 9; + * + * @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/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java new file mode 100644 index 00000000..7c255815 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorType.java @@ -0,0 +1,2323 @@ +/* + * 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_type.proto + +package com.google.cloud.documentai.v1beta3; + +/** + * + * + *
+ * A processor type is responsible for performing a certain document
+ * understanding task on a certain type of document.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta3.ProcessorType} + */ +public final class ProcessorType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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(); + } + + @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.v1beta3.ProcessorType.LocationInfo>(); + mutable_bitField0_ |= 0x00000001; + } + availableLocations_.add( + input.readMessage( + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.parser(), + extensionRegistry)); + break; + } + case 48: + { + allowCreation_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorType.class, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder.class); + } + + public interface LocationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The location id.
+     * 
+ * + * string location_id = 1; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + /** + * + * + *
+     * The location id.
+     * 
+ * + * 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.v1beta3.ProcessorType.LocationInfo} + */ + public static final class LocationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.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 (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.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.class, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder.class); + } + + public static final int LOCATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object locationId_; + /** + * + * + *
+     * The location id.
+     * 
+ * + * 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.
+     * 
+ * + * 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 (!getLocationIdBytes().isEmpty()) { + 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 (!getLocationIdBytes().isEmpty()) { + 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.v1beta3.ProcessorType.LocationInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo other = + (com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.ProcessorType.LocationInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.class, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_LocationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo build() { + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo buildPartial() { + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo result = + new com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo other) { + if (other + == com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object locationId_ = ""; + /** + * + * + *
+       * The location id.
+       * 
+ * + * 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.
+       * 
+ * + * 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.
+       * 
+ * + * 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.
+       * 
+ * + * string location_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + * + * + *
+       * The location id.
+       * 
+ * + * 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.v1beta3.ProcessorType.LocationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) + private static final com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder> + getAvailableLocationsOrBuilderList() { + return availableLocations_; + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo getAvailableLocations( + int index) { + return availableLocations_.get(index); + } + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.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 yes, user can create a
+   * processor of this processor type. Otherwise, user needs to require for
+   * whitelisting.
+   * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + @java.lang.Override + public boolean getAllowCreation() { + return allowCreation_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!getCategoryBytes().isEmpty()) { + 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_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!getCategoryBytes().isEmpty()) { + 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_); + } + 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.ProcessorType)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta3.ProcessorType other = + (com.google.cloud.documentai.v1beta3.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 (!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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta3.ProcessorType parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.ProcessorType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.ProcessorType) + com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta3.ProcessorType.class, + com.google.cloud.documentai.v1beta3.ProcessorType.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta3.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; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorType + .internal_static_google_cloud_documentai_v1beta3_ProcessorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta3.ProcessorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType build() { + com.google.cloud.documentai.v1beta3.ProcessorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ProcessorType buildPartial() { + com.google.cloud.documentai.v1beta3.ProcessorType result = + new com.google.cloud.documentai.v1beta3.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_; + 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.ProcessorType) { + return mergeFrom((com.google.cloud.documentai.v1beta3.ProcessorType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ProcessorType other) { + if (other == com.google.cloud.documentai.v1beta3.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()); + } + 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.ProcessorType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta3.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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the processor.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string category = 3; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The processor category.
+     * 
+ * + * 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.v1beta3.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder> + availableLocationsBuilder_; + + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder setAvailableLocations( + int index, com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder setAvailableLocations( + int index, + com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + int index, com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public Builder addAvailableLocations( + int index, + com.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder + getAvailableLocationsBuilder(int index) { + return getAvailableLocationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder + addAvailableLocationsBuilder() { + return getAvailableLocationsFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder + addAvailableLocationsBuilder(int index) { + return getAvailableLocationsFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The locations in which this processor is available.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + public java.util.List + getAvailableLocationsBuilderList() { + return getAvailableLocationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder> + getAvailableLocationsFieldBuilder() { + if (availableLocationsBuilder_ == null) { + availableLocationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.Builder, + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder>( + availableLocations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + availableLocations_ = null; + } + return availableLocationsBuilder_; + } + + private boolean allowCreation_; + /** + * + * + *
+     * Whether the processor type allows creation. If yes, user can create a
+     * processor of this processor type. Otherwise, user needs to require for
+     * whitelisting.
+     * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + @java.lang.Override + public boolean getAllowCreation() { + return allowCreation_; + } + /** + * + * + *
+     * Whether the processor type allows creation. If yes, user can create a
+     * processor of this processor type. Otherwise, user needs to require for
+     * whitelisting.
+     * 
+ * + * 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 yes, user can create a
+     * processor of this processor type. Otherwise, user needs to require for
+     * whitelisting.
+     * 
+ * + * bool allow_creation = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllowCreation() { + + allowCreation_ = 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.ProcessorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.ProcessorType) + private static final com.google.cloud.documentai.v1beta3.ProcessorType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.ProcessorType(); + } + + public static com.google.cloud.documentai.v1beta3.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.v1beta3.ProcessorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeName.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeName.java new file mode 100644 index 00000000..4cea485c --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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 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) { + project = processorTypeName.project; + location = processorTypeName.location; + processorType = processorTypeName.processorType; + } + + public ProcessorTypeName build() { + return new ProcessorTypeName(this); + } + } +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java new file mode 100644 index 00000000..c3b297bb --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ProcessorTypeOrBuilder.java @@ -0,0 +1,179 @@ +/* + * 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_type.proto + +package com.google.cloud.documentai.v1beta3; + +public interface ProcessorTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.ProcessorType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the processor type.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the processor type.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the processor.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The type of the processor.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The processor category.
+   * 
+ * + * string category = 3; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * The processor category.
+   * 
+ * + * 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.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + java.util.List + getAvailableLocationsList(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo getAvailableLocations(int index); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + int getAvailableLocationsCount(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + java.util.List + getAvailableLocationsOrBuilderList(); + /** + * + * + *
+   * The locations in which this processor is available.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta3.ProcessorType.LocationInfo available_locations = 4; + * + */ + com.google.cloud.documentai.v1beta3.ProcessorType.LocationInfoOrBuilder + getAvailableLocationsOrBuilder(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.
+   * 
+ * + * bool allow_creation = 6; + * + * @return The allowCreation. + */ + boolean getAllowCreation(); +} diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java index 550ee009..abe42238 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequest.java @@ -23,6 +23,7 @@ * *
  * Request message for review document method.
+ * Next Id: 6.
  * 
* * Protobuf type {@code google.cloud.documentai.v1beta3.ReviewDocumentRequest} @@ -39,6 +40,7 @@ private ReviewDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder private ReviewDocumentRequest() { humanReviewConfig_ = ""; + priority_ = 0; } @java.lang.Override @@ -91,6 +93,11 @@ private ReviewDocumentRequest( document_ = subBuilder.buildPartial(); } + break; + } + case 24: + { + enableSchemaValidation_ = input.readBool(); break; } case 34: @@ -109,6 +116,13 @@ private ReviewDocumentRequest( sourceCase_ = 4; break; } + case 40: + { + int rawValue = input.readEnum(); + + priority_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -143,6 +157,145 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Builder.class); } + /** + * + * + *
+   * The priority level of the human review task.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority} + */ + public enum Priority implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default priority level.
+     * 
+ * + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * + * + *
+     * The urgent priority level. The labeling manager should allocate labeler
+     * resource to the urgent task queue to respect this priority level.
+     * 
+ * + * URGENT = 1; + */ + URGENT(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default priority level.
+     * 
+ * + * DEFAULT = 0; + */ + public static final int DEFAULT_VALUE = 0; + /** + * + * + *
+     * The urgent priority level. The labeling manager should allocate labeler
+     * resource to the urgent task queue to respect this priority level.
+     * 
+ * + * URGENT = 1; + */ + public static final int URGENT_VALUE = 1; + + 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 Priority 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 Priority forNumber(int value) { + switch (value) { + case 0: + return DEFAULT; + case 1: + return URGENT; + 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 Priority findValueByNumber(int number) { + return Priority.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.ReviewDocumentRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Priority[] VALUES = values(); + + public static Priority 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 Priority(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority) + } + private int sourceCase_ = 0; private java.lang.Object source_; @@ -344,6 +497,62 @@ public com.google.cloud.documentai.v1beta3.DocumentOrBuilder getDocumentOrBuilde return getDocument(); } + public static final int ENABLE_SCHEMA_VALIDATION_FIELD_NUMBER = 3; + private boolean enableSchemaValidation_; + /** + * + * + *
+   * Whether the validation should be performed on the ad-hoc review request.
+   * 
+ * + * bool enable_schema_validation = 3; + * + * @return The enableSchemaValidation. + */ + @java.lang.Override + public boolean getEnableSchemaValidation() { + return enableSchemaValidation_; + } + + public static final int PRIORITY_FIELD_NUMBER = 5; + private int priority_; + /** + * + * + *
+   * The priority of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Override + public int getPriorityValue() { + return priority_; + } + /** + * + * + *
+   * The priority of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The priority. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority getPriority() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority result = + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.valueOf(priority_); + return result == null + ? com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -364,9 +573,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(2, getDocument()); } + if (enableSchemaValidation_ != false) { + output.writeBool(3, enableSchemaValidation_); + } if (sourceCase_ == 4) { output.writeMessage(4, (com.google.cloud.documentai.v1beta3.Document) source_); } + if (priority_ + != com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { + output.writeEnum(5, priority_); + } unknownFields.writeTo(output); } @@ -382,11 +598,18 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); } + if (enableSchemaValidation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableSchemaValidation_); + } if (sourceCase_ == 4) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 4, (com.google.cloud.documentai.v1beta3.Document) source_); } + if (priority_ + != com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, priority_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -408,6 +631,8 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (getEnableSchemaValidation() != other.getEnableSchemaValidation()) return false; + if (priority_ != other.priority_) return false; if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 4: @@ -433,6 +658,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + hash = (37 * hash) + ENABLE_SCHEMA_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSchemaValidation()); + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + priority_; switch (sourceCase_) { case 4: hash = (37 * hash) + INLINE_DOCUMENT_FIELD_NUMBER; @@ -547,6 +776,7 @@ 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} @@ -595,6 +825,10 @@ public Builder clear() { document_ = null; documentBuilder_ = null; } + enableSchemaValidation_ = false; + + priority_ = 0; + sourceCase_ = 0; source_ = null; return this; @@ -637,6 +871,8 @@ public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest buildPartial() } else { result.document_ = documentBuilder_.build(); } + result.enableSchemaValidation_ = enableSchemaValidation_; + result.priority_ = priority_; result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -695,6 +931,12 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta3.ReviewDocumentReque if (other.hasDocument()) { mergeDocument(other.getDocument()); } + if (other.getEnableSchemaValidation() != false) { + setEnableSchemaValidation(other.getEnableSchemaValidation()); + } + if (other.priority_ != 0) { + setPriorityValue(other.getPriorityValue()); + } switch (other.getSourceCase()) { case INLINE_DOCUMENT: { @@ -1274,6 +1516,152 @@ public com.google.cloud.documentai.v1beta3.DocumentOrBuilder getDocumentOrBuilde return documentBuilder_; } + private boolean enableSchemaValidation_; + /** + * + * + *
+     * Whether the validation should be performed on the ad-hoc review request.
+     * 
+ * + * bool enable_schema_validation = 3; + * + * @return The enableSchemaValidation. + */ + @java.lang.Override + public boolean getEnableSchemaValidation() { + return enableSchemaValidation_; + } + /** + * + * + *
+     * Whether the validation should be performed on the ad-hoc review request.
+     * 
+ * + * bool enable_schema_validation = 3; + * + * @param value The enableSchemaValidation to set. + * @return This builder for chaining. + */ + public Builder setEnableSchemaValidation(boolean value) { + + enableSchemaValidation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the validation should be performed on the ad-hoc review request.
+     * 
+ * + * bool enable_schema_validation = 3; + * + * @return This builder for chaining. + */ + public Builder clearEnableSchemaValidation() { + + enableSchemaValidation_ = false; + onChanged(); + return this; + } + + private int priority_ = 0; + /** + * + * + *
+     * The priority of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Override + public int getPriorityValue() { + return priority_; + } + /** + * + * + *
+     * The priority of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @param value The enum numeric value on the wire for priority to set. + * @return This builder for chaining. + */ + public Builder setPriorityValue(int value) { + + priority_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The priority of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The priority. + */ + @java.lang.Override + public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority getPriority() { + @SuppressWarnings("deprecation") + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority result = + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.valueOf(priority_); + return result == null + ? com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The priority of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority( + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority value) { + if (value == null) { + throw new NullPointerException(); + } + + priority_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The priority of the human review task.
+     * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return This builder for chaining. + */ + public Builder clearPriority() { + + priority_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java index a33ed11f..533595e7 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/ReviewDocumentRequestOrBuilder.java @@ -127,5 +127,43 @@ public interface ReviewDocumentRequestOrBuilder @java.lang.Deprecated com.google.cloud.documentai.v1beta3.DocumentOrBuilder getDocumentOrBuilder(); + /** + * + * + *
+   * Whether the validation should be performed on the ad-hoc review request.
+   * 
+ * + * bool enable_schema_validation = 3; + * + * @return The enableSchemaValidation. + */ + boolean getEnableSchemaValidation(); + + /** + * + * + *
+   * The priority of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The enum numeric value on the wire for priority. + */ + int getPriorityValue(); + /** + * + * + *
+   * The priority of the human review task.
+   * 
+ * + * .google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority priority = 5; + * + * @return The priority. + */ + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority getPriority(); + public com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.SourceCase getSourceCase(); } diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto index d461041f..abba3ae1 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto +++ b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document.proto @@ -324,6 +324,9 @@ message Document { // - "unfilled_checkbox" // - "filled_checkbox" string value_type = 5; + + // The history of this annotation. + Provenance provenance = 8; } // Detected language for a structural component. @@ -385,6 +388,9 @@ message Document { // A list of visually detected form fields on the page. repeated FormField form_fields = 11; + + // The history of this page. + Provenance provenance = 16; } // A phrase in the text that is a known entity type, such as a person, an @@ -536,6 +542,8 @@ message Document { // 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. @@ -568,8 +576,12 @@ message Document { // The index of the [Document.revisions] identifying the parent revision. int32 revision = 1; + // The index of the parent revisions corresponding collection of items + // (eg. list of entities, properties within entities, etc.) + int32 index = 3; + // The id of the parent provenance. - int32 id = 2; + int32 id = 2 [deprecated = true]; } // If a processor or agent does an explicit operation on existing elements. @@ -602,7 +614,7 @@ message Document { // The Id of this operation. Needs to be unique within the scope of the // revision. - int32 id = 2; + int32 id = 2 [deprecated = true]; // References to the original elements that are replaced. repeated Parent parents = 3; diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto index e0620e43..e76a0316 100644 --- a/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto +++ b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/document_processor_service.proto @@ -23,6 +23,8 @@ 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/operation_metadata.proto"; +import "google/cloud/documentai/v1beta3/processor.proto"; +import "google/cloud/documentai/v1beta3/processor_type.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -44,10 +46,6 @@ 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" @@ -84,6 +82,69 @@ service DocumentProcessorService { }; } + // Fetches processor types. + rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all processors which belong to this project. + rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { + option (google.api.http) = { + get: "/v1beta3/{parent=projects/*/locations/*}/processors" + }; + option (google.api.method_signature) = "parent"; + } + + // 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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{name=projects/*/locations/*/processors/*}:disable" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DisableProcessorResponse" + metadata_type: "DisableProcessorMetadata" + }; + } + // Send a document for Human Review. The input document should be processed by // the specified processor. rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { @@ -299,8 +360,146 @@ message BatchProcessMetadata { repeated IndividualProcessStatus individual_process_statuses = 5; } +// Request message for fetch processor types. +message FetchProcessorTypesRequest { + // Required. The project of processor type to list. + // 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 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 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. +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. +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 review document method. +// Next Id: 6. message ReviewDocumentRequest { + // The priority level of the human review task. + enum Priority { + // The default priority level. + DEFAULT = 0; + + // The urgent priority level. The labeling manager should allocate labeler + // resource to the urgent task queue to respect this priority level. + URGENT = 1; + } + // The document payload. oneof source { // An inline document proto. @@ -318,6 +517,12 @@ message ReviewDocumentRequest { // The document that needs human review. Document document = 2 [deprecated = true]; + + // Whether the validation should be performed on the ad-hoc review request. + bool enable_schema_validation = 3; + + // The priority of the human review task. + Priority priority = 5; } // Response message for review document method. diff --git a/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto new file mode 100644 index 00000000..61cd14a2 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor.proto @@ -0,0 +1,99 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// 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; + +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"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessor"; +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. +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. + 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. + CREATING = 5; + + // The processor failed during creation. + 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. + 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; + + // 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/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto new file mode 100644 index 00000000..4bd4c16a --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta3/src/main/proto/google/cloud/documentai/v1beta3/processor_type.proto @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// 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; + +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"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorType"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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. + string location_id = 1; + } + + // The resource name of the processor type. + string name = 1; + + // The type of the processor. + string type = 2; + + // The processor category. + 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. + bool allow_creation = 6; +}