diff --git a/java-document-ai/README.md b/java-document-ai/README.md index dcaed7b3f51f..f0878e1259fe 100644 --- a/java-document-ai/README.md +++ b/java-document-ai/README.md @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.24.0 + 26.25.0 pom import @@ -42,20 +42,20 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-document-ai - 2.31.0 + 2.32.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-document-ai:2.31.0' +implementation 'com.google.cloud:google-cloud-document-ai:2.32.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.31.0" +libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.32.0" ``` @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-document-ai.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-document-ai/2.31.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-document-ai/2.32.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java new file mode 100644 index 000000000000..a2caa1284b3d --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java @@ -0,0 +1,683 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1.stub.DocumentProcessorServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentProcessorServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of processDocument to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentProcessorServiceSettings.Builder documentProcessorServiceSettingsBuilder =
+ *     DocumentProcessorServiceSettings.newBuilder();
+ * documentProcessorServiceSettingsBuilder
+ *     .processDocumentSettings()
+ *     .setRetrySettings(
+ *         documentProcessorServiceSettingsBuilder
+ *             .processDocumentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentProcessorServiceSettings documentProcessorServiceSettings =
+ *     documentProcessorServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class DocumentProcessorServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to processDocument. */ + public UnaryCallSettings processDocumentSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).processDocumentSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings batchProcessDocumentsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings + batchProcessDocumentsOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + /** Returns the object with the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings + fetchProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).fetchProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorType. */ + public UnaryCallSettings getProcessorTypeSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorTypeSettings(); + } + + /** Returns the object with the settings used for calls to listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorsSettings(); + } + + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorSettings(); + } + + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings + trainProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .trainProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public OperationCallSettings< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .trainProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .listProcessorVersionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to createProcessor. */ + public UnaryCallSettings createProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).createProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public UnaryCallSettings deleteProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).deleteProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public OperationCallSettings + deleteProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public UnaryCallSettings enableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).enableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public OperationCallSettings< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .enableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public UnaryCallSettings disableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).disableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public OperationCallSettings< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .disableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to reviewDocument. */ + public UnaryCallSettings reviewDocumentSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).reviewDocumentSettings(); + } + + /** Returns the object with the settings used for calls to reviewDocument. */ + public OperationCallSettings< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .reviewDocumentOperationSettings(); + } + + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings + evaluateProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .evaluateProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public OperationCallSettings< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .evaluateProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getEvaluation. */ + public UnaryCallSettings getEvaluationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getEvaluationSettings(); + } + + /** Returns the object with the settings used for calls to listEvaluations. */ + public PagedCallSettings< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listEvaluationsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final DocumentProcessorServiceSettings create( + DocumentProcessorServiceStubSettings stub) throws IOException { + return new DocumentProcessorServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentProcessorServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentProcessorServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentProcessorServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentProcessorServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentProcessorServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentProcessorServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentProcessorServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentProcessorServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentProcessorServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentProcessorServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentProcessorServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentProcessorServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to processDocument. */ + public UnaryCallSettings.Builder processDocumentSettings() { + return getStubSettingsBuilder().processDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings.Builder< + BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings.Builder + fetchProcessorTypesSettings() { + return getStubSettingsBuilder().fetchProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return getStubSettingsBuilder().listProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorType. */ + public UnaryCallSettings.Builder + getProcessorTypeSettings() { + return getStubSettingsBuilder().getProcessorTypeSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return getStubSettingsBuilder().listProcessorsSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getStubSettingsBuilder().getProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings.Builder + trainProcessorVersionSettings() { + return getStubSettingsBuilder().trainProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + public OperationCallSettings.Builder< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return getStubSettingsBuilder().trainProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getStubSettingsBuilder().getProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return getStubSettingsBuilder().listProcessorVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return getStubSettingsBuilder().deleteProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deleteProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return getStubSettingsBuilder().deployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return getStubSettingsBuilder().undeployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().undeployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createProcessor. */ + public UnaryCallSettings.Builder createProcessorSettings() { + return getStubSettingsBuilder().createProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public UnaryCallSettings.Builder deleteProcessorSettings() { + return getStubSettingsBuilder().deleteProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public OperationCallSettings.Builder + deleteProcessorOperationSettings() { + return getStubSettingsBuilder().deleteProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public UnaryCallSettings.Builder enableProcessorSettings() { + return getStubSettingsBuilder().enableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public OperationCallSettings.Builder< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return getStubSettingsBuilder().enableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public UnaryCallSettings.Builder + disableProcessorSettings() { + return getStubSettingsBuilder().disableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public OperationCallSettings.Builder< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return getStubSettingsBuilder().disableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to reviewDocument. */ + public UnaryCallSettings.Builder reviewDocumentSettings() { + return getStubSettingsBuilder().reviewDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to reviewDocument. */ + public OperationCallSettings.Builder< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationSettings() { + return getStubSettingsBuilder().reviewDocumentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings.Builder + evaluateProcessorVersionSettings() { + return getStubSettingsBuilder().evaluateProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + public OperationCallSettings.Builder< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return getStubSettingsBuilder().evaluateProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getEvaluation. */ + public UnaryCallSettings.Builder getEvaluationSettings() { + return getStubSettingsBuilder().getEvaluationSettings(); + } + + /** Returns the builder for the settings used for calls to listEvaluations. */ + public PagedCallSettings.Builder< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return getStubSettingsBuilder().listEvaluationsSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public DocumentProcessorServiceSettings build() throws IOException { + return new DocumentProcessorServiceSettings(this); + } + } +} diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java new file mode 100644 index 000000000000..434df720028a --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java @@ -0,0 +1,1218 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.stub; + +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1.BatchProcessMetadata; +import com.google.cloud.documentai.v1.BatchProcessRequest; +import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetEvaluationRequest; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorTypeRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListEvaluationsRequest; +import com.google.cloud.documentai.v1.ListEvaluationsResponse; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; +import com.google.cloud.documentai.v1.ProcessRequest; +import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorType; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; +import com.google.cloud.documentai.v1.ReviewDocumentRequest; +import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.TrainProcessorVersionMetadata; +import com.google.cloud.documentai.v1.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentProcessorService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceStub { + private static final MethodDescriptor + processDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument") + .setRequestMarshaller(ProtoUtils.marshaller(ProcessRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments") + .setRequestMarshaller(ProtoUtils.marshaller(BatchProcessRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + fetchProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorType.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessors") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.documentai.v1.DocumentProcessorService/GetProcessor") + .setRequestMarshaller(ProtoUtils.marshaller(GetProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + trainProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(TrainProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + enableProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(EnableProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + disableProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor") + .setRequestMarshaller( + ProtoUtils.marshaller(DisableProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + reviewDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(ReviewDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + evaluateProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(EvaluateProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getEvaluationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEvaluationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Evaluation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listEvaluationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEvaluationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEvaluationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable processDocumentCallable; + private final UnaryCallable batchProcessDocumentsCallable; + private final OperationCallable + batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable getProcessorTypeCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + trainProcessorVersionCallable; + private final OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; + private final UnaryCallable reviewDocumentCallable; + private final OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable; + private final UnaryCallable + evaluateProcessorVersionCallable; + private final OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable; + private final UnaryCallable getEvaluationCallable; + private final UnaryCallable + listEvaluationsCallable; + private final UnaryCallable + listEvaluationsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentProcessorServiceStub create( + DocumentProcessorServiceStubSettings settings) throws IOException { + return new GrpcDocumentProcessorServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentProcessorServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentProcessorServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentProcessorServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentProcessorServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentProcessorServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings processDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + fetchProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getProcessorTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorTypeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + trainProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + undeployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings enableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings disableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + setDefaultProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("processor", String.valueOf(request.getProcessor())); + return builder.build(); + }) + .build(); + GrpcCallSettings reviewDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reviewDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "human_review_config", String.valueOf(request.getHumanReviewConfig())); + return builder.build(); + }) + .build(); + GrpcCallSettings + evaluateProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "processor_version", String.valueOf(request.getProcessorVersion())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEvaluationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), clientContext); + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + operationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.getProcessorTypeCallable = + callableFactory.createUnaryCallable( + getProcessorTypeTransportSettings, settings.getProcessorTypeSettings(), clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.trainProcessorVersionCallable = + callableFactory.createUnaryCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionSettings(), + clientContext); + this.trainProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + operationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + operationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + operationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.reviewDocumentCallable = + callableFactory.createUnaryCallable( + reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); + this.reviewDocumentOperationCallable = + callableFactory.createOperationCallable( + reviewDocumentTransportSettings, + settings.reviewDocumentOperationSettings(), + clientContext, + operationsStub); + this.evaluateProcessorVersionCallable = + callableFactory.createUnaryCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionSettings(), + clientContext); + this.evaluateProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.getEvaluationCallable = + callableFactory.createUnaryCallable( + getEvaluationTransportSettings, settings.getEvaluationSettings(), clientContext); + this.listEvaluationsCallable = + callableFactory.createUnaryCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable getProcessorTypeCallable() { + return getProcessorTypeCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable trainProcessorVersionCallable() { + return trainProcessorVersionCallable; + } + + @Override + public OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + return trainProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable reviewDocumentCallable() { + return reviewDocumentCallable; + } + + @Override + public OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable() { + return reviewDocumentOperationCallable; + } + + @Override + public UnaryCallable + evaluateProcessorVersionCallable() { + return evaluateProcessorVersionCallable; + } + + @Override + public OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + return evaluateProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getEvaluationCallable() { + return getEvaluationCallable; + } + + @Override + public UnaryCallable listEvaluationsCallable() { + return listEvaluationsCallable; + } + + @Override + public UnaryCallable + listEvaluationsPagedCallable() { + return listEvaluationsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java new file mode 100644 index 000000000000..4e26a06b5b71 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java @@ -0,0 +1,2017 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.stub; + +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1.BatchProcessMetadata; +import com.google.cloud.documentai.v1.BatchProcessRequest; +import com.google.cloud.documentai.v1.BatchProcessResponse; +import com.google.cloud.documentai.v1.CreateProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorRequest; +import com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1.DisableProcessorMetadata; +import com.google.cloud.documentai.v1.DisableProcessorRequest; +import com.google.cloud.documentai.v1.DisableProcessorResponse; +import com.google.cloud.documentai.v1.EnableProcessorMetadata; +import com.google.cloud.documentai.v1.EnableProcessorRequest; +import com.google.cloud.documentai.v1.EnableProcessorResponse; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1.GetEvaluationRequest; +import com.google.cloud.documentai.v1.GetProcessorRequest; +import com.google.cloud.documentai.v1.GetProcessorTypeRequest; +import com.google.cloud.documentai.v1.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1.ListEvaluationsRequest; +import com.google.cloud.documentai.v1.ListEvaluationsResponse; +import com.google.cloud.documentai.v1.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1.ListProcessorsRequest; +import com.google.cloud.documentai.v1.ListProcessorsResponse; +import com.google.cloud.documentai.v1.ProcessRequest; +import com.google.cloud.documentai.v1.ProcessResponse; +import com.google.cloud.documentai.v1.Processor; +import com.google.cloud.documentai.v1.ProcessorType; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata; +import com.google.cloud.documentai.v1.ReviewDocumentRequest; +import com.google.cloud.documentai.v1.ReviewDocumentResponse; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1.TrainProcessorVersionMetadata; +import com.google.cloud.documentai.v1.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; +import com.google.cloud.documentai.v1.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DocumentProcessorService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(UndeployProcessorVersionResponse.getDescriptor()) + .add(EnableProcessorResponse.getDescriptor()) + .add(SetDefaultProcessorVersionMetadata.getDescriptor()) + .add(EvaluateProcessorVersionResponse.getDescriptor()) + .add(EnableProcessorMetadata.getDescriptor()) + .add(ReviewDocumentOperationMetadata.getDescriptor()) + .add(SetDefaultProcessorVersionResponse.getDescriptor()) + .add(BatchProcessMetadata.getDescriptor()) + .add(DeleteProcessorMetadata.getDescriptor()) + .add(DeleteProcessorVersionMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(DeployProcessorVersionResponse.getDescriptor()) + .add(DisableProcessorResponse.getDescriptor()) + .add(BatchProcessResponse.getDescriptor()) + .add(TrainProcessorVersionResponse.getDescriptor()) + .add(ReviewDocumentResponse.getDescriptor()) + .add(EvaluateProcessorVersionMetadata.getDescriptor()) + .add(UndeployProcessorVersionMetadata.getDescriptor()) + .add(DeployProcessorVersionMetadata.getDescriptor()) + .add(DisableProcessorMetadata.getDescriptor()) + .add(TrainProcessorVersionMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + processDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:process", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + batchProcessDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchProcessRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + fetchProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processorTypes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorType.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessors") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.documentai.v1.DocumentProcessorService/GetProcessor") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + trainProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (TrainProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorVersion.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse> + listProcessorVersionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + undeployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UndeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("processor", request.getProcessor(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + enableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:enable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (EnableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + disableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*}:disable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DisableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "processor", request.getProcessor()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearProcessor().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SetDefaultProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + reviewDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{humanReviewConfig=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "humanReviewConfig", request.getHumanReviewConfig()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearHumanReviewConfig().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ReviewDocumentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + evaluateProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{processorVersion=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "processorVersion", request.getProcessorVersion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearProcessorVersion().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (EvaluateProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getEvaluationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Evaluation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listEvaluationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEvaluationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable processDocumentCallable; + private final UnaryCallable batchProcessDocumentsCallable; + private final OperationCallable + batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable getProcessorTypeCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + trainProcessorVersionCallable; + private final OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; + private final UnaryCallable reviewDocumentCallable; + private final OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable; + private final UnaryCallable + evaluateProcessorVersionCallable; + private final OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable; + private final UnaryCallable getEvaluationCallable; + private final UnaryCallable + listEvaluationsCallable; + private final UnaryCallable + listEvaluationsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentProcessorServiceStub create( + DocumentProcessorServiceStubSettings settings) throws IOException { + return new HttpJsonDocumentProcessorServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentProcessorServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentProcessorServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentProcessorServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonDocumentProcessorServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentProcessorServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/uiv1beta3/{name=projects/*/locations/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/uiv1beta3/{name=projects/*/locations/*/operations}") + .build()) + .build()) + .build()); + + HttpJsonCallSettings processDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings batchProcessDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + fetchProcessorTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getProcessorTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorTypeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + trainProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + undeployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings enableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings disableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + setDefaultProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("processor", String.valueOf(request.getProcessor())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings reviewDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reviewDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "human_review_config", String.valueOf(request.getHumanReviewConfig())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + evaluateProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "processor_version", String.valueOf(request.getProcessorVersion())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getEvaluationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listEvaluationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), clientContext); + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.getProcessorTypeCallable = + callableFactory.createUnaryCallable( + getProcessorTypeTransportSettings, settings.getProcessorTypeSettings(), clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.trainProcessorVersionCallable = + callableFactory.createUnaryCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionSettings(), + clientContext); + this.trainProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.reviewDocumentCallable = + callableFactory.createUnaryCallable( + reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); + this.reviewDocumentOperationCallable = + callableFactory.createOperationCallable( + reviewDocumentTransportSettings, + settings.reviewDocumentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.evaluateProcessorVersionCallable = + callableFactory.createUnaryCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionSettings(), + clientContext); + this.evaluateProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getEvaluationCallable = + callableFactory.createUnaryCallable( + getEvaluationTransportSettings, settings.getEvaluationSettings(), clientContext); + this.listEvaluationsCallable = + callableFactory.createUnaryCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(processDocumentMethodDescriptor); + methodDescriptors.add(batchProcessDocumentsMethodDescriptor); + methodDescriptors.add(fetchProcessorTypesMethodDescriptor); + methodDescriptors.add(listProcessorTypesMethodDescriptor); + methodDescriptors.add(getProcessorTypeMethodDescriptor); + methodDescriptors.add(listProcessorsMethodDescriptor); + methodDescriptors.add(getProcessorMethodDescriptor); + methodDescriptors.add(trainProcessorVersionMethodDescriptor); + methodDescriptors.add(getProcessorVersionMethodDescriptor); + methodDescriptors.add(listProcessorVersionsMethodDescriptor); + methodDescriptors.add(deleteProcessorVersionMethodDescriptor); + methodDescriptors.add(deployProcessorVersionMethodDescriptor); + methodDescriptors.add(undeployProcessorVersionMethodDescriptor); + methodDescriptors.add(createProcessorMethodDescriptor); + methodDescriptors.add(deleteProcessorMethodDescriptor); + methodDescriptors.add(enableProcessorMethodDescriptor); + methodDescriptors.add(disableProcessorMethodDescriptor); + methodDescriptors.add(setDefaultProcessorVersionMethodDescriptor); + methodDescriptors.add(reviewDocumentMethodDescriptor); + methodDescriptors.add(evaluateProcessorVersionMethodDescriptor); + methodDescriptors.add(getEvaluationMethodDescriptor); + methodDescriptors.add(listEvaluationsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable getProcessorTypeCallable() { + return getProcessorTypeCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable trainProcessorVersionCallable() { + return trainProcessorVersionCallable; + } + + @Override + public OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + return trainProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable reviewDocumentCallable() { + return reviewDocumentCallable; + } + + @Override + public OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable() { + return reviewDocumentOperationCallable; + } + + @Override + public UnaryCallable + evaluateProcessorVersionCallable() { + return evaluateProcessorVersionCallable; + } + + @Override + public OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + return evaluateProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getEvaluationCallable() { + return getEvaluationCallable; + } + + @Override + public UnaryCallable listEvaluationsCallable() { + return listEvaluationsCallable; + } + + @Override + public UnaryCallable + listEvaluationsPagedCallable() { + return listEvaluationsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java new file mode 100644 index 000000000000..46dc8036bde4 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java @@ -0,0 +1,210 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1beta1.stub.DocumentUnderstandingServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentUnderstandingServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (documentai.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of batchProcessDocuments to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .batchProcessDocumentsSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder
+ *             .batchProcessDocumentsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     documentUnderstandingServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentUnderstandingServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + public static final DocumentUnderstandingServiceSettings create( + DocumentUnderstandingServiceStubSettings stub) throws IOException { + return new DocumentUnderstandingServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentUnderstandingServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentUnderstandingServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentUnderstandingServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentUnderstandingServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentUnderstandingServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentUnderstandingServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentUnderstandingServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentUnderstandingServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder()); + } + + public DocumentUnderstandingServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentUnderstandingServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + @Override + public DocumentUnderstandingServiceSettings build() throws IOException { + return new DocumentUnderstandingServiceSettings(this); + } + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/gapic_metadata.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/gapic_metadata.json rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/gapic_metadata.json diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java new file mode 100644 index 000000000000..89cf77ad154e --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta1.OperationMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentUnderstandingService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDocumentUnderstandingServiceStub extends DocumentUnderstandingServiceStub { + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta1.DocumentUnderstandingService/BatchProcessDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchProcessDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable + batchProcessDocumentsCallable; + private final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentUnderstandingServiceStub create( + DocumentUnderstandingServiceStubSettings settings) throws IOException { + return new GrpcDocumentUnderstandingServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentUnderstandingServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentUnderstandingServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentUnderstandingServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java new file mode 100644 index 000000000000..f221324cf7f9 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java @@ -0,0 +1,250 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta2; + +import static com.google.cloud.documentai.v1beta2.DocumentUnderstandingServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +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.v1beta2.stub.DocumentUnderstandingServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentUnderstandingServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (documentai.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of processDocument to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .processDocumentSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder
+ *             .processDocumentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     documentUnderstandingServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentUnderstandingServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + /** Returns the object with the settings used for calls to processDocument. */ + public UnaryCallSettings processDocumentSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()).processDocumentSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final DocumentUnderstandingServiceSettings create( + DocumentUnderstandingServiceStubSettings stub) throws IOException { + return new DocumentUnderstandingServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentUnderstandingServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentUnderstandingServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentUnderstandingServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentUnderstandingServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentUnderstandingServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentUnderstandingServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentUnderstandingServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentUnderstandingServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder()); + } + + public DocumentUnderstandingServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentUnderstandingServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to processDocument. */ + public UnaryCallSettings.Builder processDocumentSettings() { + return getStubSettingsBuilder().processDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public DocumentUnderstandingServiceSettings build() throws IOException { + return new DocumentUnderstandingServiceSettings(this); + } + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/gapic_metadata.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/gapic_metadata.json rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/gapic_metadata.json diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java new file mode 100644 index 000000000000..99f5bec9f706 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java @@ -0,0 +1,297 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta2.stub; + +import static com.google.cloud.documentai.v1beta2.DocumentUnderstandingServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta2.Document; +import com.google.cloud.documentai.v1beta2.OperationMetadata; +import com.google.cloud.documentai.v1beta2.ProcessDocumentRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentUnderstandingService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDocumentUnderstandingServiceStub extends DocumentUnderstandingServiceStub { + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta2.DocumentUnderstandingService/BatchProcessDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchProcessDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + processDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta2.DocumentUnderstandingService/ProcessDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(ProcessDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable + batchProcessDocumentsCallable; + private final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable; + private final UnaryCallable processDocumentCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentUnderstandingServiceStub create( + DocumentUnderstandingServiceStubSettings settings) throws IOException { + return new GrpcDocumentUnderstandingServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentUnderstandingServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentUnderstandingServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentUnderstandingServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings processDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + operationsStub); + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java new file mode 100644 index 000000000000..be07474666cf --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceSettings.java @@ -0,0 +1,716 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DocumentProcessorServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (documentai.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of processDocument to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentProcessorServiceSettings.Builder documentProcessorServiceSettingsBuilder =
+ *     DocumentProcessorServiceSettings.newBuilder();
+ * documentProcessorServiceSettingsBuilder
+ *     .processDocumentSettings()
+ *     .setRetrySettings(
+ *         documentProcessorServiceSettingsBuilder
+ *             .processDocumentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentProcessorServiceSettings documentProcessorServiceSettings =
+ *     documentProcessorServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentProcessorServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to processDocument. */ + public UnaryCallSettings processDocumentSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).processDocumentSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings batchProcessDocumentsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings + batchProcessDocumentsOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + /** Returns the object with the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings + fetchProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).fetchProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorTypes. */ + public PagedCallSettings< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorTypesSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorType. */ + public UnaryCallSettings getProcessorTypeSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorTypeSettings(); + } + + /** Returns the object with the settings used for calls to listProcessors. */ + public PagedCallSettings< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorsSettings(); + } + + /** Returns the object with the settings used for calls to getProcessor. */ + public UnaryCallSettings getProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorSettings(); + } + + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings + trainProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .trainProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public OperationCallSettings< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .trainProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings + getProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to listProcessorVersions. */ + public PagedCallSettings< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .listProcessorVersionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings + deleteProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings + deleteProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings + deployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings + undeployProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .undeployProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to createProcessor. */ + public UnaryCallSettings createProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).createProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public UnaryCallSettings deleteProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).deleteProcessorSettings(); + } + + /** Returns the object with the settings used for calls to deleteProcessor. */ + public OperationCallSettings + deleteProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .deleteProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public UnaryCallSettings enableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).enableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to enableProcessor. */ + public OperationCallSettings< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .enableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public UnaryCallSettings disableProcessorSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).disableProcessorSettings(); + } + + /** Returns the object with the settings used for calls to disableProcessor. */ + public OperationCallSettings< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .disableProcessorOperationSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings + setDefaultProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .setDefaultProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to reviewDocument. */ + public UnaryCallSettings reviewDocumentSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).reviewDocumentSettings(); + } + + /** Returns the object with the settings used for calls to reviewDocument. */ + public OperationCallSettings< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .reviewDocumentOperationSettings(); + } + + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings + evaluateProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .evaluateProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public OperationCallSettings< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .evaluateProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getEvaluation. */ + public UnaryCallSettings getEvaluationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getEvaluationSettings(); + } + + /** Returns the object with the settings used for calls to listEvaluations. */ + public PagedCallSettings< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listEvaluationsSettings(); + } + + /** Returns the object with the settings used for calls to importProcessorVersion. */ + public UnaryCallSettings + importProcessorVersionSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .importProcessorVersionSettings(); + } + + /** Returns the object with the settings used for calls to importProcessorVersion. */ + public OperationCallSettings< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()) + .importProcessorVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DocumentProcessorServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final DocumentProcessorServiceSettings create( + DocumentProcessorServiceStubSettings stub) throws IOException { + return new DocumentProcessorServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentProcessorServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentProcessorServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentProcessorServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentProcessorServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentProcessorServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentProcessorServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentProcessorServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentProcessorServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentProcessorServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentProcessorServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentProcessorServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentProcessorServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentProcessorServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to processDocument. */ + public UnaryCallSettings.Builder processDocumentSettings() { + return getStubSettingsBuilder().processDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + public OperationCallSettings.Builder< + BatchProcessRequest, BatchProcessResponse, BatchProcessMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to fetchProcessorTypes. */ + public UnaryCallSettings.Builder + fetchProcessorTypesSettings() { + return getStubSettingsBuilder().fetchProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorTypes. */ + public PagedCallSettings.Builder< + ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse> + listProcessorTypesSettings() { + return getStubSettingsBuilder().listProcessorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorType. */ + public UnaryCallSettings.Builder + getProcessorTypeSettings() { + return getStubSettingsBuilder().getProcessorTypeSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessors. */ + public PagedCallSettings.Builder< + ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> + listProcessorsSettings() { + return getStubSettingsBuilder().listProcessorsSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessor. */ + public UnaryCallSettings.Builder getProcessorSettings() { + return getStubSettingsBuilder().getProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings.Builder + trainProcessorVersionSettings() { + return getStubSettingsBuilder().trainProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + public OperationCallSettings.Builder< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return getStubSettingsBuilder().trainProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getProcessorVersion. */ + public UnaryCallSettings.Builder + getProcessorVersionSettings() { + return getStubSettingsBuilder().getProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listProcessorVersions. */ + public PagedCallSettings.Builder< + ListProcessorVersionsRequest, + ListProcessorVersionsResponse, + ListProcessorVersionsPagedResponse> + listProcessorVersionsSettings() { + return getStubSettingsBuilder().listProcessorVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public UnaryCallSettings.Builder + deleteProcessorVersionSettings() { + return getStubSettingsBuilder().deleteProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessorVersion. */ + public OperationCallSettings.Builder< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deleteProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public UnaryCallSettings.Builder + deployProcessorVersionSettings() { + return getStubSettingsBuilder().deployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deployProcessorVersion. */ + public OperationCallSettings.Builder< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().deployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public UnaryCallSettings.Builder + undeployProcessorVersionSettings() { + return getStubSettingsBuilder().undeployProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to undeployProcessorVersion. */ + public OperationCallSettings.Builder< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationSettings() { + return getStubSettingsBuilder().undeployProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createProcessor. */ + public UnaryCallSettings.Builder createProcessorSettings() { + return getStubSettingsBuilder().createProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public UnaryCallSettings.Builder deleteProcessorSettings() { + return getStubSettingsBuilder().deleteProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProcessor. */ + public OperationCallSettings.Builder + deleteProcessorOperationSettings() { + return getStubSettingsBuilder().deleteProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public UnaryCallSettings.Builder enableProcessorSettings() { + return getStubSettingsBuilder().enableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to enableProcessor. */ + public OperationCallSettings.Builder< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationSettings() { + return getStubSettingsBuilder().enableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public UnaryCallSettings.Builder + disableProcessorSettings() { + return getStubSettingsBuilder().disableProcessorSettings(); + } + + /** Returns the builder for the settings used for calls to disableProcessor. */ + public OperationCallSettings.Builder< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationSettings() { + return getStubSettingsBuilder().disableProcessorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public UnaryCallSettings.Builder + setDefaultProcessorVersionSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultProcessorVersion. */ + public OperationCallSettings.Builder< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationSettings() { + return getStubSettingsBuilder().setDefaultProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to reviewDocument. */ + public UnaryCallSettings.Builder reviewDocumentSettings() { + return getStubSettingsBuilder().reviewDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to reviewDocument. */ + public OperationCallSettings.Builder< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationSettings() { + return getStubSettingsBuilder().reviewDocumentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings.Builder + evaluateProcessorVersionSettings() { + return getStubSettingsBuilder().evaluateProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + public OperationCallSettings.Builder< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return getStubSettingsBuilder().evaluateProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getEvaluation. */ + public UnaryCallSettings.Builder getEvaluationSettings() { + return getStubSettingsBuilder().getEvaluationSettings(); + } + + /** Returns the builder for the settings used for calls to listEvaluations. */ + public PagedCallSettings.Builder< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return getStubSettingsBuilder().listEvaluationsSettings(); + } + + /** Returns the builder for the settings used for calls to importProcessorVersion. */ + public UnaryCallSettings.Builder + importProcessorVersionSettings() { + return getStubSettingsBuilder().importProcessorVersionSettings(); + } + + /** Returns the builder for the settings used for calls to importProcessorVersion. */ + public OperationCallSettings.Builder< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationSettings() { + return getStubSettingsBuilder().importProcessorVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public DocumentProcessorServiceSettings build() throws IOException { + return new DocumentProcessorServiceSettings(this); + } + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceClient.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceClient.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceClient.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java similarity index 99% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java index 875ad28d9859..35d91c1ac867 100644 --- a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceSettings.java @@ -30,7 +30,6 @@ 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.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.documentai.v1beta3.stub.DocumentServiceStubSettings; diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/gapic_metadata.json diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStub.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentProcessorServiceStubSettings.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStub.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStub.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStubSettings.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStubSettings.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/DocumentServiceStubSettings.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java new file mode 100644 index 000000000000..cf7124eba0a4 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentProcessorServiceStub.java @@ -0,0 +1,1278 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.stub; + +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +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.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; +import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; +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.EvaluateProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.Evaluation; +import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetEvaluationRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.ListEvaluationsRequest; +import com.google.cloud.documentai.v1beta3.ListEvaluationsResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; +import com.google.cloud.documentai.v1beta3.ProcessRequest; +import com.google.cloud.documentai.v1beta3.ProcessResponse; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorType; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; +import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; +import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DocumentProcessorService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceStub { + private static final MethodDescriptor + processDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument") + .setRequestMarshaller(ProtoUtils.marshaller(ProcessRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments") + .setRequestMarshaller(ProtoUtils.marshaller(BatchProcessRequest.getDefaultInstance())) + .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 + listProcessorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorType.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 + getProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessor") + .setRequestMarshaller(ProtoUtils.marshaller(GetProcessorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Processor.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + trainProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/TrainProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(TrainProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ProcessorVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProcessorVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProcessorVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeployProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/UndeployProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createProcessorMethodDescriptor = + MethodDescriptor.newBuilder() + .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 + setDefaultProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/SetDefaultProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + reviewDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(ReviewDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + evaluateProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/EvaluateProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(EvaluateProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getEvaluationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetEvaluation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEvaluationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Evaluation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listEvaluationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListEvaluations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEvaluationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEvaluationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importProcessorVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ImportProcessorVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProcessorVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable processDocumentCallable; + private final UnaryCallable batchProcessDocumentsCallable; + private final OperationCallable + batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable getProcessorTypeCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + trainProcessorVersionCallable; + private final OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; + private final UnaryCallable reviewDocumentCallable; + private final OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable; + private final UnaryCallable + evaluateProcessorVersionCallable; + private final OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable; + private final UnaryCallable getEvaluationCallable; + private final UnaryCallable + listEvaluationsCallable; + private final UnaryCallable + listEvaluationsPagedCallable; + private final UnaryCallable + importProcessorVersionCallable; + private final OperationCallable< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentProcessorServiceStub create( + DocumentProcessorServiceStubSettings settings) throws IOException { + return new GrpcDocumentProcessorServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentProcessorServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentProcessorServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentProcessorServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentProcessorServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentProcessorServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings processDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + fetchProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getProcessorTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorTypeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + trainProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listProcessorVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + undeployProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings enableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings disableProcessorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + setDefaultProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("processor", String.valueOf(request.getProcessor())); + return builder.build(); + }) + .build(); + GrpcCallSettings reviewDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reviewDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "human_review_config", String.valueOf(request.getHumanReviewConfig())); + return builder.build(); + }) + .build(); + GrpcCallSettings + evaluateProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "processor_version", String.valueOf(request.getProcessorVersion())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEvaluationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + importProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), clientContext); + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + operationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.getProcessorTypeCallable = + callableFactory.createUnaryCallable( + getProcessorTypeTransportSettings, settings.getProcessorTypeSettings(), clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.trainProcessorVersionCallable = + callableFactory.createUnaryCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionSettings(), + clientContext); + this.trainProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + operationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + operationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + operationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.reviewDocumentCallable = + callableFactory.createUnaryCallable( + reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); + this.reviewDocumentOperationCallable = + callableFactory.createOperationCallable( + reviewDocumentTransportSettings, + settings.reviewDocumentOperationSettings(), + clientContext, + operationsStub); + this.evaluateProcessorVersionCallable = + callableFactory.createUnaryCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionSettings(), + clientContext); + this.evaluateProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.getEvaluationCallable = + callableFactory.createUnaryCallable( + getEvaluationTransportSettings, settings.getEvaluationSettings(), clientContext); + this.listEvaluationsCallable = + callableFactory.createUnaryCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.importProcessorVersionCallable = + callableFactory.createUnaryCallable( + importProcessorVersionTransportSettings, + settings.importProcessorVersionSettings(), + clientContext); + this.importProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + importProcessorVersionTransportSettings, + settings.importProcessorVersionOperationSettings(), + clientContext, + operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable getProcessorTypeCallable() { + return getProcessorTypeCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable trainProcessorVersionCallable() { + return trainProcessorVersionCallable; + } + + @Override + public OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + return trainProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable reviewDocumentCallable() { + return reviewDocumentCallable; + } + + @Override + public OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable() { + return reviewDocumentOperationCallable; + } + + @Override + public UnaryCallable + evaluateProcessorVersionCallable() { + return evaluateProcessorVersionCallable; + } + + @Override + public OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + return evaluateProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getEvaluationCallable() { + return getEvaluationCallable; + } + + @Override + public UnaryCallable listEvaluationsCallable() { + return listEvaluationsCallable; + } + + @Override + public UnaryCallable + listEvaluationsPagedCallable() { + return listEvaluationsPagedCallable; + } + + @Override + public UnaryCallable importProcessorVersionCallable() { + return importProcessorVersionCallable; + } + + @Override + public OperationCallable< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationCallable() { + return importProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceCallableFactory.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java similarity index 99% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java index 598e63528430..c9054c2bc5f3 100644 --- a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/GrpcDocumentServiceStub.java @@ -53,7 +53,6 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceCallableFactory.java diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java new file mode 100644 index 000000000000..36fc66ad5807 --- /dev/null +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentProcessorServiceStub.java @@ -0,0 +1,2105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.stub; + +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListEvaluationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorTypesPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorVersionsPagedResponse; +import static com.google.cloud.documentai.v1beta3.DocumentProcessorServiceClient.ListProcessorsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +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.DeleteProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.DisableProcessorMetadata; +import com.google.cloud.documentai.v1beta3.DisableProcessorRequest; +import com.google.cloud.documentai.v1beta3.DisableProcessorResponse; +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.EvaluateProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.Evaluation; +import com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.GetEvaluationRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest; +import com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.ListEvaluationsRequest; +import com.google.cloud.documentai.v1beta3.ListEvaluationsResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; +import com.google.cloud.documentai.v1beta3.ListProcessorsRequest; +import com.google.cloud.documentai.v1beta3.ListProcessorsResponse; +import com.google.cloud.documentai.v1beta3.ProcessRequest; +import com.google.cloud.documentai.v1beta3.ProcessResponse; +import com.google.cloud.documentai.v1beta3.Processor; +import com.google.cloud.documentai.v1beta3.ProcessorType; +import com.google.cloud.documentai.v1beta3.ProcessorVersion; +import com.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; +import com.google.cloud.documentai.v1beta3.ReviewDocumentRequest; +import com.google.cloud.documentai.v1beta3.ReviewDocumentResponse; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; +import com.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DocumentProcessorService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(DisableProcessorMetadata.getDescriptor()) + .add(DeployProcessorVersionMetadata.getDescriptor()) + .add(EnableProcessorMetadata.getDescriptor()) + .add(SetDefaultProcessorVersionMetadata.getDescriptor()) + .add(DeployProcessorVersionResponse.getDescriptor()) + .add(BatchProcessResponse.getDescriptor()) + .add(UndeployProcessorVersionResponse.getDescriptor()) + .add(DisableProcessorResponse.getDescriptor()) + .add(ReviewDocumentOperationMetadata.getDescriptor()) + .add(EvaluateProcessorVersionResponse.getDescriptor()) + .add(EvaluateProcessorVersionMetadata.getDescriptor()) + .add(TrainProcessorVersionMetadata.getDescriptor()) + .add(ImportProcessorVersionMetadata.getDescriptor()) + .add(BatchProcessMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(UndeployProcessorVersionMetadata.getDescriptor()) + .add(DeleteProcessorMetadata.getDescriptor()) + .add(ReviewDocumentResponse.getDescriptor()) + .add(EnableProcessorResponse.getDescriptor()) + .add(TrainProcessorVersionResponse.getDescriptor()) + .add(ImportProcessorVersionResponse.getDescriptor()) + .add(DeleteProcessorVersionMetadata.getDescriptor()) + .add(SetDefaultProcessorVersionResponse.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + processDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}:process", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + batchProcessDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchProcessRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + fetchProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/FetchProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*}/processorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorType") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processorTypes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorType.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProcessorsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessors") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessor") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + trainProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/TrainProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (TrainProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ProcessorVersion.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListProcessorVersionsRequest, ListProcessorVersionsResponse> + listProcessorVersionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProcessorVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessorVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + undeployProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/UndeployProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UndeployProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/CreateProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*}/processors", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("processor", request.getProcessor(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Processor.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessor") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + enableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/EnableProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}:enable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (EnableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + disableProcessorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/DisableProcessor") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*}:disable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DisableProcessorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + setDefaultProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/SetDefaultProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "processor", request.getProcessor()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearProcessor().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SetDefaultProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + reviewDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{humanReviewConfig=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "humanReviewConfig", request.getHumanReviewConfig()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearHumanReviewConfig().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ReviewDocumentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + evaluateProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/EvaluateProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{processorVersion=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "processorVersion", request.getProcessorVersion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearProcessorVersion().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (EvaluateProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getEvaluationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/GetEvaluation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Evaluation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listEvaluationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ListEvaluations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEvaluationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + importProcessorVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.documentai.v1beta3.DocumentProcessorService/ImportProcessorVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ImportProcessorVersionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta3/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/uiv1beta3/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable processDocumentCallable; + private final UnaryCallable batchProcessDocumentsCallable; + private final OperationCallable + batchProcessDocumentsOperationCallable; + private final UnaryCallable + fetchProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesCallable; + private final UnaryCallable + listProcessorTypesPagedCallable; + private final UnaryCallable getProcessorTypeCallable; + private final UnaryCallable listProcessorsCallable; + private final UnaryCallable + listProcessorsPagedCallable; + private final UnaryCallable getProcessorCallable; + private final UnaryCallable + trainProcessorVersionCallable; + private final OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable; + private final UnaryCallable + getProcessorVersionCallable; + private final UnaryCallable + listProcessorVersionsCallable; + private final UnaryCallable + listProcessorVersionsPagedCallable; + private final UnaryCallable + deleteProcessorVersionCallable; + private final OperationCallable< + DeleteProcessorVersionRequest, Empty, DeleteProcessorVersionMetadata> + deleteProcessorVersionOperationCallable; + private final UnaryCallable + deployProcessorVersionCallable; + private final OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable; + private final UnaryCallable + undeployProcessorVersionCallable; + private final OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable; + private final UnaryCallable createProcessorCallable; + private final UnaryCallable deleteProcessorCallable; + private final OperationCallable + deleteProcessorOperationCallable; + private final UnaryCallable enableProcessorCallable; + private final OperationCallable< + EnableProcessorRequest, EnableProcessorResponse, EnableProcessorMetadata> + enableProcessorOperationCallable; + private final UnaryCallable disableProcessorCallable; + private final OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable; + private final UnaryCallable + setDefaultProcessorVersionCallable; + private final OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable; + private final UnaryCallable reviewDocumentCallable; + private final OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable; + private final UnaryCallable + evaluateProcessorVersionCallable; + private final OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable; + private final UnaryCallable getEvaluationCallable; + private final UnaryCallable + listEvaluationsCallable; + private final UnaryCallable + listEvaluationsPagedCallable; + private final UnaryCallable + importProcessorVersionCallable; + private final OperationCallable< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentProcessorServiceStub create( + DocumentProcessorServiceStubSettings settings) throws IOException { + return new HttpJsonDocumentProcessorServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentProcessorServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentProcessorServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentProcessorServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonDocumentProcessorServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentProcessorServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonDocumentProcessorServiceStub( + DocumentProcessorServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta3/{name=projects/*/locations/*/operations/*}:cancel") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta3/{name=projects/*/locations/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/uiv1beta3/{name=projects/*/locations/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta3/{name=projects/*/locations/*/operations}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/uiv1beta3/{name=projects/*/locations/*/operations}") + .build()) + .build()) + .build()); + + HttpJsonCallSettings processDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings batchProcessDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + fetchProcessorTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(fetchProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getProcessorTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorTypeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProcessorsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + trainProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listProcessorVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listProcessorVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + undeployProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeployProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings enableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings disableProcessorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableProcessorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + setDefaultProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDefaultProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("processor", String.valueOf(request.getProcessor())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings reviewDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reviewDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "human_review_config", String.valueOf(request.getHumanReviewConfig())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + evaluateProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "processor_version", String.valueOf(request.getProcessorVersion())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getEvaluationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listEvaluationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + importProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(importProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), clientContext); + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.fetchProcessorTypesCallable = + callableFactory.createUnaryCallable( + fetchProcessorTypesTransportSettings, + settings.fetchProcessorTypesSettings(), + clientContext); + this.listProcessorTypesCallable = + callableFactory.createUnaryCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.listProcessorTypesPagedCallable = + callableFactory.createPagedCallable( + listProcessorTypesTransportSettings, + settings.listProcessorTypesSettings(), + clientContext); + this.getProcessorTypeCallable = + callableFactory.createUnaryCallable( + getProcessorTypeTransportSettings, settings.getProcessorTypeSettings(), clientContext); + this.listProcessorsCallable = + callableFactory.createUnaryCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.listProcessorsPagedCallable = + callableFactory.createPagedCallable( + listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext); + this.getProcessorCallable = + callableFactory.createUnaryCallable( + getProcessorTransportSettings, settings.getProcessorSettings(), clientContext); + this.trainProcessorVersionCallable = + callableFactory.createUnaryCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionSettings(), + clientContext); + this.trainProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + trainProcessorVersionTransportSettings, + settings.trainProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getProcessorVersionCallable = + callableFactory.createUnaryCallable( + getProcessorVersionTransportSettings, + settings.getProcessorVersionSettings(), + clientContext); + this.listProcessorVersionsCallable = + callableFactory.createUnaryCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.listProcessorVersionsPagedCallable = + callableFactory.createPagedCallable( + listProcessorVersionsTransportSettings, + settings.listProcessorVersionsSettings(), + clientContext); + this.deleteProcessorVersionCallable = + callableFactory.createUnaryCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionSettings(), + clientContext); + this.deleteProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorVersionTransportSettings, + settings.deleteProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deployProcessorVersionCallable = + callableFactory.createUnaryCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionSettings(), + clientContext); + this.deployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + deployProcessorVersionTransportSettings, + settings.deployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.undeployProcessorVersionCallable = + callableFactory.createUnaryCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionSettings(), + clientContext); + this.undeployProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + undeployProcessorVersionTransportSettings, + settings.undeployProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createProcessorCallable = + callableFactory.createUnaryCallable( + createProcessorTransportSettings, settings.createProcessorSettings(), clientContext); + this.deleteProcessorCallable = + callableFactory.createUnaryCallable( + deleteProcessorTransportSettings, settings.deleteProcessorSettings(), clientContext); + this.deleteProcessorOperationCallable = + callableFactory.createOperationCallable( + deleteProcessorTransportSettings, + settings.deleteProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.enableProcessorCallable = + callableFactory.createUnaryCallable( + enableProcessorTransportSettings, settings.enableProcessorSettings(), clientContext); + this.enableProcessorOperationCallable = + callableFactory.createOperationCallable( + enableProcessorTransportSettings, + settings.enableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.disableProcessorCallable = + callableFactory.createUnaryCallable( + disableProcessorTransportSettings, settings.disableProcessorSettings(), clientContext); + this.disableProcessorOperationCallable = + callableFactory.createOperationCallable( + disableProcessorTransportSettings, + settings.disableProcessorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.setDefaultProcessorVersionCallable = + callableFactory.createUnaryCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionSettings(), + clientContext); + this.setDefaultProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + setDefaultProcessorVersionTransportSettings, + settings.setDefaultProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.reviewDocumentCallable = + callableFactory.createUnaryCallable( + reviewDocumentTransportSettings, settings.reviewDocumentSettings(), clientContext); + this.reviewDocumentOperationCallable = + callableFactory.createOperationCallable( + reviewDocumentTransportSettings, + settings.reviewDocumentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.evaluateProcessorVersionCallable = + callableFactory.createUnaryCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionSettings(), + clientContext); + this.evaluateProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + evaluateProcessorVersionTransportSettings, + settings.evaluateProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getEvaluationCallable = + callableFactory.createUnaryCallable( + getEvaluationTransportSettings, settings.getEvaluationSettings(), clientContext); + this.listEvaluationsCallable = + callableFactory.createUnaryCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.listEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listEvaluationsTransportSettings, settings.listEvaluationsSettings(), clientContext); + this.importProcessorVersionCallable = + callableFactory.createUnaryCallable( + importProcessorVersionTransportSettings, + settings.importProcessorVersionSettings(), + clientContext); + this.importProcessorVersionOperationCallable = + callableFactory.createOperationCallable( + importProcessorVersionTransportSettings, + settings.importProcessorVersionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(processDocumentMethodDescriptor); + methodDescriptors.add(batchProcessDocumentsMethodDescriptor); + methodDescriptors.add(fetchProcessorTypesMethodDescriptor); + methodDescriptors.add(listProcessorTypesMethodDescriptor); + methodDescriptors.add(getProcessorTypeMethodDescriptor); + methodDescriptors.add(listProcessorsMethodDescriptor); + methodDescriptors.add(getProcessorMethodDescriptor); + methodDescriptors.add(trainProcessorVersionMethodDescriptor); + methodDescriptors.add(getProcessorVersionMethodDescriptor); + methodDescriptors.add(listProcessorVersionsMethodDescriptor); + methodDescriptors.add(deleteProcessorVersionMethodDescriptor); + methodDescriptors.add(deployProcessorVersionMethodDescriptor); + methodDescriptors.add(undeployProcessorVersionMethodDescriptor); + methodDescriptors.add(createProcessorMethodDescriptor); + methodDescriptors.add(deleteProcessorMethodDescriptor); + methodDescriptors.add(enableProcessorMethodDescriptor); + methodDescriptors.add(disableProcessorMethodDescriptor); + methodDescriptors.add(setDefaultProcessorVersionMethodDescriptor); + methodDescriptors.add(reviewDocumentMethodDescriptor); + methodDescriptors.add(evaluateProcessorVersionMethodDescriptor); + methodDescriptors.add(getEvaluationMethodDescriptor); + methodDescriptors.add(listEvaluationsMethodDescriptor); + methodDescriptors.add(importProcessorVersionMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @Override + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @Override + public OperationCallable + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + @Override + public UnaryCallable + fetchProcessorTypesCallable() { + return fetchProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesCallable() { + return listProcessorTypesCallable; + } + + @Override + public UnaryCallable + listProcessorTypesPagedCallable() { + return listProcessorTypesPagedCallable; + } + + @Override + public UnaryCallable getProcessorTypeCallable() { + return getProcessorTypeCallable; + } + + @Override + public UnaryCallable listProcessorsCallable() { + return listProcessorsCallable; + } + + @Override + public UnaryCallable + listProcessorsPagedCallable() { + return listProcessorsPagedCallable; + } + + @Override + public UnaryCallable getProcessorCallable() { + return getProcessorCallable; + } + + @Override + public UnaryCallable trainProcessorVersionCallable() { + return trainProcessorVersionCallable; + } + + @Override + public OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + return trainProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getProcessorVersionCallable() { + return getProcessorVersionCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsCallable() { + return listProcessorVersionsCallable; + } + + @Override + public UnaryCallable + listProcessorVersionsPagedCallable() { + return listProcessorVersionsPagedCallable; + } + + @Override + public UnaryCallable deleteProcessorVersionCallable() { + return deleteProcessorVersionCallable; + } + + @Override + public OperationCallable + deleteProcessorVersionOperationCallable() { + return deleteProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable deployProcessorVersionCallable() { + return deployProcessorVersionCallable; + } + + @Override + public OperationCallable< + DeployProcessorVersionRequest, + DeployProcessorVersionResponse, + DeployProcessorVersionMetadata> + deployProcessorVersionOperationCallable() { + return deployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable + undeployProcessorVersionCallable() { + return undeployProcessorVersionCallable; + } + + @Override + public OperationCallable< + UndeployProcessorVersionRequest, + UndeployProcessorVersionResponse, + UndeployProcessorVersionMetadata> + undeployProcessorVersionOperationCallable() { + return undeployProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable createProcessorCallable() { + return createProcessorCallable; + } + + @Override + public UnaryCallable deleteProcessorCallable() { + return deleteProcessorCallable; + } + + @Override + public OperationCallable + deleteProcessorOperationCallable() { + return deleteProcessorOperationCallable; + } + + @Override + public UnaryCallable enableProcessorCallable() { + return enableProcessorCallable; + } + + @Override + public OperationCallable + enableProcessorOperationCallable() { + return enableProcessorOperationCallable; + } + + @Override + public UnaryCallable disableProcessorCallable() { + return disableProcessorCallable; + } + + @Override + public OperationCallable< + DisableProcessorRequest, DisableProcessorResponse, DisableProcessorMetadata> + disableProcessorOperationCallable() { + return disableProcessorOperationCallable; + } + + @Override + public UnaryCallable + setDefaultProcessorVersionCallable() { + return setDefaultProcessorVersionCallable; + } + + @Override + public OperationCallable< + SetDefaultProcessorVersionRequest, + SetDefaultProcessorVersionResponse, + SetDefaultProcessorVersionMetadata> + setDefaultProcessorVersionOperationCallable() { + return setDefaultProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable reviewDocumentCallable() { + return reviewDocumentCallable; + } + + @Override + public OperationCallable< + ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> + reviewDocumentOperationCallable() { + return reviewDocumentOperationCallable; + } + + @Override + public UnaryCallable + evaluateProcessorVersionCallable() { + return evaluateProcessorVersionCallable; + } + + @Override + public OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + return evaluateProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable getEvaluationCallable() { + return getEvaluationCallable; + } + + @Override + public UnaryCallable listEvaluationsCallable() { + return listEvaluationsCallable; + } + + @Override + public UnaryCallable + listEvaluationsPagedCallable() { + return listEvaluationsPagedCallable; + } + + @Override + public UnaryCallable importProcessorVersionCallable() { + return importProcessorVersionCallable; + } + + @Override + public OperationCallable< + ImportProcessorVersionRequest, + ImportProcessorVersionResponse, + ImportProcessorVersionMetadata> + importProcessorVersionOperationCallable() { + return importProcessorVersionOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceCallableFactory.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceCallableFactory.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceCallableFactory.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceCallableFactory.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java similarity index 99% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java rename to java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java index 2b90440b5f3f..6c241d9dbcf5 100644 --- a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/stub/HttpJsonDocumentServiceStub.java @@ -32,7 +32,6 @@ import com.google.api.gax.httpjson.ProtoMessageResponseParser; import com.google.api.gax.httpjson.ProtoRestSerializer; import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsBuilder; diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1/reflect-config.json b/java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1/reflect-config.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1/reflect-config.json rename to java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1/reflect-config.json diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta1/reflect-config.json b/java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta1/reflect-config.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta1/reflect-config.json rename to java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta1/reflect-config.json diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta2/reflect-config.json b/java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta2/reflect-config.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta2/reflect-config.json rename to java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta2/reflect-config.json diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta3/reflect-config.json b/java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta3/reflect-config.json similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta3/reflect-config.json rename to java-document-ai/google-cloud-document-ai/src/main/resources/META-INF/native-image/com.google.cloud.documentai.v1beta3/reflect-config.json diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorService.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorService.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorService.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorService.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocations.java diff --git a/owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockLocationsImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java diff --git a/owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta1/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocations.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocations.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocations.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocations.java diff --git a/owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocationsImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocationsImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta2/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocationsImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockLocationsImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientHttpJsonTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClientTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientHttpJsonTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientHttpJsonTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientHttpJsonTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientTest.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientTest.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/DocumentServiceClientTest.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorService.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorService.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorService.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorService.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentProcessorServiceImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentService.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentService.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentService.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentService.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentServiceImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentServiceImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockDocumentServiceImpl.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocations.java diff --git a/owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java similarity index 100% rename from owl-bot-staging/java-document-ai/v1beta3/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java rename to java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta3/MockLocationsImpl.java diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java new file mode 100644 index 000000000000..25379c219869 --- /dev/null +++ b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java @@ -0,0 +1,2995 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.documentai.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

+ * Service to call Document AI to process documents according to the
+ * processor's definition. Processors are built using state-of-the-art Google
+ * AI such as natural language, computer vision, and translation to extract
+ * structured information from unstructured or semi-structured documents.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1/document_processor_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentProcessorServiceGrpc { + + private DocumentProcessorServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.documentai.v1.DocumentProcessorService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ProcessRequest, + com.google.cloud.documentai.v1.ProcessResponse> + getProcessDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ProcessDocument", + requestType = com.google.cloud.documentai.v1.ProcessRequest.class, + responseType = com.google.cloud.documentai.v1.ProcessResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ProcessRequest, + com.google.cloud.documentai.v1.ProcessResponse> + getProcessDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ProcessRequest, + com.google.cloud.documentai.v1.ProcessResponse> + getProcessDocumentMethod; + if ((getProcessDocumentMethod = DocumentProcessorServiceGrpc.getProcessDocumentMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getProcessDocumentMethod = DocumentProcessorServiceGrpc.getProcessDocumentMethod) + == null) { + DocumentProcessorServiceGrpc.getProcessDocumentMethod = + getProcessDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ProcessDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ProcessRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ProcessResponse.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ProcessDocument")) + .build(); + } + } + } + return getProcessDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.BatchProcessRequest, com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1.BatchProcessRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.BatchProcessRequest, com.google.longrunning.Operation> + getBatchProcessDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.BatchProcessRequest, com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + if ((getBatchProcessDocumentsMethod = + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getBatchProcessDocumentsMethod = + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod = + getBatchProcessDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.BatchProcessRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "BatchProcessDocuments")) + .build(); + } + } + } + return getBatchProcessDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchProcessorTypes", + requestType = com.google.cloud.documentai.v1.FetchProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1.FetchProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + getFetchProcessorTypesMethod; + if ((getFetchProcessorTypesMethod = DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getFetchProcessorTypesMethod = + DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getFetchProcessorTypesMethod = + getFetchProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FetchProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.FetchProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "FetchProcessorTypes")) + .build(); + } + } + } + return getFetchProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorTypes", + requestType = com.google.cloud.documentai.v1.ListProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + getListProcessorTypesMethod; + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorTypesMethod = + getListProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorTypes")) + .build(); + } + } + } + return getListProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorTypeRequest, + com.google.cloud.documentai.v1.ProcessorType> + getGetProcessorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorType", + requestType = com.google.cloud.documentai.v1.GetProcessorTypeRequest.class, + responseType = com.google.cloud.documentai.v1.ProcessorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorTypeRequest, + com.google.cloud.documentai.v1.ProcessorType> + getGetProcessorTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorTypeRequest, + com.google.cloud.documentai.v1.ProcessorType> + getGetProcessorTypeMethod; + if ((getGetProcessorTypeMethod = DocumentProcessorServiceGrpc.getGetProcessorTypeMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorTypeMethod = DocumentProcessorServiceGrpc.getGetProcessorTypeMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorTypeMethod = + getGetProcessorTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessorType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetProcessorTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ProcessorType.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessorType")) + .build(); + } + } + } + return getGetProcessorTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessors", + requestType = com.google.cloud.documentai.v1.ListProcessorsRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse> + getListProcessorsMethod; + if ((getListProcessorsMethod = DocumentProcessorServiceGrpc.getListProcessorsMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorsMethod = DocumentProcessorServiceGrpc.getListProcessorsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorsMethod = + getListProcessorsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ListProcessors")) + .build(); + } + } + } + return getListProcessorsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessor", + requestType = com.google.cloud.documentai.v1.GetProcessorRequest.class, + responseType = com.google.cloud.documentai.v1.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getGetProcessorMethod; + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + DocumentProcessorServiceGrpc.getGetProcessorMethod = + getGetProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessor")) + .build(); + } + } + } + return getGetProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TrainProcessorVersion", + requestType = com.google.cloud.documentai.v1.TrainProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod; + if ((getTrainProcessorVersionMethod = + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getTrainProcessorVersionMethod = + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod = + getTrainProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "TrainProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "TrainProcessorVersion")) + .build(); + } + } + } + return getTrainProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorVersion", + requestType = com.google.cloud.documentai.v1.GetProcessorVersionRequest.class, + responseType = com.google.cloud.documentai.v1.ProcessorVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion> + getGetProcessorVersionMethod; + if ((getGetProcessorVersionMethod = DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorVersionMethod = + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod = + getGetProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "GetProcessorVersion")) + .build(); + } + } + } + return getGetProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorVersions", + requestType = com.google.cloud.documentai.v1.ListProcessorVersionsRequest.class, + responseType = com.google.cloud.documentai.v1.ListProcessorVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod = + getListProcessorVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListProcessorVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListProcessorVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorVersions")) + .build(); + } + } + } + return getListProcessorVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessorVersion", + requestType = com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod = + getDeleteProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeleteProcessorVersion")) + .build(); + } + } + } + return getDeleteProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeployProcessorVersion", + requestType = com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod = + getDeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeployProcessorVersion")) + .build(); + } + } + } + return getDeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeployProcessorVersion", + requestType = com.google.cloud.documentai.v1.UndeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod = + getUndeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UndeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "UndeployProcessorVersion")) + .build(); + } + } + } + return getUndeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProcessor", + requestType = com.google.cloud.documentai.v1.CreateProcessorRequest.class, + responseType = com.google.cloud.documentai.v1.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor> + getCreateProcessorMethod; + if ((getCreateProcessorMethod = DocumentProcessorServiceGrpc.getCreateProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getCreateProcessorMethod = DocumentProcessorServiceGrpc.getCreateProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getCreateProcessorMethod = + getCreateProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.CreateProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("CreateProcessor")) + .build(); + } + } + } + return getCreateProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessor", + requestType = com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DeleteProcessorRequest, com.google.longrunning.Operation> + getDeleteProcessorMethod; + if ((getDeleteProcessorMethod = DocumentProcessorServiceGrpc.getDeleteProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeleteProcessorMethod = DocumentProcessorServiceGrpc.getDeleteProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getDeleteProcessorMethod = + getDeleteProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DeleteProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("DeleteProcessor")) + .build(); + } + } + } + return getDeleteProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EnableProcessor", + requestType = com.google.cloud.documentai.v1.EnableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EnableProcessorRequest, com.google.longrunning.Operation> + getEnableProcessorMethod; + if ((getEnableProcessorMethod = DocumentProcessorServiceGrpc.getEnableProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getEnableProcessorMethod = DocumentProcessorServiceGrpc.getEnableProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getEnableProcessorMethod = + getEnableProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EnableProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.EnableProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("EnableProcessor")) + .build(); + } + } + } + return getEnableProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, com.google.longrunning.Operation> + getDisableProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DisableProcessor", + requestType = com.google.cloud.documentai.v1.DisableProcessorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, com.google.longrunning.Operation> + getDisableProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.DisableProcessorRequest, + com.google.longrunning.Operation> + getDisableProcessorMethod; + if ((getDisableProcessorMethod = DocumentProcessorServiceGrpc.getDisableProcessorMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDisableProcessorMethod = DocumentProcessorServiceGrpc.getDisableProcessorMethod) + == null) { + DocumentProcessorServiceGrpc.getDisableProcessorMethod = + getDisableProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DisableProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.DisableProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("DisableProcessor")) + .build(); + } + } + } + return getDisableProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultProcessorVersion", + requestType = com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod = + getSetDefaultProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SetDefaultProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "SetDefaultProcessorVersion")) + .build(); + } + } + } + return getSetDefaultProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReviewDocument", + requestType = com.google.cloud.documentai.v1.ReviewDocumentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation> + getReviewDocumentMethod; + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) + == null) { + DocumentProcessorServiceGrpc.getReviewDocumentMethod = + getReviewDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReviewDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ReviewDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ReviewDocument")) + .build(); + } + } + } + return getReviewDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EvaluateProcessorVersion", + requestType = com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod; + if ((getEvaluateProcessorVersionMethod = + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getEvaluateProcessorVersionMethod = + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod = + getEvaluateProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "EvaluateProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "EvaluateProcessorVersion")) + .build(); + } + } + } + return getEvaluateProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetEvaluationRequest, + com.google.cloud.documentai.v1.Evaluation> + getGetEvaluationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEvaluation", + requestType = com.google.cloud.documentai.v1.GetEvaluationRequest.class, + responseType = com.google.cloud.documentai.v1.Evaluation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetEvaluationRequest, + com.google.cloud.documentai.v1.Evaluation> + getGetEvaluationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.GetEvaluationRequest, + com.google.cloud.documentai.v1.Evaluation> + getGetEvaluationMethod; + if ((getGetEvaluationMethod = DocumentProcessorServiceGrpc.getGetEvaluationMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetEvaluationMethod = DocumentProcessorServiceGrpc.getGetEvaluationMethod) + == null) { + DocumentProcessorServiceGrpc.getGetEvaluationMethod = + getGetEvaluationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEvaluation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.GetEvaluationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.Evaluation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetEvaluation")) + .build(); + } + } + } + return getGetEvaluationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListEvaluationsRequest, + com.google.cloud.documentai.v1.ListEvaluationsResponse> + getListEvaluationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEvaluations", + requestType = com.google.cloud.documentai.v1.ListEvaluationsRequest.class, + responseType = com.google.cloud.documentai.v1.ListEvaluationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListEvaluationsRequest, + com.google.cloud.documentai.v1.ListEvaluationsResponse> + getListEvaluationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1.ListEvaluationsRequest, + com.google.cloud.documentai.v1.ListEvaluationsResponse> + getListEvaluationsMethod; + if ((getListEvaluationsMethod = DocumentProcessorServiceGrpc.getListEvaluationsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListEvaluationsMethod = DocumentProcessorServiceGrpc.getListEvaluationsMethod) + == null) { + DocumentProcessorServiceGrpc.getListEvaluationsMethod = + getListEvaluationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEvaluations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListEvaluationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1.ListEvaluationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ListEvaluations")) + .build(); + } + } + } + return getListEvaluationsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentProcessorServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + }; + return DocumentProcessorServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentProcessorServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + }; + return DocumentProcessorServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentProcessorServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceFutureStub(channel, callOptions); + } + }; + return DocumentProcessorServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + default void processDocument( + com.google.cloud.documentai.v1.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getProcessDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + default void batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchProcessDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + default void fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + default void listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + default void getProcessorType( + com.google.cloud.documentai.v1.GetProcessorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + default void listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + default void getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
+     * 
+ */ + default void trainProcessorVersion( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTrainProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + default void getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + default void listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + default void deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + default void deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + default void undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The
+     * processor will be at `ENABLED` state by default after its creation.
+     * 
+ */ + default void createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + default void deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + default void enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEnableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + default void disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDisableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + default void setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + default void reviewDocument( + com.google.cloud.documentai.v1.ReviewDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReviewDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + default void evaluateProcessorVersion( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEvaluateProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + default void getEvaluation( + com.google.cloud.documentai.v1.GetEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEvaluationMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + default void listEvaluations( + com.google.cloud.documentai.v1.ListEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEvaluationsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public abstract static class DocumentProcessorServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentProcessorServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public void getProcessorType( + com.google.cloud.documentai.v1.GetProcessorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public void listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
+     * 
+ */ + public void trainProcessorVersion( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTrainProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public void listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public void deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public void deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public void undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The
+     * processor will be at `ENABLED` state by default after its creation.
+     * 
+ */ + public void createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public void deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public void enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnableProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public void disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public void reviewDocument( + com.google.cloud.documentai.v1.ReviewDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public void evaluateProcessorVersion( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEvaluateProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public void getEvaluation( + com.google.cloud.documentai.v1.GetEvaluationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEvaluationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public void listEvaluations( + com.google.cloud.documentai.v1.ListEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEvaluationsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentProcessorServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.cloud.documentai.v1.ProcessResponse processDocument( + com.google.cloud.documentai.v1.ProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1.BatchProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + public com.google.cloud.documentai.v1.FetchProcessorTypesResponse fetchProcessorTypes( + com.google.cloud.documentai.v1.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorTypesResponse listProcessorTypes( + com.google.cloud.documentai.v1.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public com.google.cloud.documentai.v1.ProcessorType getProcessorType( + com.google.cloud.documentai.v1.GetProcessorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorsResponse listProcessors( + com.google.cloud.documentai.v1.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.cloud.documentai.v1.Processor getProcessor( + com.google.cloud.documentai.v1.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
+     * 
+ */ + public com.google.longrunning.Operation trainProcessorVersion( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTrainProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersion( + com.google.cloud.documentai.v1.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListProcessorVersionsResponse listProcessorVersions( + com.google.cloud.documentai.v1.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeployProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeployProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The
+     * processor will be at `ENABLED` state by default after its creation.
+     * 
+ */ + public com.google.cloud.documentai.v1.Processor createProcessor( + com.google.cloud.documentai.v1.CreateProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessor( + com.google.cloud.documentai.v1.DeleteProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public com.google.longrunning.Operation enableProcessor( + com.google.cloud.documentai.v1.EnableProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnableProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public com.google.longrunning.Operation disableProcessor( + com.google.cloud.documentai.v1.DisableProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDisableProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.longrunning.Operation setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public com.google.longrunning.Operation reviewDocument( + com.google.cloud.documentai.v1.ReviewDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReviewDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public com.google.longrunning.Operation evaluateProcessorVersion( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEvaluateProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public com.google.cloud.documentai.v1.Evaluation getEvaluation( + com.google.cloud.documentai.v1.GetEvaluationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEvaluationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public com.google.cloud.documentai.v1.ListEvaluationsResponse listEvaluations( + com.google.cloud.documentai.v1.ListEvaluationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEvaluationsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentProcessorServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ProcessResponse> + processDocument(com.google.cloud.documentai.v1.ProcessRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchProcessDocuments(com.google.cloud.documentai.v1.BatchProcessRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.FetchProcessorTypesResponse> + fetchProcessorTypes(com.google.cloud.documentai.v1.FetchProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorTypesResponse> + listProcessorTypes(com.google.cloud.documentai.v1.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ProcessorType> + getProcessorType(com.google.cloud.documentai.v1.GetProcessorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorsResponse> + listProcessors(com.google.cloud.documentai.v1.ListProcessorsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.Processor> + getProcessor(com.google.cloud.documentai.v1.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + trainProcessorVersion(com.google.cloud.documentai.v1.TrainProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTrainProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ProcessorVersion> + getProcessorVersion(com.google.cloud.documentai.v1.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListProcessorVersionsResponse> + listProcessorVersions(com.google.cloud.documentai.v1.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessorVersion( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployProcessorVersion( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployProcessorVersion( + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The
+     * processor will be at `ENABLED` state by default after its creation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.Processor> + createProcessor(com.google.cloud.documentai.v1.CreateProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor, unloads all deployed model artifacts if it was
+     * enabled and then deletes all artifacts associated with this processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessor(com.google.cloud.documentai.v1.DeleteProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + enableProcessor(com.google.cloud.documentai.v1.EnableProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEnableProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + disableProcessor(com.google.cloud.documentai.v1.DisableProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisableProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultProcessorVersion( + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + reviewDocument(com.google.cloud.documentai.v1.ReviewDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + evaluateProcessorVersion( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEvaluateProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.Evaluation> + getEvaluation(com.google.cloud.documentai.v1.GetEvaluationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEvaluationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1.ListEvaluationsResponse> + listEvaluations(com.google.cloud.documentai.v1.ListEvaluationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEvaluationsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PROCESS_DOCUMENT = 0; + private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 1; + private static final int METHODID_FETCH_PROCESSOR_TYPES = 2; + private static final int METHODID_LIST_PROCESSOR_TYPES = 3; + private static final int METHODID_GET_PROCESSOR_TYPE = 4; + private static final int METHODID_LIST_PROCESSORS = 5; + private static final int METHODID_GET_PROCESSOR = 6; + private static final int METHODID_TRAIN_PROCESSOR_VERSION = 7; + private static final int METHODID_GET_PROCESSOR_VERSION = 8; + private static final int METHODID_LIST_PROCESSOR_VERSIONS = 9; + private static final int METHODID_DELETE_PROCESSOR_VERSION = 10; + private static final int METHODID_DEPLOY_PROCESSOR_VERSION = 11; + private static final int METHODID_UNDEPLOY_PROCESSOR_VERSION = 12; + private static final int METHODID_CREATE_PROCESSOR = 13; + private static final int METHODID_DELETE_PROCESSOR = 14; + private static final int METHODID_ENABLE_PROCESSOR = 15; + private static final int METHODID_DISABLE_PROCESSOR = 16; + private static final int METHODID_SET_DEFAULT_PROCESSOR_VERSION = 17; + private static final int METHODID_REVIEW_DOCUMENT = 18; + private static final int METHODID_EVALUATE_PROCESSOR_VERSION = 19; + private static final int METHODID_GET_EVALUATION = 20; + private static final int METHODID_LIST_EVALUATIONS = 21; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_PROCESS_DOCUMENT: + serviceImpl.processDocument( + (com.google.cloud.documentai.v1.ProcessRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_BATCH_PROCESS_DOCUMENTS: + serviceImpl.batchProcessDocuments( + (com.google.cloud.documentai.v1.BatchProcessRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FETCH_PROCESSOR_TYPES: + serviceImpl.fetchProcessorTypes( + (com.google.cloud.documentai.v1.FetchProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.FetchProcessorTypesResponse>) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_TYPES: + serviceImpl.listProcessorTypes( + (com.google.cloud.documentai.v1.ListProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.ListProcessorTypesResponse>) + responseObserver); + break; + case METHODID_GET_PROCESSOR_TYPE: + serviceImpl.getProcessorType( + (com.google.cloud.documentai.v1.GetProcessorTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROCESSORS: + serviceImpl.listProcessors( + (com.google.cloud.documentai.v1.ListProcessorsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PROCESSOR: + serviceImpl.getProcessor( + (com.google.cloud.documentai.v1.GetProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_TRAIN_PROCESSOR_VERSION: + serviceImpl.trainProcessorVersion( + (com.google.cloud.documentai.v1.TrainProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PROCESSOR_VERSION: + serviceImpl.getProcessorVersion( + (com.google.cloud.documentai.v1.GetProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_VERSIONS: + serviceImpl.listProcessorVersions( + (com.google.cloud.documentai.v1.ListProcessorVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1.ListProcessorVersionsResponse>) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR_VERSION: + serviceImpl.deleteProcessorVersion( + (com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_PROCESSOR_VERSION: + serviceImpl.deployProcessorVersion( + (com.google.cloud.documentai.v1.DeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_PROCESSOR_VERSION: + serviceImpl.undeployProcessorVersion( + (com.google.cloud.documentai.v1.UndeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PROCESSOR: + serviceImpl.createProcessor( + (com.google.cloud.documentai.v1.CreateProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR: + serviceImpl.deleteProcessor( + (com.google.cloud.documentai.v1.DeleteProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ENABLE_PROCESSOR: + serviceImpl.enableProcessor( + (com.google.cloud.documentai.v1.EnableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_PROCESSOR: + serviceImpl.disableProcessor( + (com.google.cloud.documentai.v1.DisableProcessorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_DEFAULT_PROCESSOR_VERSION: + serviceImpl.setDefaultProcessorVersion( + (com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REVIEW_DOCUMENT: + serviceImpl.reviewDocument( + (com.google.cloud.documentai.v1.ReviewDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EVALUATE_PROCESSOR_VERSION: + serviceImpl.evaluateProcessorVersion( + (com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_EVALUATION: + serviceImpl.getEvaluation( + (com.google.cloud.documentai.v1.GetEvaluationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_EVALUATIONS: + serviceImpl.listEvaluations( + (com.google.cloud.documentai.v1.ListEvaluationsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getProcessDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ProcessRequest, + com.google.cloud.documentai.v1.ProcessResponse>( + service, METHODID_PROCESS_DOCUMENT))) + .addMethod( + getBatchProcessDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.BatchProcessRequest, + com.google.longrunning.Operation>(service, METHODID_BATCH_PROCESS_DOCUMENTS))) + .addMethod( + getFetchProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.FetchProcessorTypesRequest, + com.google.cloud.documentai.v1.FetchProcessorTypesResponse>( + service, METHODID_FETCH_PROCESSOR_TYPES))) + .addMethod( + getListProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorTypesRequest, + com.google.cloud.documentai.v1.ListProcessorTypesResponse>( + service, METHODID_LIST_PROCESSOR_TYPES))) + .addMethod( + getGetProcessorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetProcessorTypeRequest, + com.google.cloud.documentai.v1.ProcessorType>( + service, METHODID_GET_PROCESSOR_TYPE))) + .addMethod( + getListProcessorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorsRequest, + com.google.cloud.documentai.v1.ListProcessorsResponse>( + service, METHODID_LIST_PROCESSORS))) + .addMethod( + getGetProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetProcessorRequest, + com.google.cloud.documentai.v1.Processor>(service, METHODID_GET_PROCESSOR))) + .addMethod( + getTrainProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_TRAIN_PROCESSOR_VERSION))) + .addMethod( + getGetProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetProcessorVersionRequest, + com.google.cloud.documentai.v1.ProcessorVersion>( + service, METHODID_GET_PROCESSOR_VERSION))) + .addMethod( + getListProcessorVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1.ListProcessorVersionsResponse>( + service, METHODID_LIST_PROCESSOR_VERSIONS))) + .addMethod( + getDeleteProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_PROCESSOR_VERSION))) + .addMethod( + getDeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeployProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_DEPLOY_PROCESSOR_VERSION))) + .addMethod( + getUndeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.UndeployProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_UNDEPLOY_PROCESSOR_VERSION))) + .addMethod( + getCreateProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.CreateProcessorRequest, + com.google.cloud.documentai.v1.Processor>(service, METHODID_CREATE_PROCESSOR))) + .addMethod( + getDeleteProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DeleteProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_PROCESSOR))) + .addMethod( + getEnableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.EnableProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_ENABLE_PROCESSOR))) + .addMethod( + getDisableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.DisableProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_DISABLE_PROCESSOR))) + .addMethod( + getSetDefaultProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_SET_DEFAULT_PROCESSOR_VERSION))) + .addMethod( + getReviewDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ReviewDocumentRequest, + com.google.longrunning.Operation>(service, METHODID_REVIEW_DOCUMENT))) + .addMethod( + getEvaluateProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_EVALUATE_PROCESSOR_VERSION))) + .addMethod( + getGetEvaluationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.GetEvaluationRequest, + com.google.cloud.documentai.v1.Evaluation>(service, METHODID_GET_EVALUATION))) + .addMethod( + getListEvaluationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListEvaluationsRequest, + com.google.cloud.documentai.v1.ListEvaluationsResponse>( + service, METHODID_LIST_EVALUATIONS))) + .build(); + } + + private abstract static class DocumentProcessorServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentProcessorServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentProcessorService"); + } + } + + private static final class DocumentProcessorServiceFileDescriptorSupplier + extends DocumentProcessorServiceBaseDescriptorSupplier { + DocumentProcessorServiceFileDescriptorSupplier() {} + } + + private static final class DocumentProcessorServiceMethodDescriptorSupplier + extends DocumentProcessorServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentProcessorServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentProcessorServiceFileDescriptorSupplier()) + .addMethod(getProcessDocumentMethod()) + .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getFetchProcessorTypesMethod()) + .addMethod(getListProcessorTypesMethod()) + .addMethod(getGetProcessorTypeMethod()) + .addMethod(getListProcessorsMethod()) + .addMethod(getGetProcessorMethod()) + .addMethod(getTrainProcessorVersionMethod()) + .addMethod(getGetProcessorVersionMethod()) + .addMethod(getListProcessorVersionsMethod()) + .addMethod(getDeleteProcessorVersionMethod()) + .addMethod(getDeployProcessorVersionMethod()) + .addMethod(getUndeployProcessorVersionMethod()) + .addMethod(getCreateProcessorMethod()) + .addMethod(getDeleteProcessorMethod()) + .addMethod(getEnableProcessorMethod()) + .addMethod(getDisableProcessorMethod()) + .addMethod(getSetDefaultProcessorVersionMethod()) + .addMethod(getReviewDocumentMethod()) + .addMethod(getEvaluateProcessorVersionMethod()) + .addMethod(getGetEvaluationMethod()) + .addMethod(getListEvaluationsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java new file mode 100644 index 000000000000..cad63122fa32 --- /dev/null +++ b/java-document-ai/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java @@ -0,0 +1,397 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to parse structured information from unstructured or semi-structured
+ * documents using state-of-the-art Google AI such as natural language,
+ * computer vision, and translation.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1beta1/document_understanding.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentUnderstandingServiceGrpc { + + private DocumentUnderstandingServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.documentai.v1beta1.DocumentUnderstandingService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod = + getBatchProcessDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentUnderstandingServiceMethodDescriptorSupplier( + "BatchProcessDocuments")) + .build(); + } + } + } + return getBatchProcessDocumentsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentUnderstandingServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentUnderstandingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentUnderstandingServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * LRO endpoint to batch process many documents.
+     * 
+ */ + default void batchProcessDocuments( + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchProcessDocumentsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public abstract static class DocumentUnderstandingServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentUnderstandingServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentUnderstandingServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentUnderstandingServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentUnderstandingServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchProcessDocuments( + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_BATCH_PROCESS_DOCUMENTS: + serviceImpl.batchProcessDocuments( + (com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBatchProcessDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_BATCH_PROCESS_DOCUMENTS))) + .build(); + } + + private abstract static class DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentUnderstandingServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1beta1.DocumentAiProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentUnderstandingService"); + } + } + + private static final class DocumentUnderstandingServiceFileDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier { + DocumentUnderstandingServiceFileDescriptorSupplier() {} + } + + private static final class DocumentUnderstandingServiceMethodDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentUnderstandingServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentUnderstandingServiceFileDescriptorSupplier()) + .addMethod(getBatchProcessDocumentsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java new file mode 100644 index 000000000000..bb49a35395e4 --- /dev/null +++ b/java-document-ai/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java @@ -0,0 +1,524 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.v1beta2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to parse structured information from unstructured or semi-structured
+ * documents using state-of-the-art Google AI such as natural language,
+ * computer vision, and translation.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1beta2/document_understanding.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentUnderstandingServiceGrpc { + + private DocumentUnderstandingServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.documentai.v1beta2.DocumentUnderstandingService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod = + getBatchProcessDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentUnderstandingServiceMethodDescriptorSupplier( + "BatchProcessDocuments")) + .build(); + } + } + } + return getBatchProcessDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ProcessDocument", + requestType = com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.class, + responseType = com.google.cloud.documentai.v1beta2.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod; + if ((getProcessDocumentMethod = DocumentUnderstandingServiceGrpc.getProcessDocumentMethod) + == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + if ((getProcessDocumentMethod = DocumentUnderstandingServiceGrpc.getProcessDocumentMethod) + == null) { + DocumentUnderstandingServiceGrpc.getProcessDocumentMethod = + getProcessDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ProcessDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.Document.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentUnderstandingServiceMethodDescriptorSupplier( + "ProcessDocument")) + .build(); + } + } + } + return getProcessDocumentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentUnderstandingServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentUnderstandingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentUnderstandingServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + default void batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchProcessDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + default void processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getProcessDocumentMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public abstract static class DocumentUnderstandingServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentUnderstandingServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentUnderstandingServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentUnderstandingServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.cloud.documentai.v1beta2.Document processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * DocumentUnderstandingService. + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentUnderstandingServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta2.Document> + processDocument(com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 0; + private static final int METHODID_PROCESS_DOCUMENT = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_BATCH_PROCESS_DOCUMENTS: + serviceImpl.batchProcessDocuments( + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PROCESS_DOCUMENT: + serviceImpl.processDocument( + (com.google.cloud.documentai.v1beta2.ProcessDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBatchProcessDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_BATCH_PROCESS_DOCUMENTS))) + .addMethod( + getProcessDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document>( + service, METHODID_PROCESS_DOCUMENT))) + .build(); + } + + private abstract static class DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentUnderstandingServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentUnderstandingService"); + } + } + + private static final class DocumentUnderstandingServiceFileDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier { + DocumentUnderstandingServiceFileDescriptorSupplier() {} + } + + private static final class DocumentUnderstandingServiceMethodDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentUnderstandingServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentUnderstandingServiceFileDescriptorSupplier()) + .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getProcessDocumentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java new file mode 100644 index 000000000000..1b3250bdc239 --- /dev/null +++ b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceGrpc.java @@ -0,0 +1,3150 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to call Document AI to process documents according to the
+ * processor's definition. Processors are built using state-of-the-art Google
+ * AI such as natural language, computer vision, and translation to extract
+ * structured information from unstructured or semi-structured documents.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1beta3/document_processor_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentProcessorServiceGrpc { + + private DocumentProcessorServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.documentai.v1beta3.DocumentProcessorService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ProcessRequest, + com.google.cloud.documentai.v1beta3.ProcessResponse> + getProcessDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ProcessDocument", + requestType = com.google.cloud.documentai.v1beta3.ProcessRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ProcessResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ProcessRequest, + com.google.cloud.documentai.v1beta3.ProcessResponse> + getProcessDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ProcessRequest, + com.google.cloud.documentai.v1beta3.ProcessResponse> + getProcessDocumentMethod; + if ((getProcessDocumentMethod = DocumentProcessorServiceGrpc.getProcessDocumentMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getProcessDocumentMethod = DocumentProcessorServiceGrpc.getProcessDocumentMethod) + == null) { + DocumentProcessorServiceGrpc.getProcessDocumentMethod = + getProcessDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ProcessDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ProcessRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ProcessResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ProcessDocument")) + .build(); + } + } + } + return getProcessDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchProcessRequest, com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1beta3.BatchProcessRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchProcessRequest, com.google.longrunning.Operation> + getBatchProcessDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchProcessRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + if ((getBatchProcessDocumentsMethod = + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getBatchProcessDocumentsMethod = + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + DocumentProcessorServiceGrpc.getBatchProcessDocumentsMethod = + getBatchProcessDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.BatchProcessRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "BatchProcessDocuments")) + .build(); + } + } + } + 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.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorTypes", + requestType = com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + getListProcessorTypesMethod; + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorTypesMethod = DocumentProcessorServiceGrpc.getListProcessorTypesMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorTypesMethod = + getListProcessorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProcessorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorTypes")) + .build(); + } + } + } + return getListProcessorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, + com.google.cloud.documentai.v1beta3.ProcessorType> + getGetProcessorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorType", + requestType = com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ProcessorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, + com.google.cloud.documentai.v1beta3.ProcessorType> + getGetProcessorTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, + com.google.cloud.documentai.v1beta3.ProcessorType> + getGetProcessorTypeMethod; + if ((getGetProcessorTypeMethod = DocumentProcessorServiceGrpc.getGetProcessorTypeMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorTypeMethod = DocumentProcessorServiceGrpc.getGetProcessorTypeMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorTypeMethod = + getGetProcessorTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessorType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ProcessorType + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessorType")) + .build(); + } + } + } + return getGetProcessorTypeMethod; + } + + 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.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessor", + requestType = com.google.cloud.documentai.v1beta3.GetProcessorRequest.class, + responseType = com.google.cloud.documentai.v1beta3.Processor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + getGetProcessorMethod; + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorMethod = DocumentProcessorServiceGrpc.getGetProcessorMethod) == null) { + DocumentProcessorServiceGrpc.getGetProcessorMethod = + getGetProcessorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProcessor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetProcessorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.Processor.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetProcessor")) + .build(); + } + } + } + return getGetProcessorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TrainProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, + com.google.longrunning.Operation> + getTrainProcessorVersionMethod; + if ((getTrainProcessorVersionMethod = + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getTrainProcessorVersionMethod = + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getTrainProcessorVersionMethod = + getTrainProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "TrainProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "TrainProcessorVersion")) + .build(); + } + } + } + return getTrainProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ProcessorVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getGetProcessorVersionMethod; + if ((getGetProcessorVersionMethod = DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetProcessorVersionMethod = + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getGetProcessorVersionMethod = + getGetProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ProcessorVersion + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "GetProcessorVersion")) + .build(); + } + } + } + return getGetProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProcessorVersions", + requestType = com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + getListProcessorVersionsMethod; + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListProcessorVersionsMethod = + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod) + == null) { + DocumentProcessorServiceGrpc.getListProcessorVersionsMethod = + getListProcessorVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListProcessorVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ListProcessorVersions")) + .build(); + } + } + } + return getListProcessorVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation> + getDeleteProcessorVersionMethod; + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeleteProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeleteProcessorVersionMethod = + getDeleteProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeleteProcessorVersion")) + .build(); + } + } + } + return getDeleteProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeployProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation> + getDeployProcessorVersionMethod; + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getDeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getDeployProcessorVersionMethod = + getDeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "DeployProcessorVersion")) + .build(); + } + } + } + return getDeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeployProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation> + getUndeployProcessorVersionMethod; + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getUndeployProcessorVersionMethod = + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getUndeployProcessorVersionMethod = + getUndeployProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UndeployProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "UndeployProcessorVersion")) + .build(); + } + } + } + return getUndeployProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor> + 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.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation> + getSetDefaultProcessorVersionMethod; + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getSetDefaultProcessorVersionMethod = + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getSetDefaultProcessorVersionMethod = + getSetDefaultProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SetDefaultProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "SetDefaultProcessorVersion")) + .build(); + } + } + } + return getSetDefaultProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest, + com.google.longrunning.Operation> + getReviewDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReviewDocument", + requestType = com.google.cloud.documentai.v1beta3.ReviewDocumentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest, + com.google.longrunning.Operation> + getReviewDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest, + com.google.longrunning.Operation> + getReviewDocumentMethod; + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getReviewDocumentMethod = DocumentProcessorServiceGrpc.getReviewDocumentMethod) + == null) { + DocumentProcessorServiceGrpc.getReviewDocumentMethod = + getReviewDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReviewDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ReviewDocument")) + .build(); + } + } + } + return getReviewDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EvaluateProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation> + getEvaluateProcessorVersionMethod; + if ((getEvaluateProcessorVersionMethod = + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getEvaluateProcessorVersionMethod = + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getEvaluateProcessorVersionMethod = + getEvaluateProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "EvaluateProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "EvaluateProcessorVersion")) + .build(); + } + } + } + return getEvaluateProcessorVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetEvaluationRequest, + com.google.cloud.documentai.v1beta3.Evaluation> + getGetEvaluationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEvaluation", + requestType = com.google.cloud.documentai.v1beta3.GetEvaluationRequest.class, + responseType = com.google.cloud.documentai.v1beta3.Evaluation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetEvaluationRequest, + com.google.cloud.documentai.v1beta3.Evaluation> + getGetEvaluationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetEvaluationRequest, + com.google.cloud.documentai.v1beta3.Evaluation> + getGetEvaluationMethod; + if ((getGetEvaluationMethod = DocumentProcessorServiceGrpc.getGetEvaluationMethod) == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getGetEvaluationMethod = DocumentProcessorServiceGrpc.getGetEvaluationMethod) + == null) { + DocumentProcessorServiceGrpc.getGetEvaluationMethod = + getGetEvaluationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEvaluation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetEvaluationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.Evaluation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("GetEvaluation")) + .build(); + } + } + } + return getGetEvaluationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest, + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse> + getListEvaluationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEvaluations", + requestType = com.google.cloud.documentai.v1beta3.ListEvaluationsRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListEvaluationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest, + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse> + getListEvaluationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest, + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse> + getListEvaluationsMethod; + if ((getListEvaluationsMethod = DocumentProcessorServiceGrpc.getListEvaluationsMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getListEvaluationsMethod = DocumentProcessorServiceGrpc.getListEvaluationsMethod) + == null) { + DocumentProcessorServiceGrpc.getListEvaluationsMethod = + getListEvaluationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEvaluations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier("ListEvaluations")) + .build(); + } + } + } + return getListEvaluationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, + com.google.longrunning.Operation> + getImportProcessorVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportProcessorVersion", + requestType = com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, + com.google.longrunning.Operation> + getImportProcessorVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, + com.google.longrunning.Operation> + getImportProcessorVersionMethod; + if ((getImportProcessorVersionMethod = + DocumentProcessorServiceGrpc.getImportProcessorVersionMethod) + == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + if ((getImportProcessorVersionMethod = + DocumentProcessorServiceGrpc.getImportProcessorVersionMethod) + == null) { + DocumentProcessorServiceGrpc.getImportProcessorVersionMethod = + getImportProcessorVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ImportProcessorVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentProcessorServiceMethodDescriptorSupplier( + "ImportProcessorVersion")) + .build(); + } + } + } + return getImportProcessorVersionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentProcessorServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + }; + return DocumentProcessorServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentProcessorServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + }; + return DocumentProcessorServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentProcessorServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentProcessorServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceFutureStub(channel, callOptions); + } + }; + return DocumentProcessorServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + default void processDocument( + com.google.cloud.documentai.v1beta3.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getProcessDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + default void batchProcessDocuments( + com.google.cloud.documentai.v1beta3.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchProcessDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + default void fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + default void listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + default void getProcessorType( + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all processors which belong to this project.
+     * 
+ */ + default void listProcessors( + com.google.cloud.documentai.v1beta3.ListProcessorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + default void getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].
+     * 
+ */ + default void trainProcessorVersion( + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTrainProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + default void getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + default void listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProcessorVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + default void deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + default void deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + default void undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeployProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided.
+     * The processor will be at `ENABLED` state by default after its creation.
+     * 
+ */ + default 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.
+     * 
+ */ + default void deleteProcessor( + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a processor
+     * 
+ */ + default void enableProcessor( + com.google.cloud.documentai.v1beta3.EnableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEnableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a processor
+     * 
+ */ + default void disableProcessor( + com.google.cloud.documentai.v1beta3.DisableProcessorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDisableProcessorMethod(), responseObserver); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + default void setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + default void reviewDocument( + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReviewDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + default void evaluateProcessorVersion( + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEvaluateProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + default void getEvaluation( + com.google.cloud.documentai.v1beta3.GetEvaluationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEvaluationMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + default void listEvaluations( + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEvaluationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Imports a processor version from source processor version.
+     * 
+ */ + default void importProcessorVersion( + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportProcessorVersionMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public abstract static class DocumentProcessorServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentProcessorServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentProcessorServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1beta3.ProcessRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta3.BatchProcessRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + public void fetchProcessorTypes( + com.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the processor types that exist.
+     * 
+ */ + public void listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public void getProcessorType( + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorTypeMethod(), 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); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public void getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].
+     * 
+ */ + public void trainProcessorVersion( + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTrainProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public void getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public void listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public void deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public void deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public void undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided.
+     * 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); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public void setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public void reviewDocument( + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public void evaluateProcessorVersion( + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEvaluateProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public void getEvaluation( + com.google.cloud.documentai.v1beta3.GetEvaluationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEvaluationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public void listEvaluations( + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEvaluationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Imports a processor version from source processor version.
+     * 
+ */ + public void importProcessorVersion( + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportProcessorVersionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentProcessorServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ProcessResponse processDocument( + com.google.cloud.documentai.v1beta3.ProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1beta3.BatchProcessRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + 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 the processor types that exist.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse listProcessorTypes( + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ProcessorType getProcessorType( + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorTypeMethod(), 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); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.Processor getProcessor( + com.google.cloud.documentai.v1beta3.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].
+     * 
+ */ + public com.google.longrunning.Operation trainProcessorVersion( + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTrainProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ProcessorVersion getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProcessorVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeployProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.longrunning.Operation undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeployProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided.
+     * 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); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.longrunning.Operation setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public com.google.longrunning.Operation reviewDocument( + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReviewDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public com.google.longrunning.Operation evaluateProcessorVersion( + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEvaluateProcessorVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.Evaluation getEvaluation( + com.google.cloud.documentai.v1beta3.GetEvaluationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEvaluationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListEvaluationsResponse listEvaluations( + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEvaluationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports a processor version from source processor version.
+     * 
+ */ + public com.google.longrunning.Operation importProcessorVersion( + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportProcessorVersionMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * DocumentProcessorService. + * + *
+   * Service to call Document AI to process documents according to the
+   * processor's definition. Processors are built using state-of-the-art Google
+   * AI such as natural language, computer vision, and translation to extract
+   * structured information from unstructured or semi-structured documents.
+   * 
+ */ + public static final class DocumentProcessorServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentProcessorServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentProcessorServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentProcessorServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ProcessResponse> + processDocument(com.google.cloud.documentai.v1beta3.ProcessRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchProcessDocuments(com.google.cloud.documentai.v1beta3.BatchProcessRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches processor types. Note that we don't use
+     * [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
+     * here, because it isn't paginated.
+     * 
+ */ + 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 the processor types that exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse> + listProcessorTypes(com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor type detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ProcessorType> + getProcessorType(com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorTypeMethod(), 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); + } + + /** + * + * + *
+     * Gets a processor detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.Processor> + getProcessor(com.google.cloud.documentai.v1beta3.GetProcessorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + trainProcessorVersion( + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTrainProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a processor version detail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ProcessorVersion> + getProcessorVersion( + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of a processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse> + listProcessorVersions( + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProcessorVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the processor version, all artifacts under the processor version
+     * will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProcessorVersion( + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployProcessorVersion( + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys the processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployProcessorVersion( + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeployProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a processor from the
+     * [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided.
+     * 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); + } + + /** + * + * + *
+     * Set the default (active) version of a
+     * [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
+     * [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
+     * and
+     * [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultProcessorVersion( + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Send a document for Human Review. The input document should be processed by
+     * the specified processor.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + reviewDocument(com.google.cloud.documentai.v1beta3.ReviewDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReviewDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Evaluates a ProcessorVersion against annotated documents, producing an
+     * Evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + evaluateProcessorVersion( + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEvaluateProcessorVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.Evaluation> + getEvaluation(com.google.cloud.documentai.v1beta3.GetEvaluationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEvaluationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a set of evaluations for a given processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse> + listEvaluations(com.google.cloud.documentai.v1beta3.ListEvaluationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEvaluationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports a processor version from source processor version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importProcessorVersion( + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportProcessorVersionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PROCESS_DOCUMENT = 0; + private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 1; + private static final int METHODID_FETCH_PROCESSOR_TYPES = 2; + private static final int METHODID_LIST_PROCESSOR_TYPES = 3; + private static final int METHODID_GET_PROCESSOR_TYPE = 4; + private static final int METHODID_LIST_PROCESSORS = 5; + private static final int METHODID_GET_PROCESSOR = 6; + private static final int METHODID_TRAIN_PROCESSOR_VERSION = 7; + private static final int METHODID_GET_PROCESSOR_VERSION = 8; + private static final int METHODID_LIST_PROCESSOR_VERSIONS = 9; + private static final int METHODID_DELETE_PROCESSOR_VERSION = 10; + private static final int METHODID_DEPLOY_PROCESSOR_VERSION = 11; + private static final int METHODID_UNDEPLOY_PROCESSOR_VERSION = 12; + private static final int METHODID_CREATE_PROCESSOR = 13; + private static final int METHODID_DELETE_PROCESSOR = 14; + private static final int METHODID_ENABLE_PROCESSOR = 15; + private static final int METHODID_DISABLE_PROCESSOR = 16; + private static final int METHODID_SET_DEFAULT_PROCESSOR_VERSION = 17; + private static final int METHODID_REVIEW_DOCUMENT = 18; + private static final int METHODID_EVALUATE_PROCESSOR_VERSION = 19; + private static final int METHODID_GET_EVALUATION = 20; + private static final int METHODID_LIST_EVALUATIONS = 21; + private static final int METHODID_IMPORT_PROCESSOR_VERSION = 22; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_PROCESS_DOCUMENT: + serviceImpl.processDocument( + (com.google.cloud.documentai.v1beta3.ProcessRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_BATCH_PROCESS_DOCUMENTS: + serviceImpl.batchProcessDocuments( + (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_PROCESSOR_TYPES: + serviceImpl.listProcessorTypes( + (com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse>) + responseObserver); + break; + case METHODID_GET_PROCESSOR_TYPE: + serviceImpl.getProcessorType( + (com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest) request, + (io.grpc.stub.StreamObserver) + 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_GET_PROCESSOR: + serviceImpl.getProcessor( + (com.google.cloud.documentai.v1beta3.GetProcessorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_TRAIN_PROCESSOR_VERSION: + serviceImpl.trainProcessorVersion( + (com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PROCESSOR_VERSION: + serviceImpl.getProcessorVersion( + (com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROCESSOR_VERSIONS: + serviceImpl.listProcessorVersions( + (com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse>) + responseObserver); + break; + case METHODID_DELETE_PROCESSOR_VERSION: + serviceImpl.deleteProcessorVersion( + (com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_PROCESSOR_VERSION: + serviceImpl.deployProcessorVersion( + (com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_PROCESSOR_VERSION: + serviceImpl.undeployProcessorVersion( + (com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PROCESSOR: + serviceImpl.createProcessor( + (com.google.cloud.documentai.v1beta3.CreateProcessorRequest) request, + (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_SET_DEFAULT_PROCESSOR_VERSION: + serviceImpl.setDefaultProcessorVersion( + (com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REVIEW_DOCUMENT: + serviceImpl.reviewDocument( + (com.google.cloud.documentai.v1beta3.ReviewDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EVALUATE_PROCESSOR_VERSION: + serviceImpl.evaluateProcessorVersion( + (com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_EVALUATION: + serviceImpl.getEvaluation( + (com.google.cloud.documentai.v1beta3.GetEvaluationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_EVALUATIONS: + serviceImpl.listEvaluations( + (com.google.cloud.documentai.v1beta3.ListEvaluationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse>) + responseObserver); + break; + case METHODID_IMPORT_PROCESSOR_VERSION: + serviceImpl.importProcessorVersion( + (com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getProcessDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ProcessRequest, + com.google.cloud.documentai.v1beta3.ProcessResponse>( + service, METHODID_PROCESS_DOCUMENT))) + .addMethod( + getBatchProcessDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.BatchProcessRequest, + com.google.longrunning.Operation>(service, 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>( + service, METHODID_FETCH_PROCESSOR_TYPES))) + .addMethod( + getListProcessorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, + com.google.cloud.documentai.v1beta3.ListProcessorTypesResponse>( + service, METHODID_LIST_PROCESSOR_TYPES))) + .addMethod( + getGetProcessorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, + com.google.cloud.documentai.v1beta3.ProcessorType>( + service, METHODID_GET_PROCESSOR_TYPE))) + .addMethod( + getListProcessorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorsResponse>( + service, METHODID_LIST_PROCESSORS))) + .addMethod( + getGetProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor>( + service, METHODID_GET_PROCESSOR))) + .addMethod( + getTrainProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_TRAIN_PROCESSOR_VERSION))) + .addMethod( + getGetProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, + com.google.cloud.documentai.v1beta3.ProcessorVersion>( + service, METHODID_GET_PROCESSOR_VERSION))) + .addMethod( + getListProcessorVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, + com.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse>( + service, METHODID_LIST_PROCESSOR_VERSIONS))) + .addMethod( + getDeleteProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_PROCESSOR_VERSION))) + .addMethod( + getDeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_DEPLOY_PROCESSOR_VERSION))) + .addMethod( + getUndeployProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_UNDEPLOY_PROCESSOR_VERSION))) + .addMethod( + getCreateProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.CreateProcessorRequest, + com.google.cloud.documentai.v1beta3.Processor>( + service, METHODID_CREATE_PROCESSOR))) + .addMethod( + getDeleteProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DeleteProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_PROCESSOR))) + .addMethod( + getEnableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.EnableProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_ENABLE_PROCESSOR))) + .addMethod( + getDisableProcessorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.DisableProcessorRequest, + com.google.longrunning.Operation>(service, METHODID_DISABLE_PROCESSOR))) + .addMethod( + getSetDefaultProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_SET_DEFAULT_PROCESSOR_VERSION))) + .addMethod( + getReviewDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ReviewDocumentRequest, + com.google.longrunning.Operation>(service, METHODID_REVIEW_DOCUMENT))) + .addMethod( + getEvaluateProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation>( + service, METHODID_EVALUATE_PROCESSOR_VERSION))) + .addMethod( + getGetEvaluationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetEvaluationRequest, + com.google.cloud.documentai.v1beta3.Evaluation>( + service, METHODID_GET_EVALUATION))) + .addMethod( + getListEvaluationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListEvaluationsRequest, + com.google.cloud.documentai.v1beta3.ListEvaluationsResponse>( + service, METHODID_LIST_EVALUATIONS))) + .addMethod( + getImportProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, + com.google.longrunning.Operation>(service, METHODID_IMPORT_PROCESSOR_VERSION))) + .build(); + } + + private abstract static class DocumentProcessorServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentProcessorServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiProcessorService.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentProcessorService"); + } + } + + private static final class DocumentProcessorServiceFileDescriptorSupplier + extends DocumentProcessorServiceBaseDescriptorSupplier { + DocumentProcessorServiceFileDescriptorSupplier() {} + } + + private static final class DocumentProcessorServiceMethodDescriptorSupplier + extends DocumentProcessorServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentProcessorServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentProcessorServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentProcessorServiceFileDescriptorSupplier()) + .addMethod(getProcessDocumentMethod()) + .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getFetchProcessorTypesMethod()) + .addMethod(getListProcessorTypesMethod()) + .addMethod(getGetProcessorTypeMethod()) + .addMethod(getListProcessorsMethod()) + .addMethod(getGetProcessorMethod()) + .addMethod(getTrainProcessorVersionMethod()) + .addMethod(getGetProcessorVersionMethod()) + .addMethod(getListProcessorVersionsMethod()) + .addMethod(getDeleteProcessorVersionMethod()) + .addMethod(getDeployProcessorVersionMethod()) + .addMethod(getUndeployProcessorVersionMethod()) + .addMethod(getCreateProcessorMethod()) + .addMethod(getDeleteProcessorMethod()) + .addMethod(getEnableProcessorMethod()) + .addMethod(getDisableProcessorMethod()) + .addMethod(getSetDefaultProcessorVersionMethod()) + .addMethod(getReviewDocumentMethod()) + .addMethod(getEvaluateProcessorVersionMethod()) + .addMethod(getGetEvaluationMethod()) + .addMethod(getListEvaluationsMethod()) + .addMethod(getImportProcessorVersionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceGrpc.java new file mode 100644 index 000000000000..9f556c1bf4bd --- /dev/null +++ b/java-document-ai/grpc-google-cloud-document-ai-v1beta3/src/main/java/com/google/cloud/documentai/v1beta3/DocumentServiceGrpc.java @@ -0,0 +1,1095 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to call Cloud DocumentAI to manage document collection (dataset).
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1beta3/document_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentServiceGrpc { + + private DocumentServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.documentai.v1beta3.DocumentService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest, + com.google.longrunning.Operation> + getUpdateDatasetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDataset", + requestType = com.google.cloud.documentai.v1beta3.UpdateDatasetRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest, + com.google.longrunning.Operation> + getUpdateDatasetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest, + com.google.longrunning.Operation> + getUpdateDatasetMethod; + if ((getUpdateDatasetMethod = DocumentServiceGrpc.getUpdateDatasetMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getUpdateDatasetMethod = DocumentServiceGrpc.getUpdateDatasetMethod) == null) { + DocumentServiceGrpc.getUpdateDatasetMethod = + getUpdateDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("UpdateDataset")) + .build(); + } + } + } + return getUpdateDatasetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportDocuments", + requestType = com.google.cloud.documentai.v1beta3.ImportDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod; + if ((getImportDocumentsMethod = DocumentServiceGrpc.getImportDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getImportDocumentsMethod = DocumentServiceGrpc.getImportDocumentsMethod) == null) { + DocumentServiceGrpc.getImportDocumentsMethod = + getImportDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("ImportDocuments")) + .build(); + } + } + } + return getImportDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDocumentRequest, + com.google.cloud.documentai.v1beta3.GetDocumentResponse> + getGetDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDocument", + requestType = com.google.cloud.documentai.v1beta3.GetDocumentRequest.class, + responseType = com.google.cloud.documentai.v1beta3.GetDocumentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDocumentRequest, + com.google.cloud.documentai.v1beta3.GetDocumentResponse> + getGetDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDocumentRequest, + com.google.cloud.documentai.v1beta3.GetDocumentResponse> + getGetDocumentMethod; + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + DocumentServiceGrpc.getGetDocumentMethod = + getGetDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetDocumentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("GetDocument")) + .build(); + } + } + } + return getGetDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListDocumentsRequest, + com.google.cloud.documentai.v1beta3.ListDocumentsResponse> + getListDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDocuments", + requestType = com.google.cloud.documentai.v1beta3.ListDocumentsRequest.class, + responseType = com.google.cloud.documentai.v1beta3.ListDocumentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListDocumentsRequest, + com.google.cloud.documentai.v1beta3.ListDocumentsResponse> + getListDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.ListDocumentsRequest, + com.google.cloud.documentai.v1beta3.ListDocumentsResponse> + getListDocumentsMethod; + if ((getListDocumentsMethod = DocumentServiceGrpc.getListDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getListDocumentsMethod = DocumentServiceGrpc.getListDocumentsMethod) == null) { + DocumentServiceGrpc.getListDocumentsMethod = + getListDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.ListDocumentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("ListDocuments")) + .build(); + } + } + } + return getListDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, + com.google.longrunning.Operation> + getBatchDeleteDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchDeleteDocuments", + requestType = com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, + com.google.longrunning.Operation> + getBatchDeleteDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, + com.google.longrunning.Operation> + getBatchDeleteDocumentsMethod; + if ((getBatchDeleteDocumentsMethod = DocumentServiceGrpc.getBatchDeleteDocumentsMethod) + == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getBatchDeleteDocumentsMethod = DocumentServiceGrpc.getBatchDeleteDocumentsMethod) + == null) { + DocumentServiceGrpc.getBatchDeleteDocumentsMethod = + getBatchDeleteDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchDeleteDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("BatchDeleteDocuments")) + .build(); + } + } + } + return getBatchDeleteDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getGetDatasetSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDatasetSchema", + requestType = com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.class, + responseType = com.google.cloud.documentai.v1beta3.DatasetSchema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getGetDatasetSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getGetDatasetSchemaMethod; + if ((getGetDatasetSchemaMethod = DocumentServiceGrpc.getGetDatasetSchemaMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getGetDatasetSchemaMethod = DocumentServiceGrpc.getGetDatasetSchemaMethod) == null) { + DocumentServiceGrpc.getGetDatasetSchemaMethod = + getGetDatasetSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDatasetSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DatasetSchema + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("GetDatasetSchema")) + .build(); + } + } + } + return getGetDatasetSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getUpdateDatasetSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDatasetSchema", + requestType = com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.class, + responseType = com.google.cloud.documentai.v1beta3.DatasetSchema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getUpdateDatasetSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema> + getUpdateDatasetSchemaMethod; + if ((getUpdateDatasetSchemaMethod = DocumentServiceGrpc.getUpdateDatasetSchemaMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getUpdateDatasetSchemaMethod = DocumentServiceGrpc.getUpdateDatasetSchemaMethod) + == null) { + DocumentServiceGrpc.getUpdateDatasetSchemaMethod = + getUpdateDatasetSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateDatasetSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta3.DatasetSchema + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("UpdateDatasetSchema")) + .build(); + } + } + } + return getUpdateDatasetSchemaMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + }; + return DocumentServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + }; + return DocumentServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + }; + return DocumentServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to call Cloud DocumentAI to manage document collection (dataset).
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Updates metadata associated with a dataset.
+     * 
+ */ + default void updateDataset( + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDatasetMethod(), responseObserver); + } + + /** + * + * + *
+     * Import documents into a dataset.
+     * 
+ */ + default void importDocuments( + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns relevant fields present in the requested document.
+     * 
+ */ + default void getDocument( + com.google.cloud.documentai.v1beta3.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of documents present in the dataset.
+     * 
+ */ + default void listDocuments( + com.google.cloud.documentai.v1beta3.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a set of documents.
+     * 
+ */ + default void batchDeleteDocuments( + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchDeleteDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the `DatasetSchema` of a `Dataset`.
+     * 
+ */ + default void getDatasetSchema( + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDatasetSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a `DatasetSchema`.
+     * 
+ */ + default void updateDatasetSchema( + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDatasetSchemaMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentService. + * + *
+   * Service to call Cloud DocumentAI to manage document collection (dataset).
+   * 
+ */ + public abstract static class DocumentServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentService. + * + *
+   * Service to call Cloud DocumentAI to manage document collection (dataset).
+   * 
+ */ + public static final class DocumentServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Updates metadata associated with a dataset.
+     * 
+ */ + public void updateDataset( + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDatasetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Import documents into a dataset.
+     * 
+ */ + public void importDocuments( + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns relevant fields present in the requested document.
+     * 
+ */ + public void getDocument( + com.google.cloud.documentai.v1beta3.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of documents present in the dataset.
+     * 
+ */ + public void listDocuments( + com.google.cloud.documentai.v1beta3.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a set of documents.
+     * 
+ */ + public void batchDeleteDocuments( + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchDeleteDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the `DatasetSchema` of a `Dataset`.
+     * 
+ */ + public void getDatasetSchema( + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDatasetSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a `DatasetSchema`.
+     * 
+ */ + public void updateDatasetSchema( + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDatasetSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentService. + * + *
+   * Service to call Cloud DocumentAI to manage document collection (dataset).
+   * 
+ */ + public static final class DocumentServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Updates metadata associated with a dataset.
+     * 
+ */ + public com.google.longrunning.Operation updateDataset( + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDatasetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Import documents into a dataset.
+     * 
+ */ + public com.google.longrunning.Operation importDocuments( + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns relevant fields present in the requested document.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.GetDocumentResponse getDocument( + com.google.cloud.documentai.v1beta3.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of documents present in the dataset.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.ListDocumentsResponse listDocuments( + com.google.cloud.documentai.v1beta3.ListDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a set of documents.
+     * 
+ */ + public com.google.longrunning.Operation batchDeleteDocuments( + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchDeleteDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the `DatasetSchema` of a `Dataset`.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.DatasetSchema getDatasetSchema( + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDatasetSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a `DatasetSchema`.
+     * 
+ */ + public com.google.cloud.documentai.v1beta3.DatasetSchema updateDatasetSchema( + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDatasetSchemaMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service DocumentService. + * + *
+   * Service to call Cloud DocumentAI to manage document collection (dataset).
+   * 
+ */ + public static final class DocumentServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Updates metadata associated with a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateDataset(com.google.cloud.documentai.v1beta3.UpdateDatasetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDatasetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Import documents into a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importDocuments(com.google.cloud.documentai.v1beta3.ImportDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns relevant fields present in the requested document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.GetDocumentResponse> + getDocument(com.google.cloud.documentai.v1beta3.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of documents present in the dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.ListDocumentsResponse> + listDocuments(com.google.cloud.documentai.v1beta3.ListDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a set of documents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchDeleteDocuments( + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchDeleteDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the `DatasetSchema` of a `Dataset`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.DatasetSchema> + getDatasetSchema(com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDatasetSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a `DatasetSchema`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta3.DatasetSchema> + updateDatasetSchema( + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDatasetSchemaMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_UPDATE_DATASET = 0; + private static final int METHODID_IMPORT_DOCUMENTS = 1; + private static final int METHODID_GET_DOCUMENT = 2; + private static final int METHODID_LIST_DOCUMENTS = 3; + private static final int METHODID_BATCH_DELETE_DOCUMENTS = 4; + private static final int METHODID_GET_DATASET_SCHEMA = 5; + private static final int METHODID_UPDATE_DATASET_SCHEMA = 6; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_UPDATE_DATASET: + serviceImpl.updateDataset( + (com.google.cloud.documentai.v1beta3.UpdateDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_DOCUMENTS: + serviceImpl.importDocuments( + (com.google.cloud.documentai.v1beta3.ImportDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DOCUMENT: + serviceImpl.getDocument( + (com.google.cloud.documentai.v1beta3.GetDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DOCUMENTS: + serviceImpl.listDocuments( + (com.google.cloud.documentai.v1beta3.ListDocumentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.documentai.v1beta3.ListDocumentsResponse>) + responseObserver); + break; + case METHODID_BATCH_DELETE_DOCUMENTS: + serviceImpl.batchDeleteDocuments( + (com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DATASET_SCHEMA: + serviceImpl.getDatasetSchema( + (com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DATASET_SCHEMA: + serviceImpl.updateDatasetSchema( + (com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUpdateDatasetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.UpdateDatasetRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_DATASET))) + .addMethod( + getImportDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ImportDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_IMPORT_DOCUMENTS))) + .addMethod( + getGetDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetDocumentRequest, + com.google.cloud.documentai.v1beta3.GetDocumentResponse>( + service, METHODID_GET_DOCUMENT))) + .addMethod( + getListDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.ListDocumentsRequest, + com.google.cloud.documentai.v1beta3.ListDocumentsResponse>( + service, METHODID_LIST_DOCUMENTS))) + .addMethod( + getBatchDeleteDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_BATCH_DELETE_DOCUMENTS))) + .addMethod( + getGetDatasetSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema>( + service, METHODID_GET_DATASET_SCHEMA))) + .addMethod( + getUpdateDatasetSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, + com.google.cloud.documentai.v1beta3.DatasetSchema>( + service, METHODID_UPDATE_DATASET_SCHEMA))) + .build(); + } + + private abstract static class DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1beta3.DocumentAiDocumentService.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentService"); + } + } + + private static final class DocumentServiceFileDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier { + DocumentServiceFileDescriptorSupplier() {} + } + + private static final class DocumentServiceMethodDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentServiceFileDescriptorSupplier()) + .addMethod(getUpdateDatasetMethod()) + .addMethod(getImportDocumentsMethod()) + .addMethod(getGetDocumentMethod()) + .addMethod(getListDocumentsMethod()) + .addMethod(getBatchDeleteDocumentsMethod()) + .addMethod(getGetDatasetSchemaMethod()) + .addMethod(getUpdateDatasetSchemaMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java new file mode 100644 index 000000000000..e2faafcd1b61 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Barcode.java @@ -0,0 +1,1210 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Encodes the detailed information of a barcode.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Barcode} + */ +public final class Barcode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Barcode) + BarcodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Barcode.newBuilder() to construct. + private Barcode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Barcode() { + format_ = ""; + valueFormat_ = ""; + rawValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Barcode(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Barcode.class, + com.google.cloud.documentai.v1.Barcode.Builder.class); + } + + public static final int FORMAT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object format_ = ""; + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *
+   * - `CODE_128`: Code 128 type.
+   * - `CODE_39`: Code 39 type.
+   * - `CODE_93`: Code 93 type.
+   * - `CODABAR`: Codabar type.
+   * - `DATA_MATRIX`: 2D Data Matrix type.
+   * - `ITF`: ITF type.
+   * - `EAN_13`: EAN-13 type.
+   * - `EAN_8`: EAN-8 type.
+   * - `QR_CODE`: 2D QR code type.
+   * - `UPC_A`: UPC-A type.
+   * - `UPC_E`: UPC-E type.
+   * - `PDF417`: PDF417 type.
+   * - `AZTEC`: 2D Aztec code type.
+   * - `DATABAR`: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + @java.lang.Override + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *
+   * - `CODE_128`: Code 128 type.
+   * - `CODE_39`: Code 39 type.
+   * - `CODE_93`: Code 93 type.
+   * - `CODABAR`: Codabar type.
+   * - `DATA_MATRIX`: 2D Data Matrix type.
+   * - `ITF`: ITF type.
+   * - `EAN_13`: EAN-13 type.
+   * - `EAN_8`: EAN-8 type.
+   * - `QR_CODE`: 2D QR code type.
+   * - `UPC_A`: UPC-A type.
+   * - `UPC_E`: UPC-E type.
+   * - `PDF417`: PDF417 type.
+   * - `AZTEC`: 2D Aztec code type.
+   * - `DATABAR`: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FORMAT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object valueFormat_ = ""; + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *
+   * - `CONTACT_INFO`: Contact information.
+   * - `EMAIL`: Email address.
+   * - `ISBN`: ISBN identifier.
+   * - `PHONE`: Phone number.
+   * - `PRODUCT`: Product.
+   * - `SMS`: SMS message.
+   * - `TEXT`: Text string.
+   * - `URL`: URL address.
+   * - `WIFI`: Wifi information.
+   * - `GEO`: Geo-localization.
+   * - `CALENDAR_EVENT`: Calendar event.
+   * - `DRIVER_LICENSE`: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + @java.lang.Override + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueFormat_ = s; + return s; + } + } + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *
+   * - `CONTACT_INFO`: Contact information.
+   * - `EMAIL`: Email address.
+   * - `ISBN`: ISBN identifier.
+   * - `PHONE`: Phone number.
+   * - `PRODUCT`: Product.
+   * - `SMS`: SMS message.
+   * - `TEXT`: Text string.
+   * - `URL`: URL address.
+   * - `WIFI`: Wifi information.
+   * - `GEO`: Geo-localization.
+   * - `CALENDAR_EVENT`: Calendar event.
+   * - `DRIVER_LICENSE`: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAW_VALUE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object rawValue_ = ""; + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + @java.lang.Override + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawValue_ = s; + return s; + } + } + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rawValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueFormat_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rawValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.Barcode)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Barcode other = (com.google.cloud.documentai.v1.Barcode) obj; + + if (!getFormat().equals(other.getFormat())) return false; + if (!getValueFormat().equals(other.getValueFormat())) return false; + if (!getRawValue().equals(other.getRawValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + VALUE_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getValueFormat().hashCode(); + hash = (37 * hash) + RAW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRawValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Barcode parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.Barcode prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Encodes the detailed information of a barcode.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Barcode} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Barcode) + com.google.cloud.documentai.v1.BarcodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Barcode.class, + com.google.cloud.documentai.v1.Barcode.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Barcode.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + format_ = ""; + valueFormat_ = ""; + rawValue_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.BarcodeProto + .internal_static_google_cloud_documentai_v1_Barcode_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Barcode.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode build() { + com.google.cloud.documentai.v1.Barcode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode buildPartial() { + com.google.cloud.documentai.v1.Barcode result = + new com.google.cloud.documentai.v1.Barcode(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Barcode result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.format_ = format_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueFormat_ = valueFormat_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rawValue_ = rawValue_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.Barcode) { + return mergeFrom((com.google.cloud.documentai.v1.Barcode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Barcode other) { + if (other == com.google.cloud.documentai.v1.Barcode.getDefaultInstance()) return this; + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValueFormat().isEmpty()) { + valueFormat_ = other.valueFormat_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRawValue().isEmpty()) { + rawValue_ = other.rawValue_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + format_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + valueFormat_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + rawValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object format_ = ""; + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *
+     * - `CODE_128`: Code 128 type.
+     * - `CODE_39`: Code 39 type.
+     * - `CODE_93`: Code 93 type.
+     * - `CODABAR`: Codabar type.
+     * - `DATA_MATRIX`: 2D Data Matrix type.
+     * - `ITF`: ITF type.
+     * - `EAN_13`: EAN-13 type.
+     * - `EAN_8`: EAN-8 type.
+     * - `QR_CODE`: 2D QR code type.
+     * - `UPC_A`: UPC-A type.
+     * - `UPC_E`: UPC-E type.
+     * - `PDF417`: PDF417 type.
+     * - `AZTEC`: 2D Aztec code type.
+     * - `DATABAR`: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The format. + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *
+     * - `CODE_128`: Code 128 type.
+     * - `CODE_39`: Code 39 type.
+     * - `CODE_93`: Code 93 type.
+     * - `CODABAR`: Codabar type.
+     * - `DATA_MATRIX`: 2D Data Matrix type.
+     * - `ITF`: ITF type.
+     * - `EAN_13`: EAN-13 type.
+     * - `EAN_8`: EAN-8 type.
+     * - `QR_CODE`: 2D QR code type.
+     * - `UPC_A`: UPC-A type.
+     * - `UPC_E`: UPC-E type.
+     * - `PDF417`: PDF417 type.
+     * - `AZTEC`: 2D Aztec code type.
+     * - `DATABAR`: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *
+     * - `CODE_128`: Code 128 type.
+     * - `CODE_39`: Code 39 type.
+     * - `CODE_93`: Code 93 type.
+     * - `CODABAR`: Codabar type.
+     * - `DATA_MATRIX`: 2D Data Matrix type.
+     * - `ITF`: ITF type.
+     * - `EAN_13`: EAN-13 type.
+     * - `EAN_8`: EAN-8 type.
+     * - `QR_CODE`: 2D QR code type.
+     * - `UPC_A`: UPC-A type.
+     * - `UPC_E`: UPC-E type.
+     * - `PDF417`: PDF417 type.
+     * - `AZTEC`: 2D Aztec code type.
+     * - `DATABAR`: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + format_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *
+     * - `CODE_128`: Code 128 type.
+     * - `CODE_39`: Code 39 type.
+     * - `CODE_93`: Code 93 type.
+     * - `CODABAR`: Codabar type.
+     * - `DATA_MATRIX`: 2D Data Matrix type.
+     * - `ITF`: ITF type.
+     * - `EAN_13`: EAN-13 type.
+     * - `EAN_8`: EAN-8 type.
+     * - `QR_CODE`: 2D QR code type.
+     * - `UPC_A`: UPC-A type.
+     * - `UPC_E`: UPC-E type.
+     * - `PDF417`: PDF417 type.
+     * - `AZTEC`: 2D Aztec code type.
+     * - `DATABAR`: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + format_ = getDefaultInstance().getFormat(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Format of a barcode.
+     * The supported formats are:
+     *
+     * - `CODE_128`: Code 128 type.
+     * - `CODE_39`: Code 39 type.
+     * - `CODE_93`: Code 93 type.
+     * - `CODABAR`: Codabar type.
+     * - `DATA_MATRIX`: 2D Data Matrix type.
+     * - `ITF`: ITF type.
+     * - `EAN_13`: EAN-13 type.
+     * - `EAN_8`: EAN-8 type.
+     * - `QR_CODE`: 2D QR code type.
+     * - `UPC_A`: UPC-A type.
+     * - `UPC_E`: UPC-E type.
+     * - `PDF417`: PDF417 type.
+     * - `AZTEC`: 2D Aztec code type.
+     * - `DATABAR`: GS1 DataBar code type.
+     * 
+ * + * string format = 1; + * + * @param value The bytes for format to set. + * @return This builder for chaining. + */ + public Builder setFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + format_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object valueFormat_ = ""; + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *
+     * - `CONTACT_INFO`: Contact information.
+     * - `EMAIL`: Email address.
+     * - `ISBN`: ISBN identifier.
+     * - `PHONE`: Phone number.
+     * - `PRODUCT`: Product.
+     * - `SMS`: SMS message.
+     * - `TEXT`: Text string.
+     * - `URL`: URL address.
+     * - `WIFI`: Wifi information.
+     * - `GEO`: Geo-localization.
+     * - `CALENDAR_EVENT`: Calendar event.
+     * - `DRIVER_LICENSE`: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + public java.lang.String getValueFormat() { + java.lang.Object ref = valueFormat_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueFormat_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *
+     * - `CONTACT_INFO`: Contact information.
+     * - `EMAIL`: Email address.
+     * - `ISBN`: ISBN identifier.
+     * - `PHONE`: Phone number.
+     * - `PRODUCT`: Product.
+     * - `SMS`: SMS message.
+     * - `TEXT`: Text string.
+     * - `URL`: URL address.
+     * - `WIFI`: Wifi information.
+     * - `GEO`: Geo-localization.
+     * - `CALENDAR_EVENT`: Calendar event.
+     * - `DRIVER_LICENSE`: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + public com.google.protobuf.ByteString getValueFormatBytes() { + java.lang.Object ref = valueFormat_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *
+     * - `CONTACT_INFO`: Contact information.
+     * - `EMAIL`: Email address.
+     * - `ISBN`: ISBN identifier.
+     * - `PHONE`: Phone number.
+     * - `PRODUCT`: Product.
+     * - `SMS`: SMS message.
+     * - `TEXT`: Text string.
+     * - `URL`: URL address.
+     * - `WIFI`: Wifi information.
+     * - `GEO`: Geo-localization.
+     * - `CALENDAR_EVENT`: Calendar event.
+     * - `DRIVER_LICENSE`: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *
+     * - `CONTACT_INFO`: Contact information.
+     * - `EMAIL`: Email address.
+     * - `ISBN`: ISBN identifier.
+     * - `PHONE`: Phone number.
+     * - `PRODUCT`: Product.
+     * - `SMS`: SMS message.
+     * - `TEXT`: Text string.
+     * - `URL`: URL address.
+     * - `WIFI`: Wifi information.
+     * - `GEO`: Geo-localization.
+     * - `CALENDAR_EVENT`: Calendar event.
+     * - `DRIVER_LICENSE`: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @return This builder for chaining. + */ + public Builder clearValueFormat() { + valueFormat_ = getDefaultInstance().getValueFormat(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Value format describes the format of the value that a barcode
+     * encodes.
+     * The supported formats are:
+     *
+     * - `CONTACT_INFO`: Contact information.
+     * - `EMAIL`: Email address.
+     * - `ISBN`: ISBN identifier.
+     * - `PHONE`: Phone number.
+     * - `PRODUCT`: Product.
+     * - `SMS`: SMS message.
+     * - `TEXT`: Text string.
+     * - `URL`: URL address.
+     * - `WIFI`: Wifi information.
+     * - `GEO`: Geo-localization.
+     * - `CALENDAR_EVENT`: Calendar event.
+     * - `DRIVER_LICENSE`: Driver's license.
+     * 
+ * + * string value_format = 2; + * + * @param value The bytes for valueFormat to set. + * @return This builder for chaining. + */ + public Builder setValueFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object rawValue_ = ""; + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+     * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + public java.lang.String getRawValue() { + java.lang.Object ref = rawValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+     * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + public com.google.protobuf.ByteString getRawValueBytes() { + java.lang.Object ref = rawValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+     * 
+ * + * string raw_value = 3; + * + * @param value The rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rawValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+     * 
+ * + * string raw_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearRawValue() { + rawValue_ = getDefaultInstance().getRawValue(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw value encoded in the barcode.
+     * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+     * 
+ * + * string raw_value = 3; + * + * @param value The bytes for rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rawValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Barcode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Barcode) + private static final com.google.cloud.documentai.v1.Barcode DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Barcode(); + } + + public static com.google.cloud.documentai.v1.Barcode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Barcode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Barcode getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java new file mode 100644 index 000000000000..af8b62ce7be0 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +public interface BarcodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Barcode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *
+   * - `CODE_128`: Code 128 type.
+   * - `CODE_39`: Code 39 type.
+   * - `CODE_93`: Code 93 type.
+   * - `CODABAR`: Codabar type.
+   * - `DATA_MATRIX`: 2D Data Matrix type.
+   * - `ITF`: ITF type.
+   * - `EAN_13`: EAN-13 type.
+   * - `EAN_8`: EAN-8 type.
+   * - `QR_CODE`: 2D QR code type.
+   * - `UPC_A`: UPC-A type.
+   * - `UPC_E`: UPC-E type.
+   * - `PDF417`: PDF417 type.
+   * - `AZTEC`: 2D Aztec code type.
+   * - `DATABAR`: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The format. + */ + java.lang.String getFormat(); + /** + * + * + *
+   * Format of a barcode.
+   * The supported formats are:
+   *
+   * - `CODE_128`: Code 128 type.
+   * - `CODE_39`: Code 39 type.
+   * - `CODE_93`: Code 93 type.
+   * - `CODABAR`: Codabar type.
+   * - `DATA_MATRIX`: 2D Data Matrix type.
+   * - `ITF`: ITF type.
+   * - `EAN_13`: EAN-13 type.
+   * - `EAN_8`: EAN-8 type.
+   * - `QR_CODE`: 2D QR code type.
+   * - `UPC_A`: UPC-A type.
+   * - `UPC_E`: UPC-E type.
+   * - `PDF417`: PDF417 type.
+   * - `AZTEC`: 2D Aztec code type.
+   * - `DATABAR`: GS1 DataBar code type.
+   * 
+ * + * string format = 1; + * + * @return The bytes for format. + */ + com.google.protobuf.ByteString getFormatBytes(); + + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *
+   * - `CONTACT_INFO`: Contact information.
+   * - `EMAIL`: Email address.
+   * - `ISBN`: ISBN identifier.
+   * - `PHONE`: Phone number.
+   * - `PRODUCT`: Product.
+   * - `SMS`: SMS message.
+   * - `TEXT`: Text string.
+   * - `URL`: URL address.
+   * - `WIFI`: Wifi information.
+   * - `GEO`: Geo-localization.
+   * - `CALENDAR_EVENT`: Calendar event.
+   * - `DRIVER_LICENSE`: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The valueFormat. + */ + java.lang.String getValueFormat(); + /** + * + * + *
+   * Value format describes the format of the value that a barcode
+   * encodes.
+   * The supported formats are:
+   *
+   * - `CONTACT_INFO`: Contact information.
+   * - `EMAIL`: Email address.
+   * - `ISBN`: ISBN identifier.
+   * - `PHONE`: Phone number.
+   * - `PRODUCT`: Product.
+   * - `SMS`: SMS message.
+   * - `TEXT`: Text string.
+   * - `URL`: URL address.
+   * - `WIFI`: Wifi information.
+   * - `GEO`: Geo-localization.
+   * - `CALENDAR_EVENT`: Calendar event.
+   * - `DRIVER_LICENSE`: Driver's license.
+   * 
+ * + * string value_format = 2; + * + * @return The bytes for valueFormat. + */ + com.google.protobuf.ByteString getValueFormatBytes(); + + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+   * 
+ * + * string raw_value = 3; + * + * @return The rawValue. + */ + java.lang.String getRawValue(); + /** + * + * + *
+   * Raw value encoded in the barcode.
+   * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
+   * 
+ * + * string raw_value = 3; + * + * @return The bytes for rawValue. + */ + com.google.protobuf.ByteString getRawValueBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java new file mode 100644 index 000000000000..5d559a2bcd05 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BarcodeProto.java @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/barcode.proto + +package com.google.cloud.documentai.v1; + +public final class BarcodeProto { + private BarcodeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Barcode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/documentai/v1/barcode.pro" + + "to\022\032google.cloud.documentai.v1\"B\n\007Barcod" + + "e\022\016\n\006format\030\001 \001(\t\022\024\n\014value_format\030\002 \001(\t\022" + + "\021\n\traw_value\030\003 \001(\tB\312\001\n\036com.google.cloud." + + "documentai.v1B\014BarcodeProtoP\001Z>cloud.goo" + + "gle.com/go/documentai/apiv1/documentaipb" + + ";documentaipb\252\002\032Google.Cloud.DocumentAI." + + "V1\312\002\032Google\\Cloud\\DocumentAI\\V1\352\002\035Google" + + "::Cloud::DocumentAI::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_documentai_v1_Barcode_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_Barcode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Barcode_descriptor, + new java.lang.String[] { + "Format", "ValueFormat", "RawValue", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfig.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfig.java new file mode 100644 index 000000000000..c23a6f8525ab --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfig.java @@ -0,0 +1,1112 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_io.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The common config to specify a set of documents used as input.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchDocumentsInputConfig} + */ +public final class BatchDocumentsInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BatchDocumentsInputConfig) + BatchDocumentsInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchDocumentsInputConfig.newBuilder() to construct. + private BatchDocumentsInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchDocumentsInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchDocumentsInputConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentIoProto + .internal_static_google_cloud_documentai_v1_BatchDocumentsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentIoProto + .internal_static_google_cloud_documentai_v1_BatchDocumentsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.class, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + GCS_DOCUMENTS(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 2: + return GCS_DOCUMENTS; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsPrefix getGcsPrefix() { + if (sourceCase_ == 1) { + return (com.google.cloud.documentai.v1.GcsPrefix) source_; + } + return com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsPrefixOrBuilder getGcsPrefixOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.documentai.v1.GcsPrefix) source_; + } + return com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } + + public static final int GCS_DOCUMENTS_FIELD_NUMBER = 2; + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return Whether the gcsDocuments field is set. + */ + @java.lang.Override + public boolean hasGcsDocuments() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return The gcsDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsDocuments getGcsDocuments() { + if (sourceCase_ == 2) { + return (com.google.cloud.documentai.v1.GcsDocuments) source_; + } + return com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsDocumentsOrBuilder getGcsDocumentsOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.documentai.v1.GcsDocuments) source_; + } + return com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } + + 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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.documentai.v1.GcsPrefix) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.documentai.v1.GcsDocuments) source_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.documentai.v1.GcsPrefix) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.documentai.v1.GcsDocuments) source_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.BatchDocumentsInputConfig)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BatchDocumentsInputConfig other = + (com.google.cloud.documentai.v1.BatchDocumentsInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 2: + if (!getGcsDocuments().equals(other.getGcsDocuments())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getGcsDocuments().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig 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 common config to specify a set of documents used as input.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchDocumentsInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BatchDocumentsInputConfig) + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentIoProto + .internal_static_google_cloud_documentai_v1_BatchDocumentsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentIoProto + .internal_static_google_cloud_documentai_v1_BatchDocumentsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.class, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.BatchDocumentsInputConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gcsPrefixBuilder_ != null) { + gcsPrefixBuilder_.clear(); + } + if (gcsDocumentsBuilder_ != null) { + gcsDocumentsBuilder_.clear(); + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentIoProto + .internal_static_google_cloud_documentai_v1_BatchDocumentsInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig build() { + com.google.cloud.documentai.v1.BatchDocumentsInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig buildPartial() { + com.google.cloud.documentai.v1.BatchDocumentsInputConfig result = + new com.google.cloud.documentai.v1.BatchDocumentsInputConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.BatchDocumentsInputConfig result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 1 && gcsPrefixBuilder_ != null) { + result.source_ = gcsPrefixBuilder_.build(); + } + if (sourceCase_ == 2 && gcsDocumentsBuilder_ != null) { + result.source_ = gcsDocumentsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.BatchDocumentsInputConfig) { + return mergeFrom((com.google.cloud.documentai.v1.BatchDocumentsInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.BatchDocumentsInputConfig other) { + if (other == com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case GCS_PREFIX: + { + mergeGcsPrefix(other.getGcsPrefix()); + break; + } + case GCS_DOCUMENTS: + { + mergeGcsDocuments(other.getGcsDocuments()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsPrefixFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getGcsDocumentsFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsPrefix, + com.google.cloud.documentai.v1.GcsPrefix.Builder, + com.google.cloud.documentai.v1.GcsPrefixOrBuilder> + gcsPrefixBuilder_; + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsPrefix getGcsPrefix() { + if (gcsPrefixBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.documentai.v1.GcsPrefix) source_; + } + return com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsPrefixBuilder_.getMessage(); + } + return com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + public Builder setGcsPrefix(com.google.cloud.documentai.v1.GcsPrefix value) { + if (gcsPrefixBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsPrefixBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + public Builder setGcsPrefix(com.google.cloud.documentai.v1.GcsPrefix.Builder builderForValue) { + if (gcsPrefixBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsPrefixBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + public Builder mergeGcsPrefix(com.google.cloud.documentai.v1.GcsPrefix value) { + if (gcsPrefixBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance()) { + source_ = + com.google.cloud.documentai.v1.GcsPrefix.newBuilder( + (com.google.cloud.documentai.v1.GcsPrefix) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + gcsPrefixBuilder_.mergeFrom(value); + } else { + gcsPrefixBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + public Builder clearGcsPrefix() { + if (gcsPrefixBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + gcsPrefixBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + public com.google.cloud.documentai.v1.GcsPrefix.Builder getGcsPrefixBuilder() { + return getGcsPrefixFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsPrefixOrBuilder getGcsPrefixOrBuilder() { + if ((sourceCase_ == 1) && (gcsPrefixBuilder_ != null)) { + return gcsPrefixBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.documentai.v1.GcsPrefix) source_; + } + return com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } + } + /** + * + * + *
+     * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+     * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsPrefix, + com.google.cloud.documentai.v1.GcsPrefix.Builder, + com.google.cloud.documentai.v1.GcsPrefixOrBuilder> + getGcsPrefixFieldBuilder() { + if (gcsPrefixBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.documentai.v1.GcsPrefix.getDefaultInstance(); + } + gcsPrefixBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsPrefix, + com.google.cloud.documentai.v1.GcsPrefix.Builder, + com.google.cloud.documentai.v1.GcsPrefixOrBuilder>( + (com.google.cloud.documentai.v1.GcsPrefix) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + return gcsPrefixBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsDocuments, + com.google.cloud.documentai.v1.GcsDocuments.Builder, + com.google.cloud.documentai.v1.GcsDocumentsOrBuilder> + gcsDocumentsBuilder_; + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return Whether the gcsDocuments field is set. + */ + @java.lang.Override + public boolean hasGcsDocuments() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return The gcsDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsDocuments getGcsDocuments() { + if (gcsDocumentsBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.documentai.v1.GcsDocuments) source_; + } + return com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsDocumentsBuilder_.getMessage(); + } + return com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + public Builder setGcsDocuments(com.google.cloud.documentai.v1.GcsDocuments value) { + if (gcsDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsDocumentsBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + public Builder setGcsDocuments( + com.google.cloud.documentai.v1.GcsDocuments.Builder builderForValue) { + if (gcsDocumentsBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsDocumentsBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + public Builder mergeGcsDocuments(com.google.cloud.documentai.v1.GcsDocuments value) { + if (gcsDocumentsBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance()) { + source_ = + com.google.cloud.documentai.v1.GcsDocuments.newBuilder( + (com.google.cloud.documentai.v1.GcsDocuments) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsDocumentsBuilder_.mergeFrom(value); + } else { + gcsDocumentsBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + public Builder clearGcsDocuments() { + if (gcsDocumentsBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsDocumentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + public com.google.cloud.documentai.v1.GcsDocuments.Builder getGcsDocumentsBuilder() { + return getGcsDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.GcsDocumentsOrBuilder getGcsDocumentsOrBuilder() { + if ((sourceCase_ == 2) && (gcsDocumentsBuilder_ != null)) { + return gcsDocumentsBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.documentai.v1.GcsDocuments) source_; + } + return com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } + } + /** + * + * + *
+     * The set of documents individually specified on Cloud Storage.
+     * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsDocuments, + com.google.cloud.documentai.v1.GcsDocuments.Builder, + com.google.cloud.documentai.v1.GcsDocumentsOrBuilder> + getGcsDocumentsFieldBuilder() { + if (gcsDocumentsBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.documentai.v1.GcsDocuments.getDefaultInstance(); + } + gcsDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.GcsDocuments, + com.google.cloud.documentai.v1.GcsDocuments.Builder, + com.google.cloud.documentai.v1.GcsDocumentsOrBuilder>( + (com.google.cloud.documentai.v1.GcsDocuments) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + return gcsDocumentsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BatchDocumentsInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BatchDocumentsInputConfig) + private static final com.google.cloud.documentai.v1.BatchDocumentsInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.BatchDocumentsInputConfig(); + } + + public static com.google.cloud.documentai.v1.BatchDocumentsInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchDocumentsInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfigOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfigOrBuilder.java new file mode 100644 index 000000000000..4662cd1e715b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchDocumentsInputConfigOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_io.proto + +package com.google.cloud.documentai.v1; + +public interface BatchDocumentsInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BatchDocumentsInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + com.google.cloud.documentai.v1.GcsPrefix getGcsPrefix(); + /** + * + * + *
+   * The set of documents that match the specified Cloud Storage `gcs_prefix`.
+   * 
+ * + * .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + */ + com.google.cloud.documentai.v1.GcsPrefixOrBuilder getGcsPrefixOrBuilder(); + + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return Whether the gcsDocuments field is set. + */ + boolean hasGcsDocuments(); + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * + * @return The gcsDocuments. + */ + com.google.cloud.documentai.v1.GcsDocuments getGcsDocuments(); + /** + * + * + *
+   * The set of documents individually specified on Cloud Storage.
+   * 
+ * + * .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + */ + com.google.cloud.documentai.v1.GcsDocumentsOrBuilder getGcsDocumentsOrBuilder(); + + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.SourceCase getSourceCase(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java new file mode 100644 index 000000000000..e11e3ab6e659 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadata.java @@ -0,0 +1,3650 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long-running operation metadata for
+ * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessMetadata} + */ +public final class BatchProcessMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BatchProcessMetadata) + BatchProcessMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchProcessMetadata.newBuilder() to construct. + private BatchProcessMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchProcessMetadata() { + state_ = 0; + stateMessage_ = ""; + individualProcessStatuses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessMetadata.class, + com.google.cloud.documentai.v1.BatchProcessMetadata.Builder.class); + } + + /** + * + * + *
+   * Possible states of the batch processing operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1.BatchProcessMetadata.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Request operation is waiting for scheduling.
+     * 
+ * + * WAITING = 1; + */ + WAITING(1), + /** + * + * + *
+     * Request is being processed.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * The batch processing completed successfully.
+     * 
+ * + * SUCCEEDED = 3; + */ + SUCCEEDED(3), + /** + * + * + *
+     * The batch processing was being cancelled.
+     * 
+ * + * CANCELLING = 4; + */ + CANCELLING(4), + /** + * + * + *
+     * The batch processing was cancelled.
+     * 
+ * + * CANCELLED = 5; + */ + CANCELLED(5), + /** + * + * + *
+     * The batch processing has failed.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Request operation is waiting for scheduling.
+     * 
+ * + * WAITING = 1; + */ + public static final int WAITING_VALUE = 1; + /** + * + * + *
+     * Request is being processed.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + /** + * + * + *
+     * The batch processing completed successfully.
+     * 
+ * + * SUCCEEDED = 3; + */ + public static final int SUCCEEDED_VALUE = 3; + /** + * + * + *
+     * The batch processing was being cancelled.
+     * 
+ * + * CANCELLING = 4; + */ + public static final int CANCELLING_VALUE = 4; + /** + * + * + *
+     * The batch processing was cancelled.
+     * 
+ * + * CANCELLED = 5; + */ + public static final int CANCELLED_VALUE = 5; + /** + * + * + *
+     * The batch processing has failed.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + + 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 WAITING; + case 2: + return RUNNING; + case 3: + return SUCCEEDED; + case 4: + return CANCELLING; + case 5: + return CANCELLED; + case 6: + return FAILED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.documentai.v1.BatchProcessMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1.BatchProcessMetadata.State) + } + + public interface IndividualProcessStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The source of the document, same as the
+     * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+     * field in the request when the batch process started.
+     * 
+ * + * string input_gcs_source = 1; + * + * @return The inputGcsSource. + */ + java.lang.String getInputGcsSource(); + /** + * + * + *
+     * The source of the document, same as the
+     * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+     * field in the request when the batch process started.
+     * 
+ * + * string input_gcs_source = 1; + * + * @return The bytes for inputGcsSource. + */ + com.google.protobuf.ByteString getInputGcsSourceBytes(); + + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+     * The Cloud Storage output destination (in the request as
+     * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+     * of the processed document if it was successful, otherwise empty.
+     * 
+ * + * string output_gcs_destination = 3; + * + * @return The outputGcsDestination. + */ + java.lang.String getOutputGcsDestination(); + /** + * + * + *
+     * The Cloud Storage output destination (in the request as
+     * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+     * of the processed document if it was successful, otherwise empty.
+     * 
+ * + * string output_gcs_destination = 3; + * + * @return The bytes for outputGcsDestination. + */ + com.google.protobuf.ByteString getOutputGcsDestinationBytes(); + + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return Whether the humanReviewStatus field is set. + */ + boolean hasHumanReviewStatus(); + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return The humanReviewStatus. + */ + com.google.cloud.documentai.v1.HumanReviewStatus getHumanReviewStatus(); + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder getHumanReviewStatusOrBuilder(); + } + /** + * + * + *
+   * The status of a each individual document in the batch process.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} + */ + public static final class IndividualProcessStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + IndividualProcessStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndividualProcessStatus.newBuilder() to construct. + private IndividualProcessStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndividualProcessStatus() { + inputGcsSource_ = ""; + outputGcsDestination_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IndividualProcessStatus(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.class, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + .class); + } + + public static final int INPUT_GCS_SOURCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object inputGcsSource_ = ""; + /** + * + * + *
+     * The source of the document, same as the
+     * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+     * field in the request when the batch process started.
+     * 
+ * + * string input_gcs_source = 1; + * + * @return The inputGcsSource. + */ + @java.lang.Override + public java.lang.String getInputGcsSource() { + java.lang.Object ref = inputGcsSource_; + 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(); + inputGcsSource_ = s; + return s; + } + } + /** + * + * + *
+     * The source of the document, same as the
+     * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+     * field in the request when the batch process started.
+     * 
+ * + * string input_gcs_source = 1; + * + * @return The bytes for inputGcsSource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputGcsSourceBytes() { + java.lang.Object ref = inputGcsSource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputGcsSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 2; + private com.google.rpc.Status status_; + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+     * The status processing the document.
+     * 
+ * + * .google.rpc.Status status = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int OUTPUT_GCS_DESTINATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputGcsDestination_ = ""; + /** + * + * + *
+     * The Cloud Storage output destination (in the request as
+     * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+     * of the processed document if it was successful, otherwise empty.
+     * 
+ * + * string output_gcs_destination = 3; + * + * @return The outputGcsDestination. + */ + @java.lang.Override + public java.lang.String getOutputGcsDestination() { + java.lang.Object ref = outputGcsDestination_; + 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(); + outputGcsDestination_ = s; + return s; + } + } + /** + * + * + *
+     * The Cloud Storage output destination (in the request as
+     * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+     * of the processed document if it was successful, otherwise empty.
+     * 
+ * + * string output_gcs_destination = 3; + * + * @return The bytes for outputGcsDestination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputGcsDestinationBytes() { + java.lang.Object ref = outputGcsDestination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputGcsDestination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HUMAN_REVIEW_STATUS_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.HumanReviewStatus humanReviewStatus_; + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return Whether the humanReviewStatus field is set. + */ + @java.lang.Override + public boolean hasHumanReviewStatus() { + return humanReviewStatus_ != null; + } + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return The humanReviewStatus. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.HumanReviewStatus getHumanReviewStatus() { + return humanReviewStatus_ == null + ? com.google.cloud.documentai.v1.HumanReviewStatus.getDefaultInstance() + : humanReviewStatus_; + } + /** + * + * + *
+     * The status of human review on the processed document.
+     * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder + getHumanReviewStatusOrBuilder() { + return humanReviewStatus_ == null + ? com.google.cloud.documentai.v1.HumanReviewStatus.getDefaultInstance() + : humanReviewStatus_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputGcsSource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputGcsSource_); + } + if (status_ != null) { + output.writeMessage(2, getStatus()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputGcsDestination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, outputGcsDestination_); + } + if (humanReviewStatus_ != null) { + output.writeMessage(5, getHumanReviewStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputGcsSource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputGcsSource_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputGcsDestination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, outputGcsDestination_); + } + if (humanReviewStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getHumanReviewStatus()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus other = + (com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) obj; + + if (!getInputGcsSource().equals(other.getInputGcsSource())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getOutputGcsDestination().equals(other.getOutputGcsDestination())) return false; + if (hasHumanReviewStatus() != other.hasHumanReviewStatus()) return false; + if (hasHumanReviewStatus()) { + if (!getHumanReviewStatus().equals(other.getHumanReviewStatus())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INPUT_GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getInputGcsSource().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + OUTPUT_GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getOutputGcsDestination().hashCode(); + if (hasHumanReviewStatus()) { + hash = (37 * hash) + HUMAN_REVIEW_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getHumanReviewStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus 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 status of a each individual document in the batch process.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.class, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + .class); + } + + // Construct using + // com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputGcsSource_ = ""; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + outputGcsDestination_ = ""; + humanReviewStatus_ = null; + if (humanReviewStatusBuilder_ != null) { + humanReviewStatusBuilder_.dispose(); + humanReviewStatusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_IndividualProcessStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus build() { + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + buildPartial() { + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus result = + new com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputGcsSource_ = inputGcsSource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputGcsDestination_ = outputGcsDestination_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.humanReviewStatus_ = + humanReviewStatusBuilder_ == null + ? humanReviewStatus_ + : humanReviewStatusBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) { + return mergeFrom( + (com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus other) { + if (other + == com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + .getDefaultInstance()) return this; + if (!other.getInputGcsSource().isEmpty()) { + inputGcsSource_ = other.inputGcsSource_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (!other.getOutputGcsDestination().isEmpty()) { + outputGcsDestination_ = other.outputGcsDestination_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasHumanReviewStatus()) { + mergeHumanReviewStatus(other.getHumanReviewStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + inputGcsSource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + outputGcsDestination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + getHumanReviewStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object inputGcsSource_ = ""; + /** + * + * + *
+       * The source of the document, same as the
+       * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+       * field in the request when the batch process started.
+       * 
+ * + * string input_gcs_source = 1; + * + * @return The inputGcsSource. + */ + public java.lang.String getInputGcsSource() { + java.lang.Object ref = inputGcsSource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputGcsSource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The source of the document, same as the
+       * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+       * field in the request when the batch process started.
+       * 
+ * + * string input_gcs_source = 1; + * + * @return The bytes for inputGcsSource. + */ + public com.google.protobuf.ByteString getInputGcsSourceBytes() { + java.lang.Object ref = inputGcsSource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputGcsSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The source of the document, same as the
+       * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+       * field in the request when the batch process started.
+       * 
+ * + * string input_gcs_source = 1; + * + * @param value The inputGcsSource to set. + * @return This builder for chaining. + */ + public Builder setInputGcsSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + inputGcsSource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The source of the document, same as the
+       * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+       * field in the request when the batch process started.
+       * 
+ * + * string input_gcs_source = 1; + * + * @return This builder for chaining. + */ + public Builder clearInputGcsSource() { + inputGcsSource_ = getDefaultInstance().getInputGcsSource(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The source of the document, same as the
+       * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
+       * field in the request when the batch process started.
+       * 
+ * + * string input_gcs_source = 1; + * + * @param value The bytes for inputGcsSource to set. + * @return This builder for chaining. + */ + public Builder setInputGcsSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + inputGcsSource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+       * The status processing the document.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private java.lang.Object outputGcsDestination_ = ""; + /** + * + * + *
+       * The Cloud Storage output destination (in the request as
+       * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+       * of the processed document if it was successful, otherwise empty.
+       * 
+ * + * string output_gcs_destination = 3; + * + * @return The outputGcsDestination. + */ + public java.lang.String getOutputGcsDestination() { + java.lang.Object ref = outputGcsDestination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputGcsDestination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Cloud Storage output destination (in the request as
+       * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+       * of the processed document if it was successful, otherwise empty.
+       * 
+ * + * string output_gcs_destination = 3; + * + * @return The bytes for outputGcsDestination. + */ + public com.google.protobuf.ByteString getOutputGcsDestinationBytes() { + java.lang.Object ref = outputGcsDestination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputGcsDestination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Cloud Storage output destination (in the request as
+       * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+       * of the processed document if it was successful, otherwise empty.
+       * 
+ * + * string output_gcs_destination = 3; + * + * @param value The outputGcsDestination to set. + * @return This builder for chaining. + */ + public Builder setOutputGcsDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputGcsDestination_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage output destination (in the request as
+       * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+       * of the processed document if it was successful, otherwise empty.
+       * 
+ * + * string output_gcs_destination = 3; + * + * @return This builder for chaining. + */ + public Builder clearOutputGcsDestination() { + outputGcsDestination_ = getDefaultInstance().getOutputGcsDestination(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage output destination (in the request as
+       * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
+       * of the processed document if it was successful, otherwise empty.
+       * 
+ * + * string output_gcs_destination = 3; + * + * @param value The bytes for outputGcsDestination to set. + * @return This builder for chaining. + */ + public Builder setOutputGcsDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputGcsDestination_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.HumanReviewStatus humanReviewStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.HumanReviewStatus, + com.google.cloud.documentai.v1.HumanReviewStatus.Builder, + com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder> + humanReviewStatusBuilder_; + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return Whether the humanReviewStatus field is set. + */ + public boolean hasHumanReviewStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * + * @return The humanReviewStatus. + */ + public com.google.cloud.documentai.v1.HumanReviewStatus getHumanReviewStatus() { + if (humanReviewStatusBuilder_ == null) { + return humanReviewStatus_ == null + ? com.google.cloud.documentai.v1.HumanReviewStatus.getDefaultInstance() + : humanReviewStatus_; + } else { + return humanReviewStatusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public Builder setHumanReviewStatus(com.google.cloud.documentai.v1.HumanReviewStatus value) { + if (humanReviewStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + humanReviewStatus_ = value; + } else { + humanReviewStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public Builder setHumanReviewStatus( + com.google.cloud.documentai.v1.HumanReviewStatus.Builder builderForValue) { + if (humanReviewStatusBuilder_ == null) { + humanReviewStatus_ = builderForValue.build(); + } else { + humanReviewStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public Builder mergeHumanReviewStatus( + com.google.cloud.documentai.v1.HumanReviewStatus value) { + if (humanReviewStatusBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && humanReviewStatus_ != null + && humanReviewStatus_ + != com.google.cloud.documentai.v1.HumanReviewStatus.getDefaultInstance()) { + getHumanReviewStatusBuilder().mergeFrom(value); + } else { + humanReviewStatus_ = value; + } + } else { + humanReviewStatusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public Builder clearHumanReviewStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + humanReviewStatus_ = null; + if (humanReviewStatusBuilder_ != null) { + humanReviewStatusBuilder_.dispose(); + humanReviewStatusBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public com.google.cloud.documentai.v1.HumanReviewStatus.Builder + getHumanReviewStatusBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getHumanReviewStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + public com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder + getHumanReviewStatusOrBuilder() { + if (humanReviewStatusBuilder_ != null) { + return humanReviewStatusBuilder_.getMessageOrBuilder(); + } else { + return humanReviewStatus_ == null + ? com.google.cloud.documentai.v1.HumanReviewStatus.getDefaultInstance() + : humanReviewStatus_; + } + } + /** + * + * + *
+       * The status of human review on the processed document.
+       * 
+ * + * .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.HumanReviewStatus, + com.google.cloud.documentai.v1.HumanReviewStatus.Builder, + com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder> + getHumanReviewStatusFieldBuilder() { + if (humanReviewStatusBuilder_ == null) { + humanReviewStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.HumanReviewStatus, + com.google.cloud.documentai.v1.HumanReviewStatus.Builder, + com.google.cloud.documentai.v1.HumanReviewStatusOrBuilder>( + getHumanReviewStatus(), getParentForChildren(), isClean()); + humanReviewStatus_ = null; + } + return humanReviewStatusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + private static final com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus(); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndividualProcessStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + * + * + *
+   * The state of the current batch processing.
+   * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the current batch processing.
+   * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.State getState() { + com.google.cloud.documentai.v1.BatchProcessMetadata.State result = + com.google.cloud.documentai.v1.BatchProcessMetadata.State.forNumber(state_); + return result == null + ? com.google.cloud.documentai.v1.BatchProcessMetadata.State.UNRECOGNIZED + : result; + } + + public static final int STATE_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateMessage_ = ""; + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * For example, the error message if the operation is failed.
+   * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + @java.lang.Override + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + 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(); + stateMessage_ = s; + return s; + } + } + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * For example, the error message if the operation is failed.
+   * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int INDIVIDUAL_PROCESS_STATUSES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus> + individualProcessStatuses_; + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + @java.lang.Override + public java.util.List + getIndividualProcessStatusesList() { + return individualProcessStatuses_; + } + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder> + getIndividualProcessStatusesOrBuilderList() { + return individualProcessStatuses_; + } + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + @java.lang.Override + public int getIndividualProcessStatusesCount() { + return individualProcessStatuses_.size(); + } + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getIndividualProcessStatuses(int index) { + return individualProcessStatuses_.get(index); + } + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder + getIndividualProcessStatusesOrBuilder(int index) { + return individualProcessStatuses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.documentai.v1.BatchProcessMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, stateMessage_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + for (int i = 0; i < individualProcessStatuses_.size(); i++) { + output.writeMessage(5, individualProcessStatuses_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.documentai.v1.BatchProcessMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, stateMessage_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + for (int i = 0; i < individualProcessStatuses_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, individualProcessStatuses_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.BatchProcessMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BatchProcessMetadata other = + (com.google.cloud.documentai.v1.BatchProcessMetadata) obj; + + if (state_ != other.state_) return false; + if (!getStateMessage().equals(other.getStateMessage())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getIndividualProcessStatusesList().equals(other.getIndividualProcessStatusesList())) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATE_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStateMessage().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (getIndividualProcessStatusesCount() > 0) { + hash = (37 * hash) + INDIVIDUAL_PROCESS_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + getIndividualProcessStatusesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.BatchProcessMetadata 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
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BatchProcessMetadata) + com.google.cloud.documentai.v1.BatchProcessMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessMetadata.class, + com.google.cloud.documentai.v1.BatchProcessMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.BatchProcessMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + stateMessage_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + if (individualProcessStatusesBuilder_ == null) { + individualProcessStatuses_ = java.util.Collections.emptyList(); + } else { + individualProcessStatuses_ = null; + individualProcessStatusesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BatchProcessMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata build() { + com.google.cloud.documentai.v1.BatchProcessMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata buildPartial() { + com.google.cloud.documentai.v1.BatchProcessMetadata result = + new com.google.cloud.documentai.v1.BatchProcessMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.documentai.v1.BatchProcessMetadata result) { + if (individualProcessStatusesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + individualProcessStatuses_ = + java.util.Collections.unmodifiableList(individualProcessStatuses_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.individualProcessStatuses_ = individualProcessStatuses_; + } else { + result.individualProcessStatuses_ = individualProcessStatusesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.documentai.v1.BatchProcessMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateMessage_ = stateMessage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.BatchProcessMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.BatchProcessMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.BatchProcessMetadata other) { + if (other == com.google.cloud.documentai.v1.BatchProcessMetadata.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStateMessage().isEmpty()) { + stateMessage_ = other.stateMessage_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (individualProcessStatusesBuilder_ == null) { + if (!other.individualProcessStatuses_.isEmpty()) { + if (individualProcessStatuses_.isEmpty()) { + individualProcessStatuses_ = other.individualProcessStatuses_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.addAll(other.individualProcessStatuses_); + } + onChanged(); + } + } else { + if (!other.individualProcessStatuses_.isEmpty()) { + if (individualProcessStatusesBuilder_.isEmpty()) { + individualProcessStatusesBuilder_.dispose(); + individualProcessStatusesBuilder_ = null; + individualProcessStatuses_ = other.individualProcessStatuses_; + bitField0_ = (bitField0_ & ~0x00000010); + individualProcessStatusesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndividualProcessStatusesFieldBuilder() + : null; + } else { + individualProcessStatusesBuilder_.addAllMessages(other.individualProcessStatuses_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + stateMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus m = + input.readMessage( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + .parser(), + extensionRegistry); + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.add(m); + } else { + individualProcessStatusesBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * The state of the current batch processing.
+     * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the current batch processing.
+     * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the current batch processing.
+     * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata.State getState() { + com.google.cloud.documentai.v1.BatchProcessMetadata.State result = + com.google.cloud.documentai.v1.BatchProcessMetadata.State.forNumber(state_); + return result == null + ? com.google.cloud.documentai.v1.BatchProcessMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the current batch processing.
+     * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1.BatchProcessMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the current batch processing.
+     * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object stateMessage_ = ""; + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * For example, the error message if the operation is failed.
+     * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * For example, the error message if the operation is failed.
+     * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * For example, the error message if the operation is failed.
+     * 
+ * + * string state_message = 2; + * + * @param value The stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * For example, the error message if the operation is failed.
+     * 
+ * + * string state_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearStateMessage() { + stateMessage_ = getDefaultInstance().getStateMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * For example, the error message if the operation is failed.
+     * 
+ * + * string state_message = 2; + * + * @param value The bytes for stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateMessage_ = value; + bitField0_ |= 0x00000002; + 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 creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @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 creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + 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 com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.util.List< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus> + individualProcessStatuses_ = java.util.Collections.emptyList(); + + private void ensureIndividualProcessStatusesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + individualProcessStatuses_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus>( + individualProcessStatuses_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder> + individualProcessStatusesBuilder_; + + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public java.util.List< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus> + getIndividualProcessStatusesList() { + if (individualProcessStatusesBuilder_ == null) { + return java.util.Collections.unmodifiableList(individualProcessStatuses_); + } else { + return individualProcessStatusesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public int getIndividualProcessStatusesCount() { + if (individualProcessStatusesBuilder_ == null) { + return individualProcessStatuses_.size(); + } else { + return individualProcessStatusesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getIndividualProcessStatuses(int index) { + if (individualProcessStatusesBuilder_ == null) { + return individualProcessStatuses_.get(index); + } else { + return individualProcessStatusesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder setIndividualProcessStatuses( + int index, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus value) { + if (individualProcessStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.set(index, value); + onChanged(); + } else { + individualProcessStatusesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder setIndividualProcessStatuses( + int index, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + builderForValue) { + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.set(index, builderForValue.build()); + onChanged(); + } else { + individualProcessStatusesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder addIndividualProcessStatuses( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus value) { + if (individualProcessStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.add(value); + onChanged(); + } else { + individualProcessStatusesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder addIndividualProcessStatuses( + int index, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus value) { + if (individualProcessStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.add(index, value); + onChanged(); + } else { + individualProcessStatusesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder addIndividualProcessStatuses( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + builderForValue) { + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.add(builderForValue.build()); + onChanged(); + } else { + individualProcessStatusesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder addIndividualProcessStatuses( + int index, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + builderForValue) { + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.add(index, builderForValue.build()); + onChanged(); + } else { + individualProcessStatusesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder addAllIndividualProcessStatuses( + java.lang.Iterable< + ? extends + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus> + values) { + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, individualProcessStatuses_); + onChanged(); + } else { + individualProcessStatusesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder clearIndividualProcessStatuses() { + if (individualProcessStatusesBuilder_ == null) { + individualProcessStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + individualProcessStatusesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public Builder removeIndividualProcessStatuses(int index) { + if (individualProcessStatusesBuilder_ == null) { + ensureIndividualProcessStatusesIsMutable(); + individualProcessStatuses_.remove(index); + onChanged(); + } else { + individualProcessStatusesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + getIndividualProcessStatusesBuilder(int index) { + return getIndividualProcessStatusesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder + getIndividualProcessStatusesOrBuilder(int index) { + if (individualProcessStatusesBuilder_ == null) { + return individualProcessStatuses_.get(index); + } else { + return individualProcessStatusesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public java.util.List< + ? extends + com.google.cloud.documentai.v1.BatchProcessMetadata + .IndividualProcessStatusOrBuilder> + getIndividualProcessStatusesOrBuilderList() { + if (individualProcessStatusesBuilder_ != null) { + return individualProcessStatusesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(individualProcessStatuses_); + } + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + addIndividualProcessStatusesBuilder() { + return getIndividualProcessStatusesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder + addIndividualProcessStatusesBuilder(int index) { + return getIndividualProcessStatusesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of response details of each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + public java.util.List< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder> + getIndividualProcessStatusesBuilderList() { + return getIndividualProcessStatusesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder> + getIndividualProcessStatusesFieldBuilder() { + if (individualProcessStatusesBuilder_ == null) { + individualProcessStatusesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus, + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.Builder, + com.google.cloud.documentai.v1.BatchProcessMetadata + .IndividualProcessStatusOrBuilder>( + individualProcessStatuses_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + individualProcessStatuses_ = null; + } + return individualProcessStatusesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BatchProcessMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BatchProcessMetadata) + private static final com.google.cloud.documentai.v1.BatchProcessMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.BatchProcessMetadata(); + } + + public static com.google.cloud.documentai.v1.BatchProcessMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchProcessMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadataOrBuilder.java new file mode 100644 index 000000000000..f8b45ca61af2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessMetadataOrBuilder.java @@ -0,0 +1,214 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface BatchProcessMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BatchProcessMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The state of the current batch processing.
+   * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the current batch processing.
+   * 
+ * + * .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * + * @return The state. + */ + com.google.cloud.documentai.v1.BatchProcessMetadata.State getState(); + + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * For example, the error message if the operation is failed.
+   * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + java.lang.String getStateMessage(); + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * For example, the error message if the operation is failed.
+   * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + com.google.protobuf.ByteString getStateMessageBytes(); + + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + java.util.List + getIndividualProcessStatusesList(); + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + getIndividualProcessStatuses(int index); + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + int getIndividualProcessStatusesCount(); + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + java.util.List< + ? extends + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder> + getIndividualProcessStatusesOrBuilderList(); + /** + * + * + *
+   * The list of response details of each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * + */ + com.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatusOrBuilder + getIndividualProcessStatusesOrBuilder(int index); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java new file mode 100644 index 000000000000..bfba9edd0a9c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequest.java @@ -0,0 +1,1635 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for
+ * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessRequest} + */ +public final class BatchProcessRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BatchProcessRequest) + BatchProcessRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchProcessRequest.newBuilder() to construct. + private BatchProcessRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchProcessRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessRequest.class, + com.google.cloud.documentai.v1.BatchProcessRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of
+   * [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 resource name of
+   * [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 INPUT_DOCUMENTS_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig inputDocuments_; + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return Whether the inputDocuments field is set. + */ + @java.lang.Override + public boolean hasInputDocuments() { + return inputDocuments_ != null; + } + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return The inputDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getInputDocuments() { + return inputDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : inputDocuments_; + } + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getInputDocumentsOrBuilder() { + return inputDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : inputDocuments_; + } + + public static final int DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.documentai.v1.DocumentOutputConfig documentOutputConfig_; + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return Whether the documentOutputConfig field is set. + */ + @java.lang.Override + public boolean hasDocumentOutputConfig() { + return documentOutputConfig_ != null; + } + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return The documentOutputConfig. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentOutputConfig getDocumentOutputConfig() { + return documentOutputConfig_ == null + ? com.google.cloud.documentai.v1.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder + getDocumentOutputConfigOrBuilder() { + return documentOutputConfig_ == null + ? com.google.cloud.documentai.v1.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } + + public static final int SKIP_HUMAN_REVIEW_FIELD_NUMBER = 4; + private boolean skipHumanReview_ = false; + /** + * + * + *
+   * Whether human review should be skipped for this request. Default to
+   * `false`.
+   * 
+ * + * bool skip_human_review = 4; + * + * @return The skipHumanReview. + */ + @java.lang.Override + public boolean getSkipHumanReview() { + return skipHumanReview_; + } + + public static final int PROCESS_OPTIONS_FIELD_NUMBER = 7; + private com.google.cloud.documentai.v1.ProcessOptions processOptions_; + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return Whether the processOptions field is set. + */ + @java.lang.Override + public boolean hasProcessOptions() { + return processOptions_ != null; + } + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return The processOptions. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessOptions getProcessOptions() { + return processOptions_ == null + ? com.google.cloud.documentai.v1.ProcessOptions.getDefaultInstance() + : processOptions_; + } + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessOptionsOrBuilder getProcessOptionsOrBuilder() { + return processOptions_ == null + ? com.google.cloud.documentai.v1.ProcessOptions.getDefaultInstance() + : processOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (skipHumanReview_ != false) { + output.writeBool(4, skipHumanReview_); + } + if (inputDocuments_ != null) { + output.writeMessage(5, getInputDocuments()); + } + if (documentOutputConfig_ != null) { + output.writeMessage(6, getDocumentOutputConfig()); + } + if (processOptions_ != null) { + output.writeMessage(7, getProcessOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (skipHumanReview_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, skipHumanReview_); + } + if (inputDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getInputDocuments()); + } + if (documentOutputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDocumentOutputConfig()); + } + if (processOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProcessOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.BatchProcessRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BatchProcessRequest other = + (com.google.cloud.documentai.v1.BatchProcessRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInputDocuments() != other.hasInputDocuments()) return false; + if (hasInputDocuments()) { + if (!getInputDocuments().equals(other.getInputDocuments())) return false; + } + if (hasDocumentOutputConfig() != other.hasDocumentOutputConfig()) return false; + if (hasDocumentOutputConfig()) { + if (!getDocumentOutputConfig().equals(other.getDocumentOutputConfig())) return false; + } + if (getSkipHumanReview() != other.getSkipHumanReview()) return false; + if (hasProcessOptions() != other.hasProcessOptions()) return false; + if (hasProcessOptions()) { + if (!getProcessOptions().equals(other.getProcessOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasInputDocuments()) { + hash = (37 * hash) + INPUT_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getInputDocuments().hashCode(); + } + if (hasDocumentOutputConfig()) { + hash = (37 * hash) + DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDocumentOutputConfig().hashCode(); + } + hash = (37 * hash) + SKIP_HUMAN_REVIEW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipHumanReview()); + if (hasProcessOptions()) { + hash = (37 * hash) + PROCESS_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getProcessOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.BatchProcessRequest 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
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BatchProcessRequest) + com.google.cloud.documentai.v1.BatchProcessRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessRequest.class, + com.google.cloud.documentai.v1.BatchProcessRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.BatchProcessRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + inputDocuments_ = null; + if (inputDocumentsBuilder_ != null) { + inputDocumentsBuilder_.dispose(); + inputDocumentsBuilder_ = null; + } + documentOutputConfig_ = null; + if (documentOutputConfigBuilder_ != null) { + documentOutputConfigBuilder_.dispose(); + documentOutputConfigBuilder_ = null; + } + skipHumanReview_ = false; + processOptions_ = null; + if (processOptionsBuilder_ != null) { + processOptionsBuilder_.dispose(); + processOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BatchProcessRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessRequest build() { + com.google.cloud.documentai.v1.BatchProcessRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessRequest buildPartial() { + com.google.cloud.documentai.v1.BatchProcessRequest result = + new com.google.cloud.documentai.v1.BatchProcessRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.BatchProcessRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.inputDocuments_ = + inputDocumentsBuilder_ == null ? inputDocuments_ : inputDocumentsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentOutputConfig_ = + documentOutputConfigBuilder_ == null + ? documentOutputConfig_ + : documentOutputConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.skipHumanReview_ = skipHumanReview_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.processOptions_ = + processOptionsBuilder_ == null ? processOptions_ : processOptionsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.BatchProcessRequest) { + return mergeFrom((com.google.cloud.documentai.v1.BatchProcessRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.BatchProcessRequest other) { + if (other == com.google.cloud.documentai.v1.BatchProcessRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasInputDocuments()) { + mergeInputDocuments(other.getInputDocuments()); + } + if (other.hasDocumentOutputConfig()) { + mergeDocumentOutputConfig(other.getDocumentOutputConfig()); + } + if (other.getSkipHumanReview() != false) { + setSkipHumanReview(other.getSkipHumanReview()); + } + if (other.hasProcessOptions()) { + mergeProcessOptions(other.getProcessOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 32: + { + skipHumanReview_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getInputDocumentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 42 + case 50: + { + input.readMessage( + getDocumentOutputConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 50 + case 58: + { + input.readMessage(getProcessOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of
+     * [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 resource name of
+     * [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 resource name of
+     * [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of
+     * [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of
+     * [Processor][google.cloud.documentai.v1.Processor] or
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+     * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+     * or
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig inputDocuments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + inputDocumentsBuilder_; + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return Whether the inputDocuments field is set. + */ + public boolean hasInputDocuments() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return The inputDocuments. + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getInputDocuments() { + if (inputDocumentsBuilder_ == null) { + return inputDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : inputDocuments_; + } else { + return inputDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public Builder setInputDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (inputDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputDocuments_ = value; + } else { + inputDocumentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public Builder setInputDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder builderForValue) { + if (inputDocumentsBuilder_ == null) { + inputDocuments_ = builderForValue.build(); + } else { + inputDocumentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public Builder mergeInputDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (inputDocumentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && inputDocuments_ != null + && inputDocuments_ + != com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance()) { + getInputDocumentsBuilder().mergeFrom(value); + } else { + inputDocuments_ = value; + } + } else { + inputDocumentsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public Builder clearInputDocuments() { + bitField0_ = (bitField0_ & ~0x00000002); + inputDocuments_ = null; + if (inputDocumentsBuilder_ != null) { + inputDocumentsBuilder_.dispose(); + inputDocumentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder + getInputDocumentsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInputDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getInputDocumentsOrBuilder() { + if (inputDocumentsBuilder_ != null) { + return inputDocumentsBuilder_.getMessageOrBuilder(); + } else { + return inputDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : inputDocuments_; + } + } + /** + * + * + *
+     * The input documents for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + getInputDocumentsFieldBuilder() { + if (inputDocumentsBuilder_ == null) { + inputDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder>( + getInputDocuments(), getParentForChildren(), isClean()); + inputDocuments_ = null; + } + return inputDocumentsBuilder_; + } + + private com.google.cloud.documentai.v1.DocumentOutputConfig documentOutputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentOutputConfig, + com.google.cloud.documentai.v1.DocumentOutputConfig.Builder, + com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder> + documentOutputConfigBuilder_; + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return Whether the documentOutputConfig field is set. + */ + public boolean hasDocumentOutputConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return The documentOutputConfig. + */ + public com.google.cloud.documentai.v1.DocumentOutputConfig getDocumentOutputConfig() { + if (documentOutputConfigBuilder_ == null) { + return documentOutputConfig_ == null + ? com.google.cloud.documentai.v1.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } else { + return documentOutputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public Builder setDocumentOutputConfig( + com.google.cloud.documentai.v1.DocumentOutputConfig value) { + if (documentOutputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentOutputConfig_ = value; + } else { + documentOutputConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public Builder setDocumentOutputConfig( + com.google.cloud.documentai.v1.DocumentOutputConfig.Builder builderForValue) { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfig_ = builderForValue.build(); + } else { + documentOutputConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public Builder mergeDocumentOutputConfig( + com.google.cloud.documentai.v1.DocumentOutputConfig value) { + if (documentOutputConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && documentOutputConfig_ != null + && documentOutputConfig_ + != com.google.cloud.documentai.v1.DocumentOutputConfig.getDefaultInstance()) { + getDocumentOutputConfigBuilder().mergeFrom(value); + } else { + documentOutputConfig_ = value; + } + } else { + documentOutputConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public Builder clearDocumentOutputConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + documentOutputConfig_ = null; + if (documentOutputConfigBuilder_ != null) { + documentOutputConfigBuilder_.dispose(); + documentOutputConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public com.google.cloud.documentai.v1.DocumentOutputConfig.Builder + getDocumentOutputConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDocumentOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + public com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder + getDocumentOutputConfigOrBuilder() { + if (documentOutputConfigBuilder_ != null) { + return documentOutputConfigBuilder_.getMessageOrBuilder(); + } else { + return documentOutputConfig_ == null + ? com.google.cloud.documentai.v1.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } + } + /** + * + * + *
+     * The output configuration for the
+     * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+     * method.
+     * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentOutputConfig, + com.google.cloud.documentai.v1.DocumentOutputConfig.Builder, + com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder> + getDocumentOutputConfigFieldBuilder() { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentOutputConfig, + com.google.cloud.documentai.v1.DocumentOutputConfig.Builder, + com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder>( + getDocumentOutputConfig(), getParentForChildren(), isClean()); + documentOutputConfig_ = null; + } + return documentOutputConfigBuilder_; + } + + private boolean skipHumanReview_; + /** + * + * + *
+     * Whether human review should be skipped for this request. Default to
+     * `false`.
+     * 
+ * + * bool skip_human_review = 4; + * + * @return The skipHumanReview. + */ + @java.lang.Override + public boolean getSkipHumanReview() { + return skipHumanReview_; + } + /** + * + * + *
+     * Whether human review should be skipped for this request. Default to
+     * `false`.
+     * 
+ * + * bool skip_human_review = 4; + * + * @param value The skipHumanReview to set. + * @return This builder for chaining. + */ + public Builder setSkipHumanReview(boolean value) { + + skipHumanReview_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether human review should be skipped for this request. Default to
+     * `false`.
+     * 
+ * + * bool skip_human_review = 4; + * + * @return This builder for chaining. + */ + public Builder clearSkipHumanReview() { + bitField0_ = (bitField0_ & ~0x00000008); + skipHumanReview_ = false; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.ProcessOptions processOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessOptions, + com.google.cloud.documentai.v1.ProcessOptions.Builder, + com.google.cloud.documentai.v1.ProcessOptionsOrBuilder> + processOptionsBuilder_; + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return Whether the processOptions field is set. + */ + public boolean hasProcessOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return The processOptions. + */ + public com.google.cloud.documentai.v1.ProcessOptions getProcessOptions() { + if (processOptionsBuilder_ == null) { + return processOptions_ == null + ? com.google.cloud.documentai.v1.ProcessOptions.getDefaultInstance() + : processOptions_; + } else { + return processOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public Builder setProcessOptions(com.google.cloud.documentai.v1.ProcessOptions value) { + if (processOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + processOptions_ = value; + } else { + processOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public Builder setProcessOptions( + com.google.cloud.documentai.v1.ProcessOptions.Builder builderForValue) { + if (processOptionsBuilder_ == null) { + processOptions_ = builderForValue.build(); + } else { + processOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public Builder mergeProcessOptions(com.google.cloud.documentai.v1.ProcessOptions value) { + if (processOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && processOptions_ != null + && processOptions_ + != com.google.cloud.documentai.v1.ProcessOptions.getDefaultInstance()) { + getProcessOptionsBuilder().mergeFrom(value); + } else { + processOptions_ = value; + } + } else { + processOptionsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public Builder clearProcessOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + processOptions_ = null; + if (processOptionsBuilder_ != null) { + processOptionsBuilder_.dispose(); + processOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public com.google.cloud.documentai.v1.ProcessOptions.Builder getProcessOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getProcessOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + public com.google.cloud.documentai.v1.ProcessOptionsOrBuilder getProcessOptionsOrBuilder() { + if (processOptionsBuilder_ != null) { + return processOptionsBuilder_.getMessageOrBuilder(); + } else { + return processOptions_ == null + ? com.google.cloud.documentai.v1.ProcessOptions.getDefaultInstance() + : processOptions_; + } + } + /** + * + * + *
+     * Inference-time options for the process API
+     * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessOptions, + com.google.cloud.documentai.v1.ProcessOptions.Builder, + com.google.cloud.documentai.v1.ProcessOptionsOrBuilder> + getProcessOptionsFieldBuilder() { + if (processOptionsBuilder_ == null) { + processOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessOptions, + com.google.cloud.documentai.v1.ProcessOptions.Builder, + com.google.cloud.documentai.v1.ProcessOptionsOrBuilder>( + getProcessOptions(), getParentForChildren(), isClean()); + processOptions_ = null; + } + return processOptionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BatchProcessRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BatchProcessRequest) + private static final com.google.cloud.documentai.v1.BatchProcessRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.BatchProcessRequest(); + } + + public static com.google.cloud.documentai.v1.BatchProcessRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchProcessRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java new file mode 100644 index 000000000000..2ec9be3228b4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessRequestOrBuilder.java @@ -0,0 +1,195 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface BatchProcessRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BatchProcessRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of
+   * [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of
+   * [Processor][google.cloud.documentai.v1.Processor] or
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
+   * Format: `projects/{project}/locations/{location}/processors/{processor}`,
+   * or
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return Whether the inputDocuments field is set. + */ + boolean hasInputDocuments(); + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * + * @return The inputDocuments. + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfig getInputDocuments(); + /** + * + * + *
+   * The input documents for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder getInputDocumentsOrBuilder(); + + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return Whether the documentOutputConfig field is set. + */ + boolean hasDocumentOutputConfig(); + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * + * @return The documentOutputConfig. + */ + com.google.cloud.documentai.v1.DocumentOutputConfig getDocumentOutputConfig(); + /** + * + * + *
+   * The output configuration for the
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
+   * method.
+   * 
+ * + * .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + com.google.cloud.documentai.v1.DocumentOutputConfigOrBuilder getDocumentOutputConfigOrBuilder(); + + /** + * + * + *
+   * Whether human review should be skipped for this request. Default to
+   * `false`.
+   * 
+ * + * bool skip_human_review = 4; + * + * @return The skipHumanReview. + */ + boolean getSkipHumanReview(); + + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return Whether the processOptions field is set. + */ + boolean hasProcessOptions(); + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * + * @return The processOptions. + */ + com.google.cloud.documentai.v1.ProcessOptions getProcessOptions(); + /** + * + * + *
+   * Inference-time options for the process API
+   * 
+ * + * .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + com.google.cloud.documentai.v1.ProcessOptionsOrBuilder getProcessOptionsOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponse.java new file mode 100644 index 000000000000..46687e5faa57 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponse.java @@ -0,0 +1,433 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for
+ * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessResponse} + */ +public final class BatchProcessResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BatchProcessResponse) + BatchProcessResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchProcessResponse.newBuilder() to construct. + private BatchProcessResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchProcessResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessResponse.class, + com.google.cloud.documentai.v1.BatchProcessResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.BatchProcessResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BatchProcessResponse other = + (com.google.cloud.documentai.v1.BatchProcessResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.BatchProcessResponse 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
+   * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BatchProcessResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BatchProcessResponse) + com.google.cloud.documentai.v1.BatchProcessResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BatchProcessResponse.class, + com.google.cloud.documentai.v1.BatchProcessResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.BatchProcessResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_BatchProcessResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BatchProcessResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessResponse build() { + com.google.cloud.documentai.v1.BatchProcessResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessResponse buildPartial() { + com.google.cloud.documentai.v1.BatchProcessResponse result = + new com.google.cloud.documentai.v1.BatchProcessResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.BatchProcessResponse) { + return mergeFrom((com.google.cloud.documentai.v1.BatchProcessResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.BatchProcessResponse other) { + if (other == com.google.cloud.documentai.v1.BatchProcessResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BatchProcessResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BatchProcessResponse) + private static final com.google.cloud.documentai.v1.BatchProcessResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.BatchProcessResponse(); + } + + public static com.google.cloud.documentai.v1.BatchProcessResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchProcessResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BatchProcessResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponseOrBuilder.java new file mode 100644 index 000000000000..4ee46a60b292 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BatchProcessResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface BatchProcessResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BatchProcessResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPoly.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPoly.java new file mode 100644 index 000000000000..5777dcb51a08 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPoly.java @@ -0,0 +1,1436 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/geometry.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * A bounding polygon for the detected image annotation.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BoundingPoly} + */ +public final class BoundingPoly extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.BoundingPoly) + BoundingPolyOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoundingPoly.newBuilder() to construct. + private BoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoundingPoly() { + vertices_ = java.util.Collections.emptyList(); + normalizedVertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoundingPoly(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.GeometryProto + .internal_static_google_cloud_documentai_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.GeometryProto + .internal_static_google_cloud_documentai_v1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BoundingPoly.class, + com.google.cloud.documentai.v1.BoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List vertices_; + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + @java.lang.Override + public java.util.List getVerticesList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + @java.lang.Override + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + @java.lang.Override + public int getVerticesCount() { + return vertices_.size(); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Vertex getVertices(int index) { + return vertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.VertexOrBuilder getVerticesOrBuilder(int index) { + return vertices_.get(index); + } + + public static final int NORMALIZED_VERTICES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List normalizedVertices_; + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + @java.lang.Override + public java.util.List + getNormalizedVerticesList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + @java.lang.Override + public java.util.List + getNormalizedVerticesOrBuilderList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + @java.lang.Override + public int getNormalizedVerticesCount() { + return normalizedVertices_.size(); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.NormalizedVertex getNormalizedVertices(int index) { + return normalizedVertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + return normalizedVertices_.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 < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + output.writeMessage(2, normalizedVertices_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, normalizedVertices_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.BoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.BoundingPoly other = + (com.google.cloud.documentai.v1.BoundingPoly) obj; + + if (!getVerticesList().equals(other.getVerticesList())) return false; + if (!getNormalizedVerticesList().equals(other.getNormalizedVerticesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVerticesCount() > 0) { + hash = (37 * hash) + VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getVerticesList().hashCode(); + } + if (getNormalizedVerticesCount() > 0) { + hash = (37 * hash) + NORMALIZED_VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedVerticesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.BoundingPoly 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 bounding polygon for the detected image annotation.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.BoundingPoly} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.BoundingPoly) + com.google.cloud.documentai.v1.BoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.GeometryProto + .internal_static_google_cloud_documentai_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.GeometryProto + .internal_static_google_cloud_documentai_v1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.BoundingPoly.class, + com.google.cloud.documentai.v1.BoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.BoundingPoly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + } else { + vertices_ = null; + verticesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + } else { + normalizedVertices_ = null; + normalizedVerticesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.GeometryProto + .internal_static_google_cloud_documentai_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BoundingPoly getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.BoundingPoly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BoundingPoly build() { + com.google.cloud.documentai.v1.BoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BoundingPoly buildPartial() { + com.google.cloud.documentai.v1.BoundingPoly result = + new com.google.cloud.documentai.v1.BoundingPoly(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.documentai.v1.BoundingPoly result) { + if (verticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vertices_ = vertices_; + } else { + result.vertices_ = verticesBuilder_.build(); + } + if (normalizedVerticesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.normalizedVertices_ = normalizedVertices_; + } else { + result.normalizedVertices_ = normalizedVerticesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.documentai.v1.BoundingPoly result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.BoundingPoly) { + return mergeFrom((com.google.cloud.documentai.v1.BoundingPoly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.BoundingPoly other) { + if (other == com.google.cloud.documentai.v1.BoundingPoly.getDefaultInstance()) return this; + if (verticesBuilder_ == null) { + if (!other.vertices_.isEmpty()) { + if (vertices_.isEmpty()) { + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVerticesIsMutable(); + vertices_.addAll(other.vertices_); + } + onChanged(); + } + } else { + if (!other.vertices_.isEmpty()) { + if (verticesBuilder_.isEmpty()) { + verticesBuilder_.dispose(); + verticesBuilder_ = null; + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + verticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVerticesFieldBuilder() + : null; + } else { + verticesBuilder_.addAllMessages(other.vertices_); + } + } + } + if (normalizedVerticesBuilder_ == null) { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVertices_.isEmpty()) { + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.addAll(other.normalizedVertices_); + } + onChanged(); + } + } else { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVerticesBuilder_.isEmpty()) { + normalizedVerticesBuilder_.dispose(); + normalizedVerticesBuilder_ = null; + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + normalizedVerticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNormalizedVerticesFieldBuilder() + : null; + } else { + normalizedVerticesBuilder_.addAllMessages(other.normalizedVertices_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.documentai.v1.Vertex m = + input.readMessage( + com.google.cloud.documentai.v1.Vertex.parser(), extensionRegistry); + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(m); + } else { + verticesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.documentai.v1.NormalizedVertex m = + input.readMessage( + com.google.cloud.documentai.v1.NormalizedVertex.parser(), + extensionRegistry); + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(m); + } else { + normalizedVerticesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List vertices_ = + java.util.Collections.emptyList(); + + private void ensureVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + vertices_ = new java.util.ArrayList(vertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Vertex, + com.google.cloud.documentai.v1.Vertex.Builder, + com.google.cloud.documentai.v1.VertexOrBuilder> + verticesBuilder_; + + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + if (verticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vertices_); + } else { + return verticesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1.Vertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder setVertices(int index, com.google.cloud.documentai.v1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.set(index, value); + onChanged(); + } else { + verticesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.documentai.v1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.set(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.documentai.v1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(value); + onChanged(); + } else { + verticesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder addVertices(int index, com.google.cloud.documentai.v1.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(index, value); + onChanged(); + } else { + verticesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.documentai.v1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.documentai.v1.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder addAllVertices( + java.lang.Iterable values) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vertices_); + onChanged(); + } else { + verticesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder clearVertices() { + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + verticesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public Builder removeVertices(int index) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.remove(index); + onChanged(); + } else { + verticesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1.Vertex.Builder getVerticesBuilder(int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1.VertexOrBuilder getVerticesOrBuilder(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + if (verticesBuilder_ != null) { + return verticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vertices_); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1.Vertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1.Vertex.Builder addVerticesBuilder(int index) { + return getVerticesFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + public java.util.List getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Vertex, + com.google.cloud.documentai.v1.Vertex.Builder, + com.google.cloud.documentai.v1.VertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Vertex, + com.google.cloud.documentai.v1.Vertex.Builder, + com.google.cloud.documentai.v1.VertexOrBuilder>( + vertices_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + vertices_ = null; + } + return verticesBuilder_; + } + + private java.util.List normalizedVertices_ = + java.util.Collections.emptyList(); + + private void ensureNormalizedVerticesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = + new java.util.ArrayList( + normalizedVertices_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.NormalizedVertex, + com.google.cloud.documentai.v1.NormalizedVertex.Builder, + com.google.cloud.documentai.v1.NormalizedVertexOrBuilder> + normalizedVerticesBuilder_; + + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesList() { + if (normalizedVerticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } else { + return normalizedVerticesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.size(); + } else { + return normalizedVerticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.documentai.v1.NormalizedVertex getNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.documentai.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.documentai.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices(com.google.cloud.documentai.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.documentai.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + com.google.cloud.documentai.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.documentai.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addAllNormalizedVertices( + java.lang.Iterable values) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, normalizedVertices_); + onChanged(); + } else { + normalizedVerticesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder clearNormalizedVertices() { + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder removeNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.remove(index); + onChanged(); + } else { + normalizedVerticesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.documentai.v1.NormalizedVertex.Builder getNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.documentai.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + if (normalizedVerticesBuilder_ != null) { + return normalizedVerticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.documentai.v1.NormalizedVertex.Builder addNormalizedVerticesBuilder() { + return getNormalizedVerticesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.documentai.v1.NormalizedVertex.Builder addNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesBuilderList() { + return getNormalizedVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.NormalizedVertex, + com.google.cloud.documentai.v1.NormalizedVertex.Builder, + com.google.cloud.documentai.v1.NormalizedVertexOrBuilder> + getNormalizedVerticesFieldBuilder() { + if (normalizedVerticesBuilder_ == null) { + normalizedVerticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.NormalizedVertex, + com.google.cloud.documentai.v1.NormalizedVertex.Builder, + com.google.cloud.documentai.v1.NormalizedVertexOrBuilder>( + normalizedVertices_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + normalizedVertices_ = null; + } + return normalizedVerticesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.BoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.BoundingPoly) + private static final com.google.cloud.documentai.v1.BoundingPoly DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.BoundingPoly(); + } + + public static com.google.cloud.documentai.v1.BoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.BoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPolyOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPolyOrBuilder.java new file mode 100644 index 000000000000..435280e9c7b3 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/BoundingPolyOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/geometry.proto + +package com.google.cloud.documentai.v1; + +public interface BoundingPolyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.BoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + java.util.List getVerticesList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + com.google.cloud.documentai.v1.Vertex getVertices(int index); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + int getVerticesCount(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + com.google.cloud.documentai.v1.VertexOrBuilder getVerticesOrBuilder(int index); + + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List getNormalizedVerticesList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.documentai.v1.NormalizedVertex getNormalizedVertices(int index); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + int getNormalizedVerticesCount(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List + getNormalizedVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.documentai.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java new file mode 100644 index 000000000000..a3bd6ea5cff5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadata.java @@ -0,0 +1,1708 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/operation_metadata.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The common metadata for long running operations.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CommonOperationMetadata} + */ +public final class CommonOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.CommonOperationMetadata) + CommonOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonOperationMetadata.newBuilder() to construct. + private CommonOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommonOperationMetadata() { + state_ = 0; + stateMessage_ = ""; + resource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CommonOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.OperationMetadataProto + .internal_static_google_cloud_documentai_v1_CommonOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.OperationMetadataProto + .internal_static_google_cloud_documentai_v1_CommonOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CommonOperationMetadata.class, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder.class); + } + + /** + * + * + *
+   * State of the longrunning operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.documentai.v1.CommonOperationMetadata.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Operation is still running.
+     * 
+ * + * RUNNING = 1; + */ + RUNNING(1), + /** + * + * + *
+     * Operation is being cancelled.
+     * 
+ * + * CANCELLING = 2; + */ + CANCELLING(2), + /** + * + * + *
+     * Operation succeeded.
+     * 
+ * + * SUCCEEDED = 3; + */ + SUCCEEDED(3), + /** + * + * + *
+     * Operation failed.
+     * 
+ * + * FAILED = 4; + */ + FAILED(4), + /** + * + * + *
+     * Operation is cancelled.
+     * 
+ * + * CANCELLED = 5; + */ + CANCELLED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Operation is still running.
+     * 
+ * + * RUNNING = 1; + */ + public static final int RUNNING_VALUE = 1; + /** + * + * + *
+     * Operation is being cancelled.
+     * 
+ * + * CANCELLING = 2; + */ + public static final int CANCELLING_VALUE = 2; + /** + * + * + *
+     * Operation succeeded.
+     * 
+ * + * SUCCEEDED = 3; + */ + public static final int SUCCEEDED_VALUE = 3; + /** + * + * + *
+     * Operation failed.
+     * 
+ * + * FAILED = 4; + */ + public static final int FAILED_VALUE = 4; + /** + * + * + *
+     * Operation is cancelled.
+     * 
+ * + * CANCELLED = 5; + */ + public static final int CANCELLED_VALUE = 5; + + 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 RUNNING; + case 2: + return CANCELLING; + case 3: + return SUCCEEDED; + case 4: + return FAILED; + case 5: + return CANCELLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.documentai.v1.CommonOperationMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1.CommonOperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata.State getState() { + com.google.cloud.documentai.v1.CommonOperationMetadata.State result = + com.google.cloud.documentai.v1.CommonOperationMetadata.State.forNumber(state_); + return result == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.State.UNRECOGNIZED + : result; + } + + public static final int STATE_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateMessage_ = ""; + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + @java.lang.Override + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + 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(); + stateMessage_ = s; + return s; + } + } + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object resource_ = ""; + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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 (state_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, stateMessage_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, stateMessage_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resource_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.CommonOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.CommonOperationMetadata other = + (com.google.cloud.documentai.v1.CommonOperationMetadata) obj; + + if (state_ != other.state_) return false; + if (!getStateMessage().equals(other.getStateMessage())) return false; + if (!getResource().equals(other.getResource())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATE_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStateMessage().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.CommonOperationMetadata 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 common metadata for long running operations.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CommonOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.CommonOperationMetadata) + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.OperationMetadataProto + .internal_static_google_cloud_documentai_v1_CommonOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.OperationMetadataProto + .internal_static_google_cloud_documentai_v1_CommonOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CommonOperationMetadata.class, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.CommonOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + stateMessage_ = ""; + resource_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.OperationMetadataProto + .internal_static_google_cloud_documentai_v1_CommonOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata build() { + com.google.cloud.documentai.v1.CommonOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata buildPartial() { + com.google.cloud.documentai.v1.CommonOperationMetadata result = + new com.google.cloud.documentai.v1.CommonOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.CommonOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateMessage_ = stateMessage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resource_ = resource_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.CommonOperationMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.CommonOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.CommonOperationMetadata other) { + if (other == com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStateMessage().isEmpty()) { + stateMessage_ = other.stateMessage_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + stateMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + resource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata.State getState() { + com.google.cloud.documentai.v1.CommonOperationMetadata.State result = + com.google.cloud.documentai.v1.CommonOperationMetadata.State.forNumber(state_); + return result == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.documentai.v1.CommonOperationMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object stateMessage_ = ""; + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * 
+ * + * string state_message = 2; + * + * @param value The stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * 
+ * + * string state_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearStateMessage() { + stateMessage_ = getDefaultInstance().getStateMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A message providing more details about the current state of processing.
+     * 
+ * + * string state_message = 2; + * + * @param value The bytes for stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + resource_ = getDefaultInstance().getResource(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A related resource to this operation.
+     * 
+ * + * string resource = 5; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resource_ = value; + bitField0_ |= 0x00000004; + 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 creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @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 creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The creation time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + 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 com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The last update time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.CommonOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.CommonOperationMetadata) + private static final com.google.cloud.documentai.v1.CommonOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.CommonOperationMetadata(); + } + + public static com.google.cloud.documentai.v1.CommonOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..c66d270b9132 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CommonOperationMetadataOrBuilder.java @@ -0,0 +1,170 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/operation_metadata.proto + +package com.google.cloud.documentai.v1; + +public interface CommonOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.CommonOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * + * @return The state. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata.State getState(); + + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * 
+ * + * string state_message = 2; + * + * @return The stateMessage. + */ + java.lang.String getStateMessage(); + /** + * + * + *
+   * A message providing more details about the current state of processing.
+   * 
+ * + * string state_message = 2; + * + * @return The bytes for stateMessage. + */ + com.google.protobuf.ByteString getStateMessageBytes(); + + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * A related resource to this operation.
+   * 
+ * + * string resource = 5; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The creation time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The last update time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java new file mode 100644 index 000000000000..20ae9d551dd2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequest.java @@ -0,0 +1,990 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the
+ * [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]
+ * method. Notice this request is sent to a regionalized backend service. If the
+ * [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in
+ * that region, the creation fails.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CreateProcessorRequest} + */ +public final class CreateProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.CreateProcessorRequest) + CreateProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProcessorRequest.newBuilder() to construct. + private CreateProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProcessorRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProcessorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CreateProcessorRequest.class, + com.google.cloud.documentai.v1.CreateProcessorRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent (project and location) under which to create the
+   * processor. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project and location) under which to create the
+   * processor. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROCESSOR_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.Processor processor_; + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + @java.lang.Override + public boolean hasProcessor() { + return processor_ != null; + } + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Processor getProcessor() { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder() { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (processor_ != null) { + output.writeMessage(2, getProcessor()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (processor_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProcessor()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.CreateProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.CreateProcessorRequest other = + (com.google.cloud.documentai.v1.CreateProcessorRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasProcessor() != other.hasProcessor()) return false; + if (hasProcessor()) { + if (!getProcessor().equals(other.getProcessor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.CreateProcessorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the
+   * [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]
+   * method. Notice this request is sent to a regionalized backend service. If the
+   * [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in
+   * that region, the creation fails.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.CreateProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.CreateProcessorRequest) + com.google.cloud.documentai.v1.CreateProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.CreateProcessorRequest.class, + com.google.cloud.documentai.v1.CreateProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.CreateProcessorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + processor_ = null; + if (processorBuilder_ != null) { + processorBuilder_.dispose(); + processorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_CreateProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.CreateProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest build() { + com.google.cloud.documentai.v1.CreateProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.CreateProcessorRequest result = + new com.google.cloud.documentai.v1.CreateProcessorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.CreateProcessorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.processor_ = processorBuilder_ == null ? processor_ : processorBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.CreateProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.CreateProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.CreateProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.CreateProcessorRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasProcessor()) { + mergeProcessor(other.getProcessor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getProcessorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.Processor processor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + processorBuilder_; + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + public boolean hasProcessor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + public com.google.cloud.documentai.v1.Processor getProcessor() { + if (processorBuilder_ == null) { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } else { + return processorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor(com.google.cloud.documentai.v1.Processor value) { + if (processorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + processor_ = value; + } else { + processorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessor(com.google.cloud.documentai.v1.Processor.Builder builderForValue) { + if (processorBuilder_ == null) { + processor_ = builderForValue.build(); + } else { + processorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProcessor(com.google.cloud.documentai.v1.Processor value) { + if (processorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && processor_ != null + && processor_ != com.google.cloud.documentai.v1.Processor.getDefaultInstance()) { + getProcessorBuilder().mergeFrom(value); + } else { + processor_ = value; + } + } else { + processorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProcessor() { + bitField0_ = (bitField0_ & ~0x00000002); + processor_ = null; + if (processorBuilder_ != null) { + processorBuilder_.dispose(); + processorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.Processor.Builder getProcessorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getProcessorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder() { + if (processorBuilder_ != null) { + return processorBuilder_.getMessageOrBuilder(); + } else { + return processor_ == null + ? com.google.cloud.documentai.v1.Processor.getDefaultInstance() + : processor_; + } + } + /** + * + * + *
+     * Required. The processor to be created, requires
+     * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+     * [Processor.display_name]][] to be set. Also, the
+     * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+     * field must be set if the processor is under CMEK.
+     * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder> + getProcessorFieldBuilder() { + if (processorBuilder_ == null) { + processorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Processor, + com.google.cloud.documentai.v1.Processor.Builder, + com.google.cloud.documentai.v1.ProcessorOrBuilder>( + getProcessor(), getParentForChildren(), isClean()); + processor_ = null; + } + return processorBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.CreateProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.CreateProcessorRequest) + private static final com.google.cloud.documentai.v1.CreateProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.CreateProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.CreateProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.CreateProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java new file mode 100644 index 000000000000..fd462e0b8dc9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/CreateProcessorRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface CreateProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.CreateProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project and location) under which to create the
+   * processor. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project and location) under which to create the
+   * processor. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processor field is set. + */ + boolean hasProcessor(); + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processor. + */ + com.google.cloud.documentai.v1.Processor getProcessor(); + /** + * + * + *
+   * Required. The processor to be created, requires
+   * [Processor.type][google.cloud.documentai.v1.Processor.type] and
+   * [Processor.display_name]][] to be set. Also, the
+   * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
+   * field must be set if the processor is under CMEK.
+   * 
+ * + * + * .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1.ProcessorOrBuilder getProcessorOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java new file mode 100644 index 000000000000..aba62d657d07 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadata.java @@ -0,0 +1,717 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long-running operation metadata for the
+ * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorMetadata} + */ +public final class DeleteProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorMetadata) + DeleteProcessorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorMetadata.newBuilder() to construct. + private DeleteProcessorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorMetadata other = + (com.google.cloud.documentai.v1.DeleteProcessorMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeleteProcessorMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The long-running operation metadata for the
+   * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorMetadata) + com.google.cloud.documentai.v1.DeleteProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata build() { + com.google.cloud.documentai.v1.DeleteProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorMetadata result = + new com.google.cloud.documentai.v1.DeleteProcessorMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.DeleteProcessorMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1.DeleteProcessorMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 42: + { + input.readMessage(getCommonMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + } else { + commonMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commonMetadata_ != null + && commonMetadata_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance()) { + getCommonMetadataBuilder().mergeFrom(value); + } else { + commonMetadata_ = value; + } + } else { + commonMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder clearCommonMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorMetadata) + private static final com.google.cloud.documentai.v1.DeleteProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java new file mode 100644 index 000000000000..cbfb65c647f8 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java new file mode 100644 index 000000000000..539a45e2d695 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequest.java @@ -0,0 +1,643 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the
+ * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorRequest} + */ +public final class DeleteProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorRequest) + DeleteProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorRequest.newBuilder() to construct. + private DeleteProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorRequest other = + (com.google.cloud.documentai.v1.DeleteProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeleteProcessorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the
+   * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorRequest) + com.google.cloud.documentai.v1.DeleteProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest build() { + com.google.cloud.documentai.v1.DeleteProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorRequest result = + new com.google.cloud.documentai.v1.DeleteProcessorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.DeleteProcessorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.DeleteProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorRequest) + private static final com.google.cloud.documentai.v1.DeleteProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java new file mode 100644 index 000000000000..49e4d8b873c8 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java new file mode 100644 index 000000000000..97847aa500d4 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadata.java @@ -0,0 +1,722 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long-running operation metadata for the
+ * [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionMetadata} + */ +public final class DeleteProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + DeleteProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionMetadata.newBuilder() to construct. + private DeleteProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The long-running operation metadata for the
+   * [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCommonMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + } else { + commonMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commonMetadata_ != null + && commonMetadata_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance()) { + getCommonMetadataBuilder().mergeFrom(value); + } else { + commonMetadata_ = value; + } + } else { + commonMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java new file mode 100644 index 000000000000..cf93d1f81ca6 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java new file mode 100644 index 000000000000..d53d3cfdd6b9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the
+ * [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionRequest} + */ +public final class DeleteProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + DeleteProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProcessorVersionRequest.newBuilder() to construct. + private DeleteProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProcessorVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest other = + (com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the
+   * [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeleteProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + com.google.cloud.documentai.v1.DeleteProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeleteProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest build() { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest result = + new com.google.cloud.documentai.v1.DeleteProcessorVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.DeleteProcessorVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeleteProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeleteProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.DeleteProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.DeleteProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeleteProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.DeleteProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeleteProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java new file mode 100644 index 000000000000..73be0389672e --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeleteProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeleteProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeleteProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java new file mode 100644 index 000000000000..c26231bc0e20 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadata.java @@ -0,0 +1,722 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long-running operation metadata for the
+ * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionMetadata} + */ +public final class DeployProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + DeployProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionMetadata.newBuilder() to construct. + private DeployProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeployProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The long-running operation metadata for the
+   * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + com.google.cloud.documentai.v1.DeployProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.DeployProcessorVersionMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.DeployProcessorVersionMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCommonMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + } else { + commonMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commonMetadata_ != null + && commonMetadata_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance()) { + getCommonMetadataBuilder().mergeFrom(value); + } else { + commonMetadata_ = value; + } + } else { + commonMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public Builder clearCommonMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java new file mode 100644 index 000000000000..df457ac5c3db --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java new file mode 100644 index 000000000000..1319adb7f68f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the
+ * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionRequest} + */ +public final class DeployProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionRequest) + DeployProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionRequest.newBuilder() to construct. + private DeployProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeployProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionRequest other = + (com.google.cloud.documentai.v1.DeployProcessorVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the
+   * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionRequest) + com.google.cloud.documentai.v1.DeployProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.class, + com.google.cloud.documentai.v1.DeployProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest build() { + com.google.cloud.documentai.v1.DeployProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionRequest result = + new com.google.cloud.documentai.v1.DeployProcessorVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.DeployProcessorVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeployProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version resource name to be deployed.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeployProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java new file mode 100644 index 000000000000..2d7cfcc8498f --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor version resource name to be deployed.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java new file mode 100644 index 000000000000..5d436b8669c0 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponse.java @@ -0,0 +1,440 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the
+ * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionResponse} + */ +public final class DeployProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DeployProcessorVersionResponse) + DeployProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployProcessorVersionResponse.newBuilder() to construct. + private DeployProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployProcessorVersionResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployProcessorVersionResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DeployProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DeployProcessorVersionResponse other = + (com.google.cloud.documentai.v1.DeployProcessorVersionResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DeployProcessorVersionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the
+   * [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DeployProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DeployProcessorVersionResponse) + com.google.cloud.documentai.v1.DeployProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.class, + com.google.cloud.documentai.v1.DeployProcessorVersionResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DeployProcessorVersionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DeployProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DeployProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse build() { + com.google.cloud.documentai.v1.DeployProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.DeployProcessorVersionResponse result = + new com.google.cloud.documentai.v1.DeployProcessorVersionResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DeployProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.DeployProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DeployProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.DeployProcessorVersionResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DeployProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DeployProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.DeployProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DeployProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.DeployProcessorVersionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployProcessorVersionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DeployProcessorVersionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java new file mode 100644 index 000000000000..224ef551a4d5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DeployProcessorVersionResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DeployProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DeployProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java new file mode 100644 index 000000000000..17307059ae48 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadata.java @@ -0,0 +1,717 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The long-running operation metadata for the
+ * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorMetadata} + */ +public final class DisableProcessorMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorMetadata) + DisableProcessorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorMetadata.newBuilder() to construct. + private DisableProcessorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1.DisableProcessorMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DisableProcessorMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorMetadata other = + (com.google.cloud.documentai.v1.DisableProcessorMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DisableProcessorMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The long-running operation metadata for the
+   * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorMetadata) + com.google.cloud.documentai.v1.DisableProcessorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorMetadata.class, + com.google.cloud.documentai.v1.DisableProcessorMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata build() { + com.google.cloud.documentai.v1.DisableProcessorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorMetadata result = + new com.google.cloud.documentai.v1.DisableProcessorMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.DisableProcessorMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DisableProcessorMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorMetadata other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 42: + { + input.readMessage(getCommonMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.documentai.v1.CommonOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata(com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + } else { + commonMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder setCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder mergeCommonMetadata( + com.google.cloud.documentai.v1.CommonOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commonMetadata_ != null + && commonMetadata_ + != com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance()) { + getCommonMetadataBuilder().mergeFrom(value); + } else { + commonMetadata_ = value; + } + } else { + commonMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public Builder clearCommonMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadata.Builder + getCommonMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + public com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.cloud.documentai.v1.CommonOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * The basic metadata of the long-running operation.
+     * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.CommonOperationMetadata, + com.google.cloud.documentai.v1.CommonOperationMetadata.Builder, + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DisableProcessorMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorMetadata) + private static final com.google.cloud.documentai.v1.DisableProcessorMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorMetadata(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java new file mode 100644 index 000000000000..c482ad76cb32 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * + * @return The commonMetadata. + */ + com.google.cloud.documentai.v1.CommonOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * The basic metadata of the long-running operation.
+   * 
+ * + * .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + com.google.cloud.documentai.v1.CommonOperationMetadataOrBuilder getCommonMetadataOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java new file mode 100644 index 000000000000..635bfe59d04d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequest.java @@ -0,0 +1,643 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the
+ * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorRequest} + */ +public final class DisableProcessorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorRequest) + DisableProcessorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorRequest.newBuilder() to construct. + private DisableProcessorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorRequest.class, + com.google.cloud.documentai.v1.DisableProcessorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DisableProcessorRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorRequest other = + (com.google.cloud.documentai.v1.DisableProcessorRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DisableProcessorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the
+   * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorRequest) + com.google.cloud.documentai.v1.DisableProcessorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorRequest.class, + com.google.cloud.documentai.v1.DisableProcessorRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest build() { + com.google.cloud.documentai.v1.DisableProcessorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorRequest result = + new com.google.cloud.documentai.v1.DisableProcessorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.DisableProcessorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DisableProcessorRequest) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorRequest other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DisableProcessorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorRequest) + private static final com.google.cloud.documentai.v1.DisableProcessorRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorRequest(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java new file mode 100644 index 000000000000..5bde8859cbdc --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The processor resource name to be disabled.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java new file mode 100644 index 000000000000..317e27eda826 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponse.java @@ -0,0 +1,436 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Response message for the
+ * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+ * method. Intentionally empty proto for adding fields in future.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorResponse} + */ +public final class DisableProcessorResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.DisableProcessorResponse) + DisableProcessorResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisableProcessorResponse.newBuilder() to construct. + private DisableProcessorResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisableProcessorResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisableProcessorResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorResponse.class, + com.google.cloud.documentai.v1.DisableProcessorResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.DisableProcessorResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.DisableProcessorResponse other = + (com.google.cloud.documentai.v1.DisableProcessorResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.DisableProcessorResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the
+   * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
+   * method. Intentionally empty proto for adding fields in future.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.DisableProcessorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.DisableProcessorResponse) + com.google.cloud.documentai.v1.DisableProcessorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.DisableProcessorResponse.class, + com.google.cloud.documentai.v1.DisableProcessorResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.DisableProcessorResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_DisableProcessorResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.DisableProcessorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse build() { + com.google.cloud.documentai.v1.DisableProcessorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse buildPartial() { + com.google.cloud.documentai.v1.DisableProcessorResponse result = + new com.google.cloud.documentai.v1.DisableProcessorResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.DisableProcessorResponse) { + return mergeFrom((com.google.cloud.documentai.v1.DisableProcessorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.DisableProcessorResponse other) { + if (other == com.google.cloud.documentai.v1.DisableProcessorResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.DisableProcessorResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.DisableProcessorResponse) + private static final com.google.cloud.documentai.v1.DisableProcessorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.DisableProcessorResponse(); + } + + public static com.google.cloud.documentai.v1.DisableProcessorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisableProcessorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.DisableProcessorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java new file mode 100644 index 000000000000..40324ebe0d78 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DisableProcessorResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface DisableProcessorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.DisableProcessorResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java new file mode 100644 index 000000000000..f8a34cdb2d31 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java @@ -0,0 +1,68662 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Document represents the canonical document resource in Document AI. It is an
+ * interchange format that provides insights into documents and allows for
+ * collaboration between users and Document AI to iterate and optimize for
+ * quality.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + mimeType_ = ""; + text_ = ""; + textStyles_ = java.util.Collections.emptyList(); + pages_ = java.util.Collections.emptyList(); + entities_ = java.util.Collections.emptyList(); + entityRelations_ = java.util.Collections.emptyList(); + textChanges_ = java.util.Collections.emptyList(); + revisions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Document(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.class, + com.google.cloud.documentai.v1.Document.Builder.class); + } + + public interface ShardInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Document.ShardInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The 0-based index of this shard.
+     * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + long getShardIndex(); + + /** + * + * + *
+     * Total number of shards.
+     * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + long getShardCount(); + + /** + * + * + *
+     * The index of the first character in
+     * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+     * document global text.
+     * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + long getTextOffset(); + } + /** + * + * + *
+   * For a large document, sharding may be performed to produce several
+   * document shards. Each document shard contains this field to detail which
+   * shard it is.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.ShardInfo} + */ + public static final class ShardInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Document.ShardInfo) + ShardInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShardInfo.newBuilder() to construct. + private ShardInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ShardInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShardInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_ShardInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_ShardInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.ShardInfo.class, + com.google.cloud.documentai.v1.Document.ShardInfo.Builder.class); + } + + public static final int SHARD_INDEX_FIELD_NUMBER = 1; + private long shardIndex_ = 0L; + /** + * + * + *
+     * The 0-based index of this shard.
+     * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + @java.lang.Override + public long getShardIndex() { + return shardIndex_; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 2; + private long shardCount_ = 0L; + /** + * + * + *
+     * Total number of shards.
+     * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + @java.lang.Override + public long getShardCount() { + return shardCount_; + } + + public static final int TEXT_OFFSET_FIELD_NUMBER = 3; + private long textOffset_ = 0L; + /** + * + * + *
+     * The index of the first character in
+     * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+     * document global text.
+     * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + @java.lang.Override + public long getTextOffset() { + return textOffset_; + } + + 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 (shardIndex_ != 0L) { + output.writeInt64(1, shardIndex_); + } + if (shardCount_ != 0L) { + output.writeInt64(2, shardCount_); + } + if (textOffset_ != 0L) { + output.writeInt64(3, textOffset_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (shardIndex_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, shardIndex_); + } + if (shardCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, shardCount_); + } + if (textOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, textOffset_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.Document.ShardInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Document.ShardInfo other = + (com.google.cloud.documentai.v1.Document.ShardInfo) obj; + + if (getShardIndex() != other.getShardIndex()) return false; + if (getShardCount() != other.getShardCount()) return false; + if (getTextOffset() != other.getTextOffset()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SHARD_INDEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardIndex()); + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardCount()); + hash = (37 * hash) + TEXT_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTextOffset()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.Document.ShardInfo 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; + } + /** + * + * + *
+     * For a large document, sharding may be performed to produce several
+     * document shards. Each document shard contains this field to detail which
+     * shard it is.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.ShardInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Document.ShardInfo) + com.google.cloud.documentai.v1.Document.ShardInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_ShardInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_ShardInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.ShardInfo.class, + com.google.cloud.documentai.v1.Document.ShardInfo.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Document.ShardInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + shardIndex_ = 0L; + shardCount_ = 0L; + textOffset_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_ShardInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.ShardInfo getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Document.ShardInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.ShardInfo build() { + com.google.cloud.documentai.v1.Document.ShardInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.ShardInfo buildPartial() { + com.google.cloud.documentai.v1.Document.ShardInfo result = + new com.google.cloud.documentai.v1.Document.ShardInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Document.ShardInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.shardIndex_ = shardIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shardCount_ = shardCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.textOffset_ = textOffset_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.Document.ShardInfo) { + return mergeFrom((com.google.cloud.documentai.v1.Document.ShardInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Document.ShardInfo other) { + if (other == com.google.cloud.documentai.v1.Document.ShardInfo.getDefaultInstance()) + return this; + if (other.getShardIndex() != 0L) { + setShardIndex(other.getShardIndex()); + } + if (other.getShardCount() != 0L) { + setShardCount(other.getShardCount()); + } + if (other.getTextOffset() != 0L) { + setTextOffset(other.getTextOffset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + shardIndex_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + shardCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + textOffset_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long shardIndex_; + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + @java.lang.Override + public long getShardIndex() { + return shardIndex_; + } + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @param value The shardIndex to set. + * @return This builder for chaining. + */ + public Builder setShardIndex(long value) { + + shardIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearShardIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + shardIndex_ = 0L; + onChanged(); + return this; + } + + private long shardCount_; + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + @java.lang.Override + public long getShardCount() { + return shardCount_; + } + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(long value) { + + shardCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + bitField0_ = (bitField0_ & ~0x00000002); + shardCount_ = 0L; + onChanged(); + return this; + } + + private long textOffset_; + /** + * + * + *
+       * The index of the first character in
+       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + @java.lang.Override + public long getTextOffset() { + return textOffset_; + } + /** + * + * + *
+       * The index of the first character in
+       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @param value The textOffset to set. + * @return This builder for chaining. + */ + public Builder setTextOffset(long value) { + + textOffset_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The index of the first character in
+       * [Document.text][google.cloud.documentai.v1.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @return This builder for chaining. + */ + public Builder clearTextOffset() { + bitField0_ = (bitField0_ & ~0x00000004); + textOffset_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Document.ShardInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Document.ShardInfo) + private static final com.google.cloud.documentai.v1.Document.ShardInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Document.ShardInfo(); + } + + public static com.google.cloud.documentai.v1.Document.ShardInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShardInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.ShardInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StyleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Document.Style) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. + */ + boolean hasTextAnchor(); + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. + */ + com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor(); + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchorOrBuilder(); + + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + * + * @return Whether the color field is set. + */ + boolean hasColor(); + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + * + * @return The color. + */ + com.google.type.Color getColor(); + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + */ + com.google.type.ColorOrBuilder getColorOrBuilder(); + + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. + */ + boolean hasBackgroundColor(); + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + * + * @return The backgroundColor. + */ + com.google.type.Color getBackgroundColor(); + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + */ + com.google.type.ColorOrBuilder getBackgroundColorOrBuilder(); + + /** + * + * + *
+     * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+     * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+     * 
+ * + * string font_weight = 4; + * + * @return The fontWeight. + */ + java.lang.String getFontWeight(); + /** + * + * + *
+     * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+     * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+     * 
+ * + * string font_weight = 4; + * + * @return The bytes for fontWeight. + */ + com.google.protobuf.ByteString getFontWeightBytes(); + + /** + * + * + *
+     * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+     * Possible values are `normal`, `italic`, and `oblique`.
+     * 
+ * + * string text_style = 5; + * + * @return The textStyle. + */ + java.lang.String getTextStyle(); + /** + * + * + *
+     * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+     * Possible values are `normal`, `italic`, and `oblique`.
+     * 
+ * + * string text_style = 5; + * + * @return The bytes for textStyle. + */ + com.google.protobuf.ByteString getTextStyleBytes(); + + /** + * + * + *
+     * [Text
+     * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+     * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+     * <text-decoration-style>
+     * 
+ * + * string text_decoration = 6; + * + * @return The textDecoration. + */ + java.lang.String getTextDecoration(); + /** + * + * + *
+     * [Text
+     * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+     * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+     * <text-decoration-style>
+     * 
+ * + * string text_decoration = 6; + * + * @return The bytes for textDecoration. + */ + com.google.protobuf.ByteString getTextDecorationBytes(); + + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. + */ + boolean hasFontSize(); + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. + */ + com.google.cloud.documentai.v1.Document.Style.FontSize getFontSize(); + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder getFontSizeOrBuilder(); + + /** + * + * + *
+     * Font family such as `Arial`, `Times New Roman`.
+     * https://www.w3schools.com/cssref/pr_font_font-family.asp
+     * 
+ * + * string font_family = 8; + * + * @return The fontFamily. + */ + java.lang.String getFontFamily(); + /** + * + * + *
+     * Font family such as `Arial`, `Times New Roman`.
+     * https://www.w3schools.com/cssref/pr_font_font-family.asp
+     * 
+ * + * string font_family = 8; + * + * @return The bytes for fontFamily. + */ + com.google.protobuf.ByteString getFontFamilyBytes(); + } + /** + * + * + *
+   * Annotation for common text style attributes. This adheres to CSS
+   * conventions as much as possible.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Style} + */ + public static final class Style extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Document.Style) + StyleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Style.newBuilder() to construct. + private Style(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Style() { + fontWeight_ = ""; + textStyle_ = ""; + textDecoration_ = ""; + fontFamily_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Style(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Style.class, + com.google.cloud.documentai.v1.Document.Style.Builder.class); + } + + public interface FontSizeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Document.Style.FontSize) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Font size for the text.
+       * 
+ * + * float size = 1; + * + * @return The size. + */ + float getSize(); + + /** + * + * + *
+       * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+       * `pt`).
+       * 
+ * + * string unit = 2; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+       * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+       * `pt`).
+       * 
+ * + * string unit = 2; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); + } + /** + * + * + *
+     * Font size with unit.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Style.FontSize} + */ + public static final class FontSize extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Document.Style.FontSize) + FontSizeOrBuilder { + private static final long serialVersionUID = 0L; + // Use FontSize.newBuilder() to construct. + private FontSize(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FontSize() { + unit_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FontSize(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_FontSize_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_FontSize_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Style.FontSize.class, + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder.class); + } + + public static final int SIZE_FIELD_NUMBER = 1; + private float size_ = 0F; + /** + * + * + *
+       * Font size for the text.
+       * 
+ * + * float size = 1; + * + * @return The size. + */ + @java.lang.Override + public float getSize() { + return size_; + } + + public static final int UNIT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** + * + * + *
+       * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+       * `pt`).
+       * 
+ * + * string unit = 2; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+       * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+       * `pt`).
+       * 
+ * + * string unit = 2; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = 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 (java.lang.Float.floatToRawIntBits(size_) != 0) { + output.writeFloat(1, size_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, unit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(size_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, size_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, unit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.Document.Style.FontSize)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Document.Style.FontSize other = + (com.google.cloud.documentai.v1.Document.Style.FontSize) obj; + + if (java.lang.Float.floatToIntBits(getSize()) + != java.lang.Float.floatToIntBits(other.getSize())) return false; + if (!getUnit().equals(other.getUnit())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getSize()); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.documentai.v1.Document.Style.FontSize 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; + } + /** + * + * + *
+       * Font size with unit.
+       * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Style.FontSize} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Document.Style.FontSize) + com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_FontSize_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_FontSize_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Style.FontSize.class, + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Document.Style.FontSize.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + size_ = 0F; + unit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_FontSize_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSize getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSize build() { + com.google.cloud.documentai.v1.Document.Style.FontSize result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSize buildPartial() { + com.google.cloud.documentai.v1.Document.Style.FontSize result = + new com.google.cloud.documentai.v1.Document.Style.FontSize(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Document.Style.FontSize result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unit_ = unit_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.Document.Style.FontSize) { + return mergeFrom((com.google.cloud.documentai.v1.Document.Style.FontSize) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Document.Style.FontSize other) { + if (other == com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance()) + return this; + if (other.getSize() != 0F) { + setSize(other.getSize()); + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + size_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + unit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float size_; + /** + * + * + *
+         * Font size for the text.
+         * 
+ * + * float size = 1; + * + * @return The size. + */ + @java.lang.Override + public float getSize() { + return size_; + } + /** + * + * + *
+         * Font size for the text.
+         * 
+ * + * float size = 1; + * + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(float value) { + + size_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Font size for the text.
+         * 
+ * + * float size = 1; + * + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object unit_ = ""; + /** + * + * + *
+         * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+         * `pt`).
+         * 
+ * + * string unit = 2; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+         * `pt`).
+         * 
+ * + * string unit = 2; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+         * `pt`).
+         * 
+ * + * string unit = 2; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+         * `pt`).
+         * 
+ * + * string unit = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Unit for the font size. Follows CSS naming (such as `in`, `px`, and
+         * `pt`).
+         * 
+ * + * string unit = 2; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Document.Style.FontSize) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Document.Style.FontSize) + private static final com.google.cloud.documentai.v1.Document.Style.FontSize DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Document.Style.FontSize(); + } + + public static com.google.cloud.documentai.v1.Document.Style.FontSize getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FontSize parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSize getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int TEXT_ANCHOR_FIELD_NUMBER = 1; + private com.google.cloud.documentai.v1.Document.TextAnchor textAnchor_; + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. + */ + @java.lang.Override + public boolean hasTextAnchor() { + return textAnchor_ != null; + } + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { + return textAnchor_ == null + ? com.google.cloud.documentai.v1.Document.TextAnchor.getDefaultInstance() + : textAnchor_; + } + /** + * + * + *
+     * Text anchor indexing into the
+     * [Document.text][google.cloud.documentai.v1.Document.text].
+     * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchorOrBuilder() { + return textAnchor_ == null + ? com.google.cloud.documentai.v1.Document.TextAnchor.getDefaultInstance() + : textAnchor_; + } + + public static final int COLOR_FIELD_NUMBER = 2; + private com.google.type.Color color_; + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + * + * @return Whether the color field is set. + */ + @java.lang.Override + public boolean hasColor() { + return color_ != null; + } + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + * + * @return The color. + */ + @java.lang.Override + public com.google.type.Color getColor() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + /** + * + * + *
+     * Text color.
+     * 
+ * + * .google.type.Color color = 2; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getColorOrBuilder() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + + public static final int BACKGROUND_COLOR_FIELD_NUMBER = 3; + private com.google.type.Color backgroundColor_; + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. + */ + @java.lang.Override + public boolean hasBackgroundColor() { + return backgroundColor_ != null; + } + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + * + * @return The backgroundColor. + */ + @java.lang.Override + public com.google.type.Color getBackgroundColor() { + return backgroundColor_ == null + ? com.google.type.Color.getDefaultInstance() + : backgroundColor_; + } + /** + * + * + *
+     * Text background color.
+     * 
+ * + * .google.type.Color background_color = 3; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() { + return backgroundColor_ == null + ? com.google.type.Color.getDefaultInstance() + : backgroundColor_; + } + + public static final int FONT_WEIGHT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object fontWeight_ = ""; + /** + * + * + *
+     * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+     * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+     * 
+ * + * string font_weight = 4; + * + * @return The fontWeight. + */ + @java.lang.Override + public java.lang.String getFontWeight() { + java.lang.Object ref = fontWeight_; + 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(); + fontWeight_ = s; + return s; + } + } + /** + * + * + *
+     * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+     * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+     * 
+ * + * string font_weight = 4; + * + * @return The bytes for fontWeight. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFontWeightBytes() { + java.lang.Object ref = fontWeight_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fontWeight_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_STYLE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object textStyle_ = ""; + /** + * + * + *
+     * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+     * Possible values are `normal`, `italic`, and `oblique`.
+     * 
+ * + * string text_style = 5; + * + * @return The textStyle. + */ + @java.lang.Override + public java.lang.String getTextStyle() { + java.lang.Object ref = textStyle_; + 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(); + textStyle_ = s; + return s; + } + } + /** + * + * + *
+     * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+     * Possible values are `normal`, `italic`, and `oblique`.
+     * 
+ * + * string text_style = 5; + * + * @return The bytes for textStyle. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextStyleBytes() { + java.lang.Object ref = textStyle_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + textStyle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_DECORATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object textDecoration_ = ""; + /** + * + * + *
+     * [Text
+     * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+     * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+     * <text-decoration-style>
+     * 
+ * + * string text_decoration = 6; + * + * @return The textDecoration. + */ + @java.lang.Override + public java.lang.String getTextDecoration() { + java.lang.Object ref = textDecoration_; + 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(); + textDecoration_ = s; + return s; + } + } + /** + * + * + *
+     * [Text
+     * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+     * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+     * <text-decoration-style>
+     * 
+ * + * string text_decoration = 6; + * + * @return The bytes for textDecoration. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextDecorationBytes() { + java.lang.Object ref = textDecoration_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + textDecoration_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FONT_SIZE_FIELD_NUMBER = 7; + private com.google.cloud.documentai.v1.Document.Style.FontSize fontSize_; + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. + */ + @java.lang.Override + public boolean hasFontSize() { + return fontSize_ != null; + } + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSize getFontSize() { + return fontSize_ == null + ? com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance() + : fontSize_; + } + /** + * + * + *
+     * Font size.
+     * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder getFontSizeOrBuilder() { + return fontSize_ == null + ? com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance() + : fontSize_; + } + + public static final int FONT_FAMILY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object fontFamily_ = ""; + /** + * + * + *
+     * Font family such as `Arial`, `Times New Roman`.
+     * https://www.w3schools.com/cssref/pr_font_font-family.asp
+     * 
+ * + * string font_family = 8; + * + * @return The fontFamily. + */ + @java.lang.Override + public java.lang.String getFontFamily() { + java.lang.Object ref = fontFamily_; + 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(); + fontFamily_ = s; + return s; + } + } + /** + * + * + *
+     * Font family such as `Arial`, `Times New Roman`.
+     * https://www.w3schools.com/cssref/pr_font_font-family.asp
+     * 
+ * + * string font_family = 8; + * + * @return The bytes for fontFamily. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFontFamilyBytes() { + java.lang.Object ref = fontFamily_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fontFamily_ = 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 (textAnchor_ != null) { + output.writeMessage(1, getTextAnchor()); + } + if (color_ != null) { + output.writeMessage(2, getColor()); + } + if (backgroundColor_ != null) { + output.writeMessage(3, getBackgroundColor()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontWeight_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fontWeight_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textStyle_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, textStyle_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textDecoration_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, textDecoration_); + } + if (fontSize_ != null) { + output.writeMessage(7, getFontSize()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontFamily_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, fontFamily_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (textAnchor_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTextAnchor()); + } + if (color_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getColor()); + } + if (backgroundColor_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackgroundColor()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontWeight_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, fontWeight_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textStyle_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, textStyle_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textDecoration_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, textDecoration_); + } + if (fontSize_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFontSize()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontFamily_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, fontFamily_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.documentai.v1.Document.Style)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Document.Style other = + (com.google.cloud.documentai.v1.Document.Style) obj; + + if (hasTextAnchor() != other.hasTextAnchor()) return false; + if (hasTextAnchor()) { + if (!getTextAnchor().equals(other.getTextAnchor())) return false; + } + if (hasColor() != other.hasColor()) return false; + if (hasColor()) { + if (!getColor().equals(other.getColor())) return false; + } + if (hasBackgroundColor() != other.hasBackgroundColor()) return false; + if (hasBackgroundColor()) { + if (!getBackgroundColor().equals(other.getBackgroundColor())) return false; + } + if (!getFontWeight().equals(other.getFontWeight())) return false; + if (!getTextStyle().equals(other.getTextStyle())) return false; + if (!getTextDecoration().equals(other.getTextDecoration())) return false; + if (hasFontSize() != other.hasFontSize()) return false; + if (hasFontSize()) { + if (!getFontSize().equals(other.getFontSize())) return false; + } + if (!getFontFamily().equals(other.getFontFamily())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTextAnchor()) { + hash = (37 * hash) + TEXT_ANCHOR_FIELD_NUMBER; + hash = (53 * hash) + getTextAnchor().hashCode(); + } + if (hasColor()) { + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + } + if (hasBackgroundColor()) { + hash = (37 * hash) + BACKGROUND_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundColor().hashCode(); + } + hash = (37 * hash) + FONT_WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getFontWeight().hashCode(); + hash = (37 * hash) + TEXT_STYLE_FIELD_NUMBER; + hash = (53 * hash) + getTextStyle().hashCode(); + hash = (37 * hash) + TEXT_DECORATION_FIELD_NUMBER; + hash = (53 * hash) + getTextDecoration().hashCode(); + if (hasFontSize()) { + hash = (37 * hash) + FONT_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getFontSize().hashCode(); + } + hash = (37 * hash) + FONT_FAMILY_FIELD_NUMBER; + hash = (53 * hash) + getFontFamily().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Document.Style parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.documentai.v1.Document.Style 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; + } + /** + * + * + *
+     * Annotation for common text style attributes. This adheres to CSS
+     * conventions as much as possible.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Document.Style} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Document.Style) + com.google.cloud.documentai.v1.Document.StyleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Document.Style.class, + com.google.cloud.documentai.v1.Document.Style.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Document.Style.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + textAnchor_ = null; + if (textAnchorBuilder_ != null) { + textAnchorBuilder_.dispose(); + textAnchorBuilder_ = null; + } + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + backgroundColor_ = null; + if (backgroundColorBuilder_ != null) { + backgroundColorBuilder_.dispose(); + backgroundColorBuilder_ = null; + } + fontWeight_ = ""; + textStyle_ = ""; + textDecoration_ = ""; + fontSize_ = null; + if (fontSizeBuilder_ != null) { + fontSizeBuilder_.dispose(); + fontSizeBuilder_ = null; + } + fontFamily_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentProto + .internal_static_google_cloud_documentai_v1_Document_Style_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Document.Style.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style build() { + com.google.cloud.documentai.v1.Document.Style result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Document.Style buildPartial() { + com.google.cloud.documentai.v1.Document.Style result = + new com.google.cloud.documentai.v1.Document.Style(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Document.Style result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.textAnchor_ = + textAnchorBuilder_ == null ? textAnchor_ : textAnchorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.color_ = colorBuilder_ == null ? color_ : colorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backgroundColor_ = + backgroundColorBuilder_ == null ? backgroundColor_ : backgroundColorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fontWeight_ = fontWeight_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.textStyle_ = textStyle_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.textDecoration_ = textDecoration_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fontSize_ = fontSizeBuilder_ == null ? fontSize_ : fontSizeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fontFamily_ = fontFamily_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.documentai.v1.Document.Style) { + return mergeFrom((com.google.cloud.documentai.v1.Document.Style) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Document.Style other) { + if (other == com.google.cloud.documentai.v1.Document.Style.getDefaultInstance()) + return this; + if (other.hasTextAnchor()) { + mergeTextAnchor(other.getTextAnchor()); + } + if (other.hasColor()) { + mergeColor(other.getColor()); + } + if (other.hasBackgroundColor()) { + mergeBackgroundColor(other.getBackgroundColor()); + } + if (!other.getFontWeight().isEmpty()) { + fontWeight_ = other.fontWeight_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getTextStyle().isEmpty()) { + textStyle_ = other.textStyle_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getTextDecoration().isEmpty()) { + textDecoration_ = other.textDecoration_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasFontSize()) { + mergeFontSize(other.getFontSize()); + } + if (!other.getFontFamily().isEmpty()) { + fontFamily_ = other.fontFamily_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextAnchorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getBackgroundColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + fontWeight_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + textStyle_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + textDecoration_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getFontSizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + fontFamily_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.documentai.v1.Document.TextAnchor textAnchor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.TextAnchor, + com.google.cloud.documentai.v1.Document.TextAnchor.Builder, + com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder> + textAnchorBuilder_; + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. + */ + public boolean hasTextAnchor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. + */ + public com.google.cloud.documentai.v1.Document.TextAnchor getTextAnchor() { + if (textAnchorBuilder_ == null) { + return textAnchor_ == null + ? com.google.cloud.documentai.v1.Document.TextAnchor.getDefaultInstance() + : textAnchor_; + } else { + return textAnchorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public Builder setTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor value) { + if (textAnchorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textAnchor_ = value; + } else { + textAnchorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public Builder setTextAnchor( + com.google.cloud.documentai.v1.Document.TextAnchor.Builder builderForValue) { + if (textAnchorBuilder_ == null) { + textAnchor_ = builderForValue.build(); + } else { + textAnchorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public Builder mergeTextAnchor(com.google.cloud.documentai.v1.Document.TextAnchor value) { + if (textAnchorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && textAnchor_ != null + && textAnchor_ + != com.google.cloud.documentai.v1.Document.TextAnchor.getDefaultInstance()) { + getTextAnchorBuilder().mergeFrom(value); + } else { + textAnchor_ = value; + } + } else { + textAnchorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public Builder clearTextAnchor() { + bitField0_ = (bitField0_ & ~0x00000001); + textAnchor_ = null; + if (textAnchorBuilder_ != null) { + textAnchorBuilder_.dispose(); + textAnchorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public com.google.cloud.documentai.v1.Document.TextAnchor.Builder getTextAnchorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTextAnchorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + public com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder getTextAnchorOrBuilder() { + if (textAnchorBuilder_ != null) { + return textAnchorBuilder_.getMessageOrBuilder(); + } else { + return textAnchor_ == null + ? com.google.cloud.documentai.v1.Document.TextAnchor.getDefaultInstance() + : textAnchor_; + } + } + /** + * + * + *
+       * Text anchor indexing into the
+       * [Document.text][google.cloud.documentai.v1.Document.text].
+       * 
+ * + * .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.TextAnchor, + com.google.cloud.documentai.v1.Document.TextAnchor.Builder, + com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder> + getTextAnchorFieldBuilder() { + if (textAnchorBuilder_ == null) { + textAnchorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.TextAnchor, + com.google.cloud.documentai.v1.Document.TextAnchor.Builder, + com.google.cloud.documentai.v1.Document.TextAnchorOrBuilder>( + getTextAnchor(), getParentForChildren(), isClean()); + textAnchor_ = null; + } + return textAnchorBuilder_; + } + + private com.google.type.Color color_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + colorBuilder_; + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + * + * @return Whether the color field is set. + */ + public boolean hasColor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + * + * @return The color. + */ + public com.google.type.Color getColor() { + if (colorBuilder_ == null) { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } else { + return colorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public Builder setColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + color_ = value; + } else { + colorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public Builder setColor(com.google.type.Color.Builder builderForValue) { + if (colorBuilder_ == null) { + color_ = builderForValue.build(); + } else { + colorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public Builder mergeColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && color_ != null + && color_ != com.google.type.Color.getDefaultInstance()) { + getColorBuilder().mergeFrom(value); + } else { + color_ = value; + } + } else { + colorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public Builder clearColor() { + bitField0_ = (bitField0_ & ~0x00000002); + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public com.google.type.Color.Builder getColorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getColorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + public com.google.type.ColorOrBuilder getColorOrBuilder() { + if (colorBuilder_ != null) { + return colorBuilder_.getMessageOrBuilder(); + } else { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + } + /** + * + * + *
+       * Text color.
+       * 
+ * + * .google.type.Color color = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + getColorFieldBuilder() { + if (colorBuilder_ == null) { + colorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>(getColor(), getParentForChildren(), isClean()); + color_ = null; + } + return colorBuilder_; + } + + private com.google.type.Color backgroundColor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + backgroundColorBuilder_; + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. + */ + public boolean hasBackgroundColor() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + * + * @return The backgroundColor. + */ + public com.google.type.Color getBackgroundColor() { + if (backgroundColorBuilder_ == null) { + return backgroundColor_ == null + ? com.google.type.Color.getDefaultInstance() + : backgroundColor_; + } else { + return backgroundColorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public Builder setBackgroundColor(com.google.type.Color value) { + if (backgroundColorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundColor_ = value; + } else { + backgroundColorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public Builder setBackgroundColor(com.google.type.Color.Builder builderForValue) { + if (backgroundColorBuilder_ == null) { + backgroundColor_ = builderForValue.build(); + } else { + backgroundColorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public Builder mergeBackgroundColor(com.google.type.Color value) { + if (backgroundColorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backgroundColor_ != null + && backgroundColor_ != com.google.type.Color.getDefaultInstance()) { + getBackgroundColorBuilder().mergeFrom(value); + } else { + backgroundColor_ = value; + } + } else { + backgroundColorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public Builder clearBackgroundColor() { + bitField0_ = (bitField0_ & ~0x00000004); + backgroundColor_ = null; + if (backgroundColorBuilder_ != null) { + backgroundColorBuilder_.dispose(); + backgroundColorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public com.google.type.Color.Builder getBackgroundColorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackgroundColorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() { + if (backgroundColorBuilder_ != null) { + return backgroundColorBuilder_.getMessageOrBuilder(); + } else { + return backgroundColor_ == null + ? com.google.type.Color.getDefaultInstance() + : backgroundColor_; + } + } + /** + * + * + *
+       * Text background color.
+       * 
+ * + * .google.type.Color background_color = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + getBackgroundColorFieldBuilder() { + if (backgroundColorBuilder_ == null) { + backgroundColorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>( + getBackgroundColor(), getParentForChildren(), isClean()); + backgroundColor_ = null; + } + return backgroundColorBuilder_; + } + + private java.lang.Object fontWeight_ = ""; + /** + * + * + *
+       * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+       * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+       * 
+ * + * string font_weight = 4; + * + * @return The fontWeight. + */ + public java.lang.String getFontWeight() { + java.lang.Object ref = fontWeight_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fontWeight_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+       * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+       * 
+ * + * string font_weight = 4; + * + * @return The bytes for fontWeight. + */ + public com.google.protobuf.ByteString getFontWeightBytes() { + java.lang.Object ref = fontWeight_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fontWeight_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+       * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+       * 
+ * + * string font_weight = 4; + * + * @param value The fontWeight to set. + * @return This builder for chaining. + */ + public Builder setFontWeight(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fontWeight_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+       * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+       * 
+ * + * string font_weight = 4; + * + * @return This builder for chaining. + */ + public Builder clearFontWeight() { + fontWeight_ = getDefaultInstance().getFontWeight(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
+       * Possible values are `normal`, `bold`, `bolder`, and `lighter`.
+       * 
+ * + * string font_weight = 4; + * + * @param value The bytes for fontWeight to set. + * @return This builder for chaining. + */ + public Builder setFontWeightBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fontWeight_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object textStyle_ = ""; + /** + * + * + *
+       * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+       * Possible values are `normal`, `italic`, and `oblique`.
+       * 
+ * + * string text_style = 5; + * + * @return The textStyle. + */ + public java.lang.String getTextStyle() { + java.lang.Object ref = textStyle_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + textStyle_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+       * Possible values are `normal`, `italic`, and `oblique`.
+       * 
+ * + * string text_style = 5; + * + * @return The bytes for textStyle. + */ + public com.google.protobuf.ByteString getTextStyleBytes() { + java.lang.Object ref = textStyle_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + textStyle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+       * Possible values are `normal`, `italic`, and `oblique`.
+       * 
+ * + * string text_style = 5; + * + * @param value The textStyle to set. + * @return This builder for chaining. + */ + public Builder setTextStyle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + textStyle_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+       * Possible values are `normal`, `italic`, and `oblique`.
+       * 
+ * + * string text_style = 5; + * + * @return This builder for chaining. + */ + public Builder clearTextStyle() { + textStyle_ = getDefaultInstance().getTextStyle(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+       * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
+       * Possible values are `normal`, `italic`, and `oblique`.
+       * 
+ * + * string text_style = 5; + * + * @param value The bytes for textStyle to set. + * @return This builder for chaining. + */ + public Builder setTextStyleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + textStyle_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object textDecoration_ = ""; + /** + * + * + *
+       * [Text
+       * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+       * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+       * <text-decoration-style>
+       * 
+ * + * string text_decoration = 6; + * + * @return The textDecoration. + */ + public java.lang.String getTextDecoration() { + java.lang.Object ref = textDecoration_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + textDecoration_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Text
+       * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+       * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+       * <text-decoration-style>
+       * 
+ * + * string text_decoration = 6; + * + * @return The bytes for textDecoration. + */ + public com.google.protobuf.ByteString getTextDecorationBytes() { + java.lang.Object ref = textDecoration_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + textDecoration_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Text
+       * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+       * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+       * <text-decoration-style>
+       * 
+ * + * string text_decoration = 6; + * + * @param value The textDecoration to set. + * @return This builder for chaining. + */ + public Builder setTextDecoration(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + textDecoration_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * [Text
+       * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+       * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+       * <text-decoration-style>
+       * 
+ * + * string text_decoration = 6; + * + * @return This builder for chaining. + */ + public Builder clearTextDecoration() { + textDecoration_ = getDefaultInstance().getTextDecoration(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+       * [Text
+       * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
+       * Follows CSS standard. <text-decoration-line> <text-decoration-color>
+       * <text-decoration-style>
+       * 
+ * + * string text_decoration = 6; + * + * @param value The bytes for textDecoration to set. + * @return This builder for chaining. + */ + public Builder setTextDecorationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + textDecoration_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.Document.Style.FontSize fontSize_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Style.FontSize, + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder, + com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder> + fontSizeBuilder_; + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. + */ + public boolean hasFontSize() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. + */ + public com.google.cloud.documentai.v1.Document.Style.FontSize getFontSize() { + if (fontSizeBuilder_ == null) { + return fontSize_ == null + ? com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance() + : fontSize_; + } else { + return fontSizeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public Builder setFontSize(com.google.cloud.documentai.v1.Document.Style.FontSize value) { + if (fontSizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fontSize_ = value; + } else { + fontSizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public Builder setFontSize( + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder builderForValue) { + if (fontSizeBuilder_ == null) { + fontSize_ = builderForValue.build(); + } else { + fontSizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public Builder mergeFontSize(com.google.cloud.documentai.v1.Document.Style.FontSize value) { + if (fontSizeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && fontSize_ != null + && fontSize_ + != com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance()) { + getFontSizeBuilder().mergeFrom(value); + } else { + fontSize_ = value; + } + } else { + fontSizeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public Builder clearFontSize() { + bitField0_ = (bitField0_ & ~0x00000040); + fontSize_ = null; + if (fontSizeBuilder_ != null) { + fontSizeBuilder_.dispose(); + fontSizeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public com.google.cloud.documentai.v1.Document.Style.FontSize.Builder getFontSizeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getFontSizeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + public com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder + getFontSizeOrBuilder() { + if (fontSizeBuilder_ != null) { + return fontSizeBuilder_.getMessageOrBuilder(); + } else { + return fontSize_ == null + ? com.google.cloud.documentai.v1.Document.Style.FontSize.getDefaultInstance() + : fontSize_; + } + } + /** + * + * + *
+       * Font size.
+       * 
+ * + * .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Style.FontSize, + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder, + com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder> + getFontSizeFieldBuilder() { + if (fontSizeBuilder_ == null) { + fontSizeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Document.Style.FontSize, + com.google.cloud.documentai.v1.Document.Style.FontSize.Builder, + com.google.cloud.documentai.v1.Document.Style.FontSizeOrBuilder>( + getFontSize(), getParentForChildren(), isClean()); + fontSize_ = null; + } + return fontSizeBuilder_; + } + + private java.lang.Object fontFamily_ = ""; + /** + * + * + *
+       * Font family such as `Arial`, `Times New Roman`.
+       * https://www.w3schools.com/cssref/pr_font_font-family.asp
+       * 
+ * + * string font_family = 8; + * + * @return The fontFamily. + */ + public java.lang.String getFontFamily() { + java.lang.Object ref = fontFamily_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fontFamily_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Font family such as `Arial`, `Times New Roman`.
+       * https://www.w3schools.com/cssref/pr_font_font-family.asp
+       * 
+ * + * string font_family = 8; + * + * @return The bytes for fontFamily. + */ + public com.google.protobuf.ByteString getFontFamilyBytes() { + java.lang.Object ref = fontFamily_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fontFamily_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Font family such as `Arial`, `Times New Roman`.
+       * https://www.w3schools.com/cssref/pr_font_font-family.asp
+       * 
+ * + * string font_family = 8; + * + * @param value The fontFamily to set. + * @return This builder for chaining. + */ + public Builder setFontFamily(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fontFamily_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * Font family such as `Arial`, `Times New Roman`.
+       * https://www.w3schools.com/cssref/pr_font_font-family.asp
+       * 
+ * + * string font_family = 8; + * + * @return This builder for chaining. + */ + public Builder clearFontFamily() { + fontFamily_ = getDefaultInstance().getFontFamily(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+       * Font family such as `Arial`, `Times New Roman`.
+       * https://www.w3schools.com/cssref/pr_font_font-family.asp
+       * 
+ * + * string font_family = 8; + * + * @param value The bytes for fontFamily to set. + * @return This builder for chaining. + */ + public Builder setFontFamilyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fontFamily_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Document.Style) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Document.Style) + private static final com.google.cloud.documentai.v1.Document.Style DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Document.Style(); + } + + public static com.google.cloud.documentai.v1.Document.Style getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser