diff --git a/java-document-ai/README.md b/java-document-ai/README.md index f9d5eced2db1..bf14fb196ac1 100644 --- a/java-document-ai/README.md +++ b/java-document-ai/README.md @@ -20,20 +20,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-document-ai - 2.14.0 + 2.15.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-document-ai:2.14.0' +implementation 'com.google.cloud:google-cloud-document-ai:2.15.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.14.0" +libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.15.0" ``` diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java index 7a83c677f50c..173e44adb85c 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClient.java @@ -265,7 +265,10 @@ public final ProcessResponse processDocument(ResourceName name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = + * EvaluationName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]") + * .toString(); * ProcessResponse response = documentProcessorServiceClient.processDocument(name); * } * } @@ -395,7 +398,10 @@ public final UnaryCallable processDocumentCalla * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (DocumentProcessorServiceClient documentProcessorServiceClient = * DocumentProcessorServiceClient.create()) { - * String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + * String name = + * EvaluationName.of( + * "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]") + * .toString(); * BatchProcessResponse response = * documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); * } @@ -1223,6 +1229,191 @@ public final UnaryCallable getProcessorCallable( return stub.getProcessorCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Trains a new processor version. Operation metadata is returned as + * cloud_documentai_core.TrainProcessorVersionMetadata. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build();
+   *   TrainProcessorVersionResponse response =
+   *       documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get();
+   * }
+   * }
+ * + * @param parent Required. The parent (project, location and processor) to create the new version + * for. Format: `projects/{project}/locations/{location}/processors/{processor}`. + * @param processorVersion Required. The processor version to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + trainProcessorVersionAsync(ProcessorName parent, ProcessorVersion processorVersion) { + TrainProcessorVersionRequest request = + TrainProcessorVersionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProcessorVersion(processorVersion) + .build(); + return trainProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Trains a new processor version. Operation metadata is returned as + * cloud_documentai_core.TrainProcessorVersionMetadata. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build();
+   *   TrainProcessorVersionResponse response =
+   *       documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get();
+   * }
+   * }
+ * + * @param parent Required. The parent (project, location and processor) to create the new version + * for. Format: `projects/{project}/locations/{location}/processors/{processor}`. + * @param processorVersion Required. The processor version to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + trainProcessorVersionAsync(String parent, ProcessorVersion processorVersion) { + TrainProcessorVersionRequest request = + TrainProcessorVersionRequest.newBuilder() + .setParent(parent) + .setProcessorVersion(processorVersion) + .build(); + return trainProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Trains a new processor version. Operation metadata is returned as + * cloud_documentai_core.TrainProcessorVersionMetadata. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   TrainProcessorVersionRequest request =
+   *       TrainProcessorVersionRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setProcessorVersion(ProcessorVersion.newBuilder().build())
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
+   *           .setBaseProcessorVersion("baseProcessorVersion337709271")
+   *           .build();
+   *   TrainProcessorVersionResponse response =
+   *       documentProcessorServiceClient.trainProcessorVersionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + trainProcessorVersionAsync(TrainProcessorVersionRequest request) { + return trainProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Trains a new processor version. Operation metadata is returned as + * cloud_documentai_core.TrainProcessorVersionMetadata. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   TrainProcessorVersionRequest request =
+   *       TrainProcessorVersionRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setProcessorVersion(ProcessorVersion.newBuilder().build())
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
+   *           .setBaseProcessorVersion("baseProcessorVersion337709271")
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .trainProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   TrainProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + return stub.trainProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Trains a new processor version. Operation metadata is returned as + * cloud_documentai_core.TrainProcessorVersionMetadata. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   TrainProcessorVersionRequest request =
+   *       TrainProcessorVersionRequest.newBuilder()
+   *           .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setProcessorVersion(ProcessorVersion.newBuilder().build())
+   *           .setDocumentSchema(DocumentSchema.newBuilder().build())
+   *           .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build())
+   *           .setBaseProcessorVersion("baseProcessorVersion337709271")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.trainProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + trainProcessorVersionCallable() { + return stub.trainProcessorVersionCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a processor version detail. @@ -2783,6 +2974,507 @@ public final UnaryCallable reviewDocumentCalla return stub.reviewDocumentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName processorVersion =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   EvaluateProcessorVersionResponse response =
+   *       documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get();
+   * }
+   * }
+ * + * @param processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + evaluateProcessorVersionAsync(ProcessorVersionName processorVersion) { + EvaluateProcessorVersionRequest request = + EvaluateProcessorVersionRequest.newBuilder() + .setProcessorVersion(processorVersion == null ? null : processorVersion.toString()) + .build(); + return evaluateProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String processorVersion =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   EvaluateProcessorVersionResponse response =
+   *       documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get();
+   * }
+   * }
+ * + * @param processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + evaluateProcessorVersionAsync(String processorVersion) { + EvaluateProcessorVersionRequest request = + EvaluateProcessorVersionRequest.newBuilder().setProcessorVersion(processorVersion).build(); + return evaluateProcessorVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EvaluateProcessorVersionRequest request =
+   *       EvaluateProcessorVersionRequest.newBuilder()
+   *           .setProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
+   *           .build();
+   *   EvaluateProcessorVersionResponse response =
+   *       documentProcessorServiceClient.evaluateProcessorVersionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + evaluateProcessorVersionAsync(EvaluateProcessorVersionRequest request) { + return evaluateProcessorVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EvaluateProcessorVersionRequest request =
+   *       EvaluateProcessorVersionRequest.newBuilder()
+   *           .setProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .evaluateProcessorVersionOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   EvaluateProcessorVersionResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + return stub.evaluateProcessorVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EvaluateProcessorVersionRequest request =
+   *       EvaluateProcessorVersionRequest.newBuilder()
+   *           .setProcessorVersion(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.evaluateProcessorVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + evaluateProcessorVersionCallable() { + return stub.evaluateProcessorVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a specific evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   EvaluationName name =
+   *       EvaluationName.of(
+   *           "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]");
+   *   Evaluation response = documentProcessorServiceClient.getEvaluation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Evaluation getEvaluation(EvaluationName name) { + GetEvaluationRequest request = + GetEvaluationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEvaluation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a specific evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name =
+   *       EvaluationName.of(
+   *               "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]")
+   *           .toString();
+   *   Evaluation response = documentProcessorServiceClient.getEvaluation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Evaluation getEvaluation(String name) { + GetEvaluationRequest request = GetEvaluationRequest.newBuilder().setName(name).build(); + return getEvaluation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a specific evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetEvaluationRequest request =
+   *       GetEvaluationRequest.newBuilder()
+   *           .setName(
+   *               EvaluationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[PROCESSOR]",
+   *                       "[PROCESSOR_VERSION]",
+   *                       "[EVALUATION]")
+   *                   .toString())
+   *           .build();
+   *   Evaluation response = documentProcessorServiceClient.getEvaluation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Evaluation getEvaluation(GetEvaluationRequest request) { + return getEvaluationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a specific evaluation. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   GetEvaluationRequest request =
+   *       GetEvaluationRequest.newBuilder()
+   *           .setName(
+   *               EvaluationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[PROCESSOR]",
+   *                       "[PROCESSOR_VERSION]",
+   *                       "[EVALUATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.getEvaluationCallable().futureCall(request);
+   *   // Do something.
+   *   Evaluation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEvaluationCallable() { + return stub.getEvaluationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a set of evaluations for a given processor version. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorVersionName parent =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]");
+   *   for (Evaluation element :
+   *       documentProcessorServiceClient.listEvaluations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEvaluationsPagedResponse listEvaluations(ProcessorVersionName parent) { + ListEvaluationsRequest request = + ListEvaluationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listEvaluations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a set of evaluations for a given processor version. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String parent =
+   *       ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *           .toString();
+   *   for (Evaluation element :
+   *       documentProcessorServiceClient.listEvaluations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEvaluationsPagedResponse listEvaluations(String parent) { + ListEvaluationsRequest request = ListEvaluationsRequest.newBuilder().setParent(parent).build(); + return listEvaluations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a set of evaluations for a given processor version. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListEvaluationsRequest request =
+   *       ListEvaluationsRequest.newBuilder()
+   *           .setParent(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Evaluation element :
+   *       documentProcessorServiceClient.listEvaluations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEvaluationsPagedResponse listEvaluations(ListEvaluationsRequest request) { + return listEvaluationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a set of evaluations for a given processor version. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListEvaluationsRequest request =
+   *       ListEvaluationsRequest.newBuilder()
+   *           .setParent(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.listEvaluationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Evaluation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listEvaluationsPagedCallable() { + return stub.listEvaluationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a set of evaluations for a given processor version. + * + *

Sample code: + * + *

{@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
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ListEvaluationsRequest request =
+   *       ListEvaluationsRequest.newBuilder()
+   *           .setParent(
+   *               ProcessorVersionName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListEvaluationsResponse response =
+   *         documentProcessorServiceClient.listEvaluationsCallable().call(request);
+   *     for (Evaluation element : response.getEvaluationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listEvaluationsCallable() { + return stub.listEvaluationsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. @@ -3215,6 +3907,83 @@ protected ListProcessorVersionsFixedSizeCollection createCollection( } } + public static class ListEvaluationsPagedResponse + extends AbstractPagedListResponse< + ListEvaluationsRequest, + ListEvaluationsResponse, + Evaluation, + ListEvaluationsPage, + ListEvaluationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListEvaluationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListEvaluationsPagedResponse(ListEvaluationsPage page) { + super(page, ListEvaluationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEvaluationsPage + extends AbstractPage< + ListEvaluationsRequest, ListEvaluationsResponse, Evaluation, ListEvaluationsPage> { + + private ListEvaluationsPage( + PageContext context, + ListEvaluationsResponse response) { + super(context, response); + } + + private static ListEvaluationsPage createEmptyPage() { + return new ListEvaluationsPage(null, null); + } + + @Override + protected ListEvaluationsPage createPage( + PageContext context, + ListEvaluationsResponse response) { + return new ListEvaluationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEvaluationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEvaluationsRequest, + ListEvaluationsResponse, + Evaluation, + ListEvaluationsPage, + ListEvaluationsFixedSizeCollection> { + + private ListEvaluationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEvaluationsFixedSizeCollection createEmptyCollection() { + return new ListEvaluationsFixedSizeCollection(null, 0); + } + + @Override + protected ListEvaluationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEvaluationsFixedSizeCollection(pages, collectionSize); + } + } + public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java index f9ca094c1be0..b6cd1af358ed 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceSettings.java @@ -16,6 +16,7 @@ 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; @@ -135,6 +136,23 @@ 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() { @@ -272,6 +290,35 @@ public UnaryCallSettings reviewDocumentSetting .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() { @@ -448,6 +495,21 @@ public UnaryCallSettings.Builder getProcessorSet 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() { @@ -574,6 +636,33 @@ public UnaryCallSettings.Builder reviewDocumen 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> diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json index 892bb4377e8a..4700b003434d 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/gapic_metadata.json @@ -31,9 +31,15 @@ "EnableProcessor": { "methods": ["enableProcessorAsync", "enableProcessorOperationCallable", "enableProcessorCallable"] }, + "EvaluateProcessorVersion": { + "methods": ["evaluateProcessorVersionAsync", "evaluateProcessorVersionAsync", "evaluateProcessorVersionAsync", "evaluateProcessorVersionOperationCallable", "evaluateProcessorVersionCallable"] + }, "FetchProcessorTypes": { "methods": ["fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypes", "fetchProcessorTypesCallable"] }, + "GetEvaluation": { + "methods": ["getEvaluation", "getEvaluation", "getEvaluation", "getEvaluationCallable"] + }, "GetLocation": { "methods": ["getLocation", "getLocationCallable"] }, @@ -46,6 +52,9 @@ "GetProcessorVersion": { "methods": ["getProcessorVersion", "getProcessorVersion", "getProcessorVersion", "getProcessorVersionCallable"] }, + "ListEvaluations": { + "methods": ["listEvaluations", "listEvaluations", "listEvaluations", "listEvaluationsPagedCallable", "listEvaluationsCallable"] + }, "ListLocations": { "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] }, @@ -67,6 +76,9 @@ "SetDefaultProcessorVersion": { "methods": ["setDefaultProcessorVersionAsync", "setDefaultProcessorVersionOperationCallable", "setDefaultProcessorVersionCallable"] }, + "TrainProcessorVersion": { + "methods": ["trainProcessorVersionAsync", "trainProcessorVersionAsync", "trainProcessorVersionAsync", "trainProcessorVersionOperationCallable", "trainProcessorVersionCallable"] + }, "UndeployProcessorVersion": { "methods": ["undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionAsync", "undeployProcessorVersionOperationCallable", "undeployProcessorVersionCallable"] } diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java index ee87ad7b766b..c81306309a5c 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStub.java @@ -16,6 +16,7 @@ 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; @@ -41,11 +42,18 @@ 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; @@ -63,6 +71,9 @@ 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; @@ -138,6 +149,19 @@ public UnaryCallable getProcessorCallable() { throw new UnsupportedOperationException("Not implemented: getProcessorCallable()"); } + public OperationCallable< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: trainProcessorVersionOperationCallable()"); + } + + public UnaryCallable trainProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: trainProcessorVersionCallable()"); + } + public UnaryCallable getProcessorVersionCallable() { throw new UnsupportedOperationException("Not implemented: getProcessorVersionCallable()"); } @@ -247,6 +271,33 @@ public UnaryCallable reviewDocumentCallable() throw new UnsupportedOperationException("Not implemented: reviewDocumentCallable()"); } + public OperationCallable< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: evaluateProcessorVersionOperationCallable()"); + } + + public UnaryCallable + evaluateProcessorVersionCallable() { + throw new UnsupportedOperationException("Not implemented: evaluateProcessorVersionCallable()"); + } + + public UnaryCallable getEvaluationCallable() { + throw new UnsupportedOperationException("Not implemented: getEvaluationCallable()"); + } + + public UnaryCallable + listEvaluationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEvaluationsPagedCallable()"); + } + + public UnaryCallable listEvaluationsCallable() { + throw new UnsupportedOperationException("Not implemented: listEvaluationsCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java index 97fce3e2d036..170fa298548f 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java @@ -16,6 +16,7 @@ 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; @@ -67,11 +68,18 @@ 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; @@ -89,6 +97,9 @@ 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; @@ -167,6 +178,13 @@ public class DocumentProcessorServiceStubSettings ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> listProcessorsSettings; private final UnaryCallSettings getProcessorSettings; + private final UnaryCallSettings + trainProcessorVersionSettings; + private final OperationCallSettings< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings; private final UnaryCallSettings getProcessorVersionSettings; private final PagedCallSettings< @@ -216,6 +234,17 @@ public class DocumentProcessorServiceStubSettings private final OperationCallSettings< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final UnaryCallSettings + evaluateProcessorVersionSettings; + private final OperationCallSettings< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings; + private final UnaryCallSettings getEvaluationSettings; + private final PagedCallSettings< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -339,6 +368,45 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor< + ListEvaluationsRequest, ListEvaluationsResponse, Evaluation> + LIST_EVALUATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEvaluationsRequest injectToken( + ListEvaluationsRequest payload, String token) { + return ListEvaluationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEvaluationsRequest injectPageSize( + ListEvaluationsRequest payload, int pageSize) { + return ListEvaluationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEvaluationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEvaluationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEvaluationsResponse payload) { + return payload.getEvaluationsList() == null + ? ImmutableList.of() + : payload.getEvaluationsList(); + } + }; + private static final PagedListDescriptor LIST_LOCATIONS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -437,6 +505,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + LIST_EVALUATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEvaluationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_EVALUATIONS_PAGE_STR_DESC, request, context); + return ListEvaluationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> LIST_LOCATIONS_PAGE_STR_FACT = @@ -500,6 +585,21 @@ public UnaryCallSettings getProcessorSettings() return getProcessorSettings; } + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings + trainProcessorVersionSettings() { + return trainProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to trainProcessorVersion. */ + public OperationCallSettings< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return trainProcessorVersionOperationSettings; + } + /** Returns the object with the settings used for calls to getProcessorVersion. */ public UnaryCallSettings getProcessorVersionSettings() { @@ -624,6 +724,33 @@ public UnaryCallSettings reviewDocumentSetting return reviewDocumentOperationSettings; } + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings + evaluateProcessorVersionSettings() { + return evaluateProcessorVersionSettings; + } + + /** Returns the object with the settings used for calls to evaluateProcessorVersion. */ + public OperationCallSettings< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return evaluateProcessorVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to getEvaluation. */ + public UnaryCallSettings getEvaluationSettings() { + return getEvaluationSettings; + } + + /** Returns the object with the settings used for calls to listEvaluations. */ + public PagedCallSettings< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return listEvaluationsSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -750,6 +877,9 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I getProcessorTypeSettings = settingsBuilder.getProcessorTypeSettings().build(); listProcessorsSettings = settingsBuilder.listProcessorsSettings().build(); getProcessorSettings = settingsBuilder.getProcessorSettings().build(); + trainProcessorVersionSettings = settingsBuilder.trainProcessorVersionSettings().build(); + trainProcessorVersionOperationSettings = + settingsBuilder.trainProcessorVersionOperationSettings().build(); getProcessorVersionSettings = settingsBuilder.getProcessorVersionSettings().build(); listProcessorVersionsSettings = settingsBuilder.listProcessorVersionsSettings().build(); deleteProcessorVersionSettings = settingsBuilder.deleteProcessorVersionSettings().build(); @@ -774,6 +904,11 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I settingsBuilder.setDefaultProcessorVersionOperationSettings().build(); reviewDocumentSettings = settingsBuilder.reviewDocumentSettings().build(); reviewDocumentOperationSettings = settingsBuilder.reviewDocumentOperationSettings().build(); + evaluateProcessorVersionSettings = settingsBuilder.evaluateProcessorVersionSettings().build(); + evaluateProcessorVersionOperationSettings = + settingsBuilder.evaluateProcessorVersionOperationSettings().build(); + getEvaluationSettings = settingsBuilder.getEvaluationSettings().build(); + listEvaluationsSettings = settingsBuilder.listEvaluationsSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); } @@ -800,6 +935,13 @@ public static class Builder ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse> listProcessorsSettings; private final UnaryCallSettings.Builder getProcessorSettings; + private final UnaryCallSettings.Builder + trainProcessorVersionSettings; + private final OperationCallSettings.Builder< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings; private final UnaryCallSettings.Builder getProcessorVersionSettings; private final PagedCallSettings.Builder< @@ -855,6 +997,17 @@ public static class Builder private final OperationCallSettings.Builder< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> reviewDocumentOperationSettings; + private final UnaryCallSettings.Builder + evaluateProcessorVersionSettings; + private final OperationCallSettings.Builder< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings; + private final UnaryCallSettings.Builder getEvaluationSettings; + private final PagedCallSettings.Builder< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -910,6 +1063,8 @@ protected Builder(ClientContext clientContext) { getProcessorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listProcessorsSettings = PagedCallSettings.newBuilder(LIST_PROCESSORS_PAGE_STR_FACT); getProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + trainProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + trainProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); getProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listProcessorVersionsSettings = PagedCallSettings.newBuilder(LIST_PROCESSOR_VERSIONS_PAGE_STR_FACT); @@ -930,6 +1085,10 @@ protected Builder(ClientContext clientContext) { setDefaultProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); reviewDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); reviewDocumentOperationSettings = OperationCallSettings.newBuilder(); + evaluateProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + evaluateProcessorVersionOperationSettings = OperationCallSettings.newBuilder(); + getEvaluationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listEvaluationsSettings = PagedCallSettings.newBuilder(LIST_EVALUATIONS_PAGE_STR_FACT); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -942,6 +1101,7 @@ protected Builder(ClientContext clientContext) { getProcessorTypeSettings, listProcessorsSettings, getProcessorSettings, + trainProcessorVersionSettings, getProcessorVersionSettings, listProcessorVersionsSettings, deleteProcessorVersionSettings, @@ -953,6 +1113,9 @@ protected Builder(ClientContext clientContext) { disableProcessorSettings, setDefaultProcessorVersionSettings, reviewDocumentSettings, + evaluateProcessorVersionSettings, + getEvaluationSettings, + listEvaluationsSettings, listLocationsSettings, getLocationSettings); initDefaults(this); @@ -970,6 +1133,9 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { getProcessorTypeSettings = settings.getProcessorTypeSettings.toBuilder(); listProcessorsSettings = settings.listProcessorsSettings.toBuilder(); getProcessorSettings = settings.getProcessorSettings.toBuilder(); + trainProcessorVersionSettings = settings.trainProcessorVersionSettings.toBuilder(); + trainProcessorVersionOperationSettings = + settings.trainProcessorVersionOperationSettings.toBuilder(); getProcessorVersionSettings = settings.getProcessorVersionSettings.toBuilder(); listProcessorVersionsSettings = settings.listProcessorVersionsSettings.toBuilder(); deleteProcessorVersionSettings = settings.deleteProcessorVersionSettings.toBuilder(); @@ -993,6 +1159,11 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { settings.setDefaultProcessorVersionOperationSettings.toBuilder(); reviewDocumentSettings = settings.reviewDocumentSettings.toBuilder(); reviewDocumentOperationSettings = settings.reviewDocumentOperationSettings.toBuilder(); + evaluateProcessorVersionSettings = settings.evaluateProcessorVersionSettings.toBuilder(); + evaluateProcessorVersionOperationSettings = + settings.evaluateProcessorVersionOperationSettings.toBuilder(); + getEvaluationSettings = settings.getEvaluationSettings.toBuilder(); + listEvaluationsSettings = settings.listEvaluationsSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); @@ -1005,6 +1176,7 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { getProcessorTypeSettings, listProcessorsSettings, getProcessorSettings, + trainProcessorVersionSettings, getProcessorVersionSettings, listProcessorVersionsSettings, deleteProcessorVersionSettings, @@ -1016,6 +1188,9 @@ protected Builder(DocumentProcessorServiceStubSettings settings) { disableProcessorSettings, setDefaultProcessorVersionSettings, reviewDocumentSettings, + evaluateProcessorVersionSettings, + getEvaluationSettings, + listEvaluationsSettings, listLocationsSettings, getLocationSettings); } @@ -1082,6 +1257,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .trainProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .getProcessorVersionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -1137,6 +1317,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .evaluateProcessorVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getEvaluationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listEvaluationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -1171,6 +1366,32 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .trainProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + TrainProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + TrainProcessorVersionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .deleteProcessorVersionOperationSettings() .setInitialCallSettings( @@ -1372,6 +1593,32 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .evaluateProcessorVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + EvaluateProcessorVersionResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + EvaluateProcessorVersionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -1441,6 +1688,23 @@ public UnaryCallSettings.Builder getProcessorSet return getProcessorSettings; } + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + public UnaryCallSettings.Builder + trainProcessorVersionSettings() { + return trainProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to trainProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + TrainProcessorVersionRequest, + TrainProcessorVersionResponse, + TrainProcessorVersionMetadata> + trainProcessorVersionOperationSettings() { + return trainProcessorVersionOperationSettings; + } + /** Returns the builder for the settings used for calls to getProcessorVersion. */ public UnaryCallSettings.Builder getProcessorVersionSettings() { @@ -1583,6 +1847,35 @@ public UnaryCallSettings.Builder reviewDocumen return reviewDocumentOperationSettings; } + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + public UnaryCallSettings.Builder + evaluateProcessorVersionSettings() { + return evaluateProcessorVersionSettings; + } + + /** Returns the builder for the settings used for calls to evaluateProcessorVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + EvaluateProcessorVersionRequest, + EvaluateProcessorVersionResponse, + EvaluateProcessorVersionMetadata> + evaluateProcessorVersionOperationSettings() { + return evaluateProcessorVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to getEvaluation. */ + public UnaryCallSettings.Builder getEvaluationSettings() { + return getEvaluationSettings; + } + + /** Returns the builder for the settings used for calls to listEvaluations. */ + public PagedCallSettings.Builder< + ListEvaluationsRequest, ListEvaluationsResponse, ListEvaluationsPagedResponse> + listEvaluationsSettings() { + return listEvaluationsSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java index 84b62a036f52..b123bb76061d 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/GrpcDocumentProcessorServiceStub.java @@ -16,6 +16,7 @@ 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; @@ -45,11 +46,18 @@ 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; @@ -67,6 +75,9 @@ 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; @@ -168,6 +179,17 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .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() @@ -290,6 +312,40 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt .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() @@ -324,6 +380,13 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt 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 @@ -372,6 +435,18 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt 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; @@ -495,6 +570,17 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings + trainProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings getProcessorVersionTransportSettings = GrpcCallSettings.newBuilder() @@ -612,6 +698,39 @@ protected GrpcDocumentProcessorServiceStub( return params.build(); }) .build(); + GrpcCallSettings + evaluateProcessorVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "processor_version", String.valueOf(request.getProcessorVersion())); + return params.build(); + }) + .build(); + GrpcCallSettings getEvaluationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -674,6 +793,17 @@ protected GrpcDocumentProcessorServiceStub( 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, @@ -772,6 +902,26 @@ protected GrpcDocumentProcessorServiceStub( 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); @@ -845,6 +995,20 @@ 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; @@ -968,6 +1132,37 @@ public UnaryCallable reviewDocumentCallable() 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; diff --git a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java index 8064035cecaf..3286d44b32aa 100644 --- a/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java +++ b/java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/HttpJsonDocumentProcessorServiceStub.java @@ -16,6 +16,7 @@ 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; @@ -53,11 +54,18 @@ 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; @@ -75,6 +83,9 @@ 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; @@ -107,6 +118,7 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .add(UndeployProcessorVersionResponse.getDescriptor()) .add(EnableProcessorResponse.getDescriptor()) .add(SetDefaultProcessorVersionMetadata.getDescriptor()) + .add(EvaluateProcessorVersionResponse.getDescriptor()) .add(EnableProcessorMetadata.getDescriptor()) .add(ReviewDocumentOperationMetadata.getDescriptor()) .add(SetDefaultProcessorVersionResponse.getDescriptor()) @@ -117,10 +129,13 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .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 @@ -384,6 +399,47 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi .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() @@ -822,6 +878,123 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi 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() @@ -907,6 +1080,13 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi 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 @@ -955,6 +1135,18 @@ public class HttpJsonDocumentProcessorServiceStub extends DocumentProcessorServi 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; @@ -1047,6 +1239,12 @@ protected HttpJsonDocumentProcessorServiceStub( .setMethodDescriptor(getProcessorMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + trainProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(trainProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings getProcessorVersionTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1109,6 +1307,23 @@ protected HttpJsonDocumentProcessorServiceStub( .setMethodDescriptor(reviewDocumentMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + evaluateProcessorVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(evaluateProcessorVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEvaluationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEvaluationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listEvaluationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEvaluationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1162,6 +1377,17 @@ protected HttpJsonDocumentProcessorServiceStub( 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, @@ -1260,6 +1486,26 @@ protected HttpJsonDocumentProcessorServiceStub( 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); @@ -1284,6 +1530,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(getProcessorTypeMethodDescriptor); methodDescriptors.add(listProcessorsMethodDescriptor); methodDescriptors.add(getProcessorMethodDescriptor); + methodDescriptors.add(trainProcessorVersionMethodDescriptor); methodDescriptors.add(getProcessorVersionMethodDescriptor); methodDescriptors.add(listProcessorVersionsMethodDescriptor); methodDescriptors.add(deleteProcessorVersionMethodDescriptor); @@ -1295,6 +1542,9 @@ public static List getMethodDescriptors() { 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; @@ -1359,6 +1609,20 @@ 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; @@ -1482,6 +1746,37 @@ public UnaryCallable reviewDocumentCallable() 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; diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java index 1ff939b15982..4c75615c3afc 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientHttpJsonTest.java @@ -16,6 +16,7 @@ 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; @@ -768,6 +769,110 @@ public void getProcessorExceptionTest2() throws Exception { } } + @Test + public void trainProcessorVersionTest() throws Exception { + TrainProcessorVersionResponse expectedResponse = + TrainProcessorVersionResponse.newBuilder() + .setProcessorVersion("processorVersion-1941143578") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + + TrainProcessorVersionResponse actualResponse = + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void trainProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void trainProcessorVersionTest2() throws Exception { + TrainProcessorVersionResponse expectedResponse = + TrainProcessorVersionResponse.newBuilder() + .setProcessorVersion("processorVersion-1941143578") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + + TrainProcessorVersionResponse actualResponse = + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void trainProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3198/locations/location-3198/processors/processor-3198"; + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void getProcessorVersionTest() throws Exception { ProcessorVersion expectedResponse = @@ -779,6 +884,7 @@ public void getProcessorVersionTest() throws Exception { .setDisplayName("displayName1714148973") .setDocumentSchema(DocumentSchema.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) + .setLatestEvaluation(EvaluationReference.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") .setKmsKeyVersionName("kmsKeyVersionName-1798811307") .setGoogleManaged(true) @@ -835,6 +941,7 @@ public void getProcessorVersionTest2() throws Exception { .setDisplayName("displayName1714148973") .setDocumentSchema(DocumentSchema.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) + .setLatestEvaluation(EvaluationReference.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") .setKmsKeyVersionName("kmsKeyVersionName-1798811307") .setGoogleManaged(true) @@ -1742,6 +1849,330 @@ public void reviewDocumentExceptionTest2() throws Exception { } } + @Test + public void evaluateProcessorVersionTest() throws Exception { + EvaluateProcessorVersionResponse expectedResponse = + EvaluateProcessorVersionResponse.newBuilder().setEvaluation("evaluation858523452").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("evaluateProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProcessorVersionName processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + EvaluateProcessorVersionResponse actualResponse = + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void evaluateProcessorVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void evaluateProcessorVersionTest2() throws Exception { + EvaluateProcessorVersionResponse expectedResponse = + EvaluateProcessorVersionResponse.newBuilder().setEvaluation("evaluation858523452").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("evaluateProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String processorVersion = + "projects/project-7729/locations/location-7729/processors/processor-7729/processorVersions/processorVersion-7729"; + + EvaluateProcessorVersionResponse actualResponse = + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void evaluateProcessorVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String processorVersion = + "projects/project-7729/locations/location-7729/processors/processor-7729/processorVersions/processorVersion-7729"; + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getEvaluationTest() throws Exception { + Evaluation expectedResponse = + Evaluation.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDocumentCounters(Evaluation.Counters.newBuilder().build()) + .setAllEntitiesMetrics(Evaluation.MultiConfidenceMetrics.newBuilder().build()) + .putAllEntityMetrics(new HashMap()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .build(); + mockService.addResponse(expectedResponse); + + EvaluationName name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]"); + + Evaluation actualResponse = client.getEvaluation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEvaluationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EvaluationName name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]"); + client.getEvaluation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEvaluationTest2() throws Exception { + Evaluation expectedResponse = + Evaluation.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDocumentCounters(Evaluation.Counters.newBuilder().build()) + .setAllEntitiesMetrics(Evaluation.MultiConfidenceMetrics.newBuilder().build()) + .putAllEntityMetrics(new HashMap()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6701/locations/location-6701/processors/processor-6701/processorVersions/processorVersion-6701/evaluations/evaluation-6701"; + + Evaluation actualResponse = client.getEvaluation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEvaluationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6701/locations/location-6701/processors/processor-6701/processorVersions/processorVersion-6701/evaluations/evaluation-6701"; + client.getEvaluation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEvaluationsTest() throws Exception { + Evaluation responsesElement = Evaluation.newBuilder().build(); + ListEvaluationsResponse expectedResponse = + ListEvaluationsResponse.newBuilder() + .setNextPageToken("") + .addAllEvaluations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProcessorVersionName parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ListEvaluationsPagedResponse pagedListResponse = client.listEvaluations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEvaluationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEvaluationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProcessorVersionName parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.listEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEvaluationsTest2() throws Exception { + Evaluation responsesElement = Evaluation.newBuilder().build(); + ListEvaluationsResponse expectedResponse = + ListEvaluationsResponse.newBuilder() + .setNextPageToken("") + .addAllEvaluations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-1781/locations/location-1781/processors/processor-1781/processorVersions/processorVersion-1781"; + + ListEvaluationsPagedResponse pagedListResponse = client.listEvaluations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEvaluationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEvaluationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-1781/locations/location-1781/processors/processor-1781/processorVersions/processorVersion-1781"; + client.listEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java index 852a81eec9c8..46ddc51c46fd 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/DocumentProcessorServiceClientTest.java @@ -16,6 +16,7 @@ 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; @@ -696,6 +697,108 @@ public void getProcessorExceptionTest2() throws Exception { } } + @Test + public void trainProcessorVersionTest() throws Exception { + TrainProcessorVersionResponse expectedResponse = + TrainProcessorVersionResponse.newBuilder() + .setProcessorVersion("processorVersion-1941143578") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + + TrainProcessorVersionResponse actualResponse = + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TrainProcessorVersionRequest actualRequest = + ((TrainProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(processorVersion, actualRequest.getProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void trainProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void trainProcessorVersionTest2() throws Exception { + TrainProcessorVersionResponse expectedResponse = + TrainProcessorVersionResponse.newBuilder() + .setProcessorVersion("processorVersion-1941143578") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String parent = "parent-995424086"; + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + + TrainProcessorVersionResponse actualResponse = + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TrainProcessorVersionRequest actualRequest = + ((TrainProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(processorVersion, actualRequest.getProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void trainProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + client.trainProcessorVersionAsync(parent, processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void getProcessorVersionTest() throws Exception { ProcessorVersion expectedResponse = @@ -707,6 +810,7 @@ public void getProcessorVersionTest() throws Exception { .setDisplayName("displayName1714148973") .setDocumentSchema(DocumentSchema.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) + .setLatestEvaluation(EvaluationReference.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") .setKmsKeyVersionName("kmsKeyVersionName-1798811307") .setGoogleManaged(true) @@ -757,6 +861,7 @@ public void getProcessorVersionTest2() throws Exception { .setDisplayName("displayName1714148973") .setDocumentSchema(DocumentSchema.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) + .setLatestEvaluation(EvaluationReference.newBuilder().build()) .setKmsKeyName("kmsKeyName412586233") .setKmsKeyVersionName("kmsKeyVersionName-1798811307") .setGoogleManaged(true) @@ -1598,6 +1703,296 @@ public void reviewDocumentExceptionTest2() throws Exception { } } + @Test + public void evaluateProcessorVersionTest() throws Exception { + EvaluateProcessorVersionResponse expectedResponse = + EvaluateProcessorVersionResponse.newBuilder().setEvaluation("evaluation858523452").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("evaluateProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + ProcessorVersionName processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + EvaluateProcessorVersionResponse actualResponse = + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EvaluateProcessorVersionRequest actualRequest = + ((EvaluateProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(processorVersion.toString(), actualRequest.getProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void evaluateProcessorVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void evaluateProcessorVersionTest2() throws Exception { + EvaluateProcessorVersionResponse expectedResponse = + EvaluateProcessorVersionResponse.newBuilder().setEvaluation("evaluation858523452").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("evaluateProcessorVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentProcessorService.addResponse(resultOperation); + + String processorVersion = "processorVersion-1941143578"; + + EvaluateProcessorVersionResponse actualResponse = + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EvaluateProcessorVersionRequest actualRequest = + ((EvaluateProcessorVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(processorVersion, actualRequest.getProcessorVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void evaluateProcessorVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String processorVersion = "processorVersion-1941143578"; + client.evaluateProcessorVersionAsync(processorVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getEvaluationTest() throws Exception { + Evaluation expectedResponse = + Evaluation.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDocumentCounters(Evaluation.Counters.newBuilder().build()) + .setAllEntitiesMetrics(Evaluation.MultiConfidenceMetrics.newBuilder().build()) + .putAllEntityMetrics(new HashMap()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + EvaluationName name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]"); + + Evaluation actualResponse = client.getEvaluation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEvaluationRequest actualRequest = ((GetEvaluationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEvaluationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + EvaluationName name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]"); + client.getEvaluation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEvaluationTest2() throws Exception { + Evaluation expectedResponse = + Evaluation.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDocumentCounters(Evaluation.Counters.newBuilder().build()) + .setAllEntitiesMetrics(Evaluation.MultiConfidenceMetrics.newBuilder().build()) + .putAllEntityMetrics(new HashMap()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String name = "name3373707"; + + Evaluation actualResponse = client.getEvaluation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEvaluationRequest actualRequest = ((GetEvaluationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEvaluationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String name = "name3373707"; + client.getEvaluation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEvaluationsTest() throws Exception { + Evaluation responsesElement = Evaluation.newBuilder().build(); + ListEvaluationsResponse expectedResponse = + ListEvaluationsResponse.newBuilder() + .setNextPageToken("") + .addAllEvaluations(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + ProcessorVersionName parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + + ListEvaluationsPagedResponse pagedListResponse = client.listEvaluations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEvaluationsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEvaluationsRequest actualRequest = ((ListEvaluationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEvaluationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + ProcessorVersionName parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + client.listEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEvaluationsTest2() throws Exception { + Evaluation responsesElement = Evaluation.newBuilder().build(); + ListEvaluationsResponse expectedResponse = + ListEvaluationsResponse.newBuilder() + .setNextPageToken("") + .addAllEvaluations(Arrays.asList(responsesElement)) + .build(); + mockDocumentProcessorService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEvaluationsPagedResponse pagedListResponse = client.listEvaluations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEvaluationsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentProcessorService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEvaluationsRequest actualRequest = ((ListEvaluationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEvaluationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentProcessorService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java index 99fb06cbee5c..3c5f1a32abba 100644 --- a/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java +++ b/java-document-ai/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1/MockDocumentProcessorServiceImpl.java @@ -208,6 +208,27 @@ public void getProcessor( } } + @Override + public void trainProcessorVersion( + TrainProcessorVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TrainProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void getProcessorVersion( GetProcessorVersionRequest request, StreamObserver responseObserver) { @@ -439,4 +460,67 @@ public void reviewDocument( Exception.class.getName()))); } } + + @Override + public void evaluateProcessorVersion( + EvaluateProcessorVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method EvaluateProcessorVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEvaluation( + GetEvaluationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Evaluation) { + requests.add(request); + responseObserver.onNext(((Evaluation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEvaluation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Evaluation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listEvaluations( + ListEvaluationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListEvaluationsResponse) { + requests.add(request); + responseObserver.onNext(((ListEvaluationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEvaluations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListEvaluationsResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java index 1e7b6dfa946b..5de5fa4ee1bb 100644 --- a/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java +++ b/java-document-ai/grpc-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProcessorServiceGrpc.java @@ -378,6 +378,58 @@ private DocumentProcessorServiceGrpc() {} 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> @@ -918,6 +970,154 @@ private DocumentProcessorServiceGrpc() {} 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 = @@ -1076,6 +1276,22 @@ public void getProcessor( getGetProcessorMethod(), responseObserver); } + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * cloud_documentai_core.TrainProcessorVersionMetadata.
+     * 
+ */ + public void trainProcessorVersion( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTrainProcessorVersionMethod(), responseObserver); + } + /** * * @@ -1240,6 +1456,50 @@ public void reviewDocument( getReviewDocumentMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getEvaluateProcessorVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a specific evaluation.
+     * 
+ */ + public 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.
+     * 
+ */ + public void listEvaluations( + com.google.cloud.documentai.v1.ListEvaluationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEvaluationsMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -1290,6 +1550,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.documentai.v1.GetProcessorRequest, com.google.cloud.documentai.v1.Processor>(this, METHODID_GET_PROCESSOR))) + .addMethod( + getTrainProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest, + com.google.longrunning.Operation>(this, METHODID_TRAIN_PROCESSOR_VERSION))) .addMethod( getGetProcessorVersionMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1359,6 +1625,25 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.documentai.v1.ReviewDocumentRequest, com.google.longrunning.Operation>(this, METHODID_REVIEW_DOCUMENT))) + .addMethod( + getEvaluateProcessorVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, + com.google.longrunning.Operation>(this, 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>(this, METHODID_GET_EVALUATION))) + .addMethod( + getListEvaluationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1.ListEvaluationsRequest, + com.google.cloud.documentai.v1.ListEvaluationsResponse>( + this, METHODID_LIST_EVALUATIONS))) .build(); } } @@ -1504,6 +1789,24 @@ public void getProcessor( responseObserver); } + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * cloud_documentai_core.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); + } + /** * * @@ -1689,6 +1992,56 @@ public void reviewDocument( 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); + } } /** @@ -1807,6 +2160,21 @@ public com.google.cloud.documentai.v1.Processor getProcessor( getChannel(), getGetProcessorMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * cloud_documentai_core.TrainProcessorVersionMetadata.
+     * 
+ */ + public com.google.longrunning.Operation trainProcessorVersion( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTrainProcessorVersionMethod(), getCallOptions(), request); + } + /** * * @@ -1957,6 +2325,46 @@ public com.google.longrunning.Operation reviewDocument( 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); + } } /** @@ -2081,6 +2489,21 @@ protected DocumentProcessorServiceFutureStub build( getChannel().newCall(getGetProcessorMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Trains a new processor version.
+     * Operation metadata is returned as
+     * cloud_documentai_core.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); + } + /** * * @@ -2238,6 +2661,49 @@ protected DocumentProcessorServiceFutureStub build( 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; @@ -2247,17 +2713,21 @@ protected DocumentProcessorServiceFutureStub build( 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_GET_PROCESSOR_VERSION = 7; - private static final int METHODID_LIST_PROCESSOR_VERSIONS = 8; - private static final int METHODID_DELETE_PROCESSOR_VERSION = 9; - private static final int METHODID_DEPLOY_PROCESSOR_VERSION = 10; - private static final int METHODID_UNDEPLOY_PROCESSOR_VERSION = 11; - private static final int METHODID_CREATE_PROCESSOR = 12; - private static final int METHODID_DELETE_PROCESSOR = 13; - private static final int METHODID_ENABLE_PROCESSOR = 14; - private static final int METHODID_DISABLE_PROCESSOR = 15; - private static final int METHODID_SET_DEFAULT_PROCESSOR_VERSION = 16; - private static final int METHODID_REVIEW_DOCUMENT = 17; + 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, @@ -2319,6 +2789,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -2378,6 +2853,23 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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(); } @@ -2449,6 +2941,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetProcessorTypeMethod()) .addMethod(getListProcessorsMethod()) .addMethod(getGetProcessorMethod()) + .addMethod(getTrainProcessorVersionMethod()) .addMethod(getGetProcessorVersionMethod()) .addMethod(getListProcessorVersionsMethod()) .addMethod(getDeleteProcessorVersionMethod()) @@ -2460,6 +2953,9 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getDisableProcessorMethod()) .addMethod(getSetDefaultProcessorVersionMethod()) .addMethod(getReviewDocumentMethod()) + .addMethod(getEvaluateProcessorVersionMethod()) + .addMethod(getGetEvaluationMethod()) + .addMethod(getListEvaluationsMethod()) .build(); } } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java index 01845003fe86..5337e4efdd63 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java @@ -53247,10 +53247,13 @@ public interface ProvenanceOrBuilder * The index of the revision that produced this element. * * - * int32 revision = 1; + * int32 revision = 1 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Provenance.revision is deprecated. See + * google/cloud/documentai/v1/document.proto;l=759 * @return The revision. */ + @java.lang.Deprecated int getRevision(); /** @@ -53264,7 +53267,7 @@ public interface ProvenanceOrBuilder * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=756 + * google/cloud/documentai/v1/document.proto;l=763 * @return The id. */ @java.lang.Deprecated @@ -53444,7 +53447,20 @@ public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Replace an element identified by `parent`.
+       * Updates any fields within the given provenance scope of the message. It
+       * 'overwrites'  the fields rather than replacing them.  This is
+       * especially relevant when we just want to update a field value of an
+       * entity without also affecting all the child properties.
+       * 
+ * + * UPDATE = 7; + */ + UPDATE(7), + /** + * + * + *
+       * Currently unused. Replace an element identified by `parent`.
        * 
* * REPLACE = 3; @@ -53454,32 +53470,36 @@ public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Request human review for the element identified by `parent`.
+       * Deprecated. Request human review for the element identified by
+       * `parent`.
        * 
* - * EVAL_REQUESTED = 4; + * EVAL_REQUESTED = 4 [deprecated = true]; */ + @java.lang.Deprecated EVAL_REQUESTED(4), /** * * *
-       * Element is reviewed and approved at human review, confidence will be
-       * set to 1.0.
+       * Deprecated. Element is reviewed and approved at human review,
+       * confidence will be set to 1.0.
        * 
* - * EVAL_APPROVED = 5; + * EVAL_APPROVED = 5 [deprecated = true]; */ + @java.lang.Deprecated EVAL_APPROVED(5), /** * * *
-       * Element is skipped in the validation process.
+       * Deprecated. Element is skipped in the validation process.
        * 
* - * EVAL_SKIPPED = 6; + * EVAL_SKIPPED = 6 [deprecated = true]; */ + @java.lang.Deprecated EVAL_SKIPPED(6), UNRECOGNIZED(-1), ; @@ -53519,7 +53539,20 @@ public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Replace an element identified by `parent`.
+       * Updates any fields within the given provenance scope of the message. It
+       * 'overwrites'  the fields rather than replacing them.  This is
+       * especially relevant when we just want to update a field value of an
+       * entity without also affecting all the child properties.
+       * 
+ * + * UPDATE = 7; + */ + public static final int UPDATE_VALUE = 7; + /** + * + * + *
+       * Currently unused. Replace an element identified by `parent`.
        * 
* * REPLACE = 3; @@ -53529,33 +53562,34 @@ public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Request human review for the element identified by `parent`.
+       * Deprecated. Request human review for the element identified by
+       * `parent`.
        * 
* - * EVAL_REQUESTED = 4; + * EVAL_REQUESTED = 4 [deprecated = true]; */ - public static final int EVAL_REQUESTED_VALUE = 4; + @java.lang.Deprecated public static final int EVAL_REQUESTED_VALUE = 4; /** * * *
-       * Element is reviewed and approved at human review, confidence will be
-       * set to 1.0.
+       * Deprecated. Element is reviewed and approved at human review,
+       * confidence will be set to 1.0.
        * 
* - * EVAL_APPROVED = 5; + * EVAL_APPROVED = 5 [deprecated = true]; */ - public static final int EVAL_APPROVED_VALUE = 5; + @java.lang.Deprecated public static final int EVAL_APPROVED_VALUE = 5; /** * * *
-       * Element is skipped in the validation process.
+       * Deprecated. Element is skipped in the validation process.
        * 
* - * EVAL_SKIPPED = 6; + * EVAL_SKIPPED = 6 [deprecated = true]; */ - public static final int EVAL_SKIPPED_VALUE = 6; + @java.lang.Deprecated public static final int EVAL_SKIPPED_VALUE = 6; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -53587,6 +53621,8 @@ public static OperationType forNumber(int value) { return ADD; case 2: return REMOVE; + case 7: + return UPDATE; case 3: return REPLACE; case 4: @@ -54444,11 +54480,14 @@ public com.google.cloud.documentai.v1.Document.Provenance.Parent getDefaultInsta * The index of the revision that produced this element. * * - * int32 revision = 1; + * int32 revision = 1 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Provenance.revision is deprecated. See + * google/cloud/documentai/v1/document.proto;l=759 * @return The revision. */ @java.lang.Override + @java.lang.Deprecated public int getRevision() { return revision_; } @@ -54466,7 +54505,7 @@ public int getRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=756 + * google/cloud/documentai/v1/document.proto;l=763 * @return The id. */ @java.lang.Override @@ -55062,11 +55101,14 @@ public Builder mergeFrom( * The index of the revision that produced this element. * * - * int32 revision = 1; + * int32 revision = 1 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Provenance.revision is deprecated. See + * google/cloud/documentai/v1/document.proto;l=759 * @return The revision. */ @java.lang.Override + @java.lang.Deprecated public int getRevision() { return revision_; } @@ -55077,11 +55119,14 @@ public int getRevision() { * The index of the revision that produced this element. * * - * int32 revision = 1; + * int32 revision = 1 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Provenance.revision is deprecated. See + * google/cloud/documentai/v1/document.proto;l=759 * @param value The revision to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setRevision(int value) { revision_ = value; @@ -55096,10 +55141,13 @@ public Builder setRevision(int value) { * The index of the revision that produced this element. * * - * int32 revision = 1; + * int32 revision = 1 [deprecated = true]; * + * @deprecated google.cloud.documentai.v1.Document.Provenance.revision is deprecated. See + * google/cloud/documentai/v1/document.proto;l=759 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearRevision() { bitField0_ = (bitField0_ & ~0x00000001); revision_ = 0; @@ -55119,7 +55167,7 @@ public Builder clearRevision() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=756 + * google/cloud/documentai/v1/document.proto;l=763 * @return The id. */ @java.lang.Override @@ -55138,7 +55186,7 @@ public int getId() { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=756 + * google/cloud/documentai/v1/document.proto;l=763 * @param value The id to set. * @return This builder for chaining. */ @@ -55161,7 +55209,7 @@ public Builder setId(int value) { * int32 id = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Provenance.id is deprecated. See - * google/cloud/documentai/v1/document.proto;l=756 + * google/cloud/documentai/v1/document.proto;l=763 * @return This builder for chaining. */ @java.lang.Deprecated @@ -55783,7 +55831,8 @@ public interface RevisionOrBuilder * * *
-     * Id of the revision.  Unique within the context of the document.
+     * Id of the revision, internally generated by doc proto storage.
+     * Unique within the context of the document.
      * 
* * string id = 1; @@ -55795,7 +55844,8 @@ public interface RevisionOrBuilder * * *
-     * Id of the revision.  Unique within the context of the document.
+     * Id of the revision, internally generated by doc proto storage.
+     * Unique within the context of the document.
      * 
* * string id = 1; @@ -55816,7 +55866,7 @@ public interface RevisionOrBuilder * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return A list containing the parent. */ @java.lang.Deprecated @@ -55833,7 +55883,7 @@ public interface RevisionOrBuilder * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return The count of parent. */ @java.lang.Deprecated @@ -55850,7 +55900,7 @@ public interface RevisionOrBuilder * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param index The index of the element to return. * @return The parent at the given index. */ @@ -55920,7 +55970,8 @@ public interface RevisionOrBuilder * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -55932,7 +55983,8 @@ public interface RevisionOrBuilder * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -55944,7 +55996,8 @@ public interface RevisionOrBuilder * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -57110,7 +57163,8 @@ public com.google.protobuf.ByteString getProcessorBytes() { * * *
-     * Id of the revision.  Unique within the context of the document.
+     * Id of the revision, internally generated by doc proto storage.
+     * Unique within the context of the document.
      * 
* * string id = 1; @@ -57133,7 +57187,8 @@ public java.lang.String getId() { * * *
-     * Id of the revision.  Unique within the context of the document.
+     * Id of the revision, internally generated by doc proto storage.
+     * Unique within the context of the document.
      * 
* * string id = 1; @@ -57169,7 +57224,7 @@ public com.google.protobuf.ByteString getIdBytes() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return A list containing the parent. */ @java.lang.Override @@ -57189,7 +57244,7 @@ public java.util.List getParentList() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return The count of parent. */ @java.lang.Deprecated @@ -57208,7 +57263,7 @@ public int getParentCount() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param index The index of the element to return. * @return The parent at the given index. */ @@ -57296,7 +57351,8 @@ public com.google.protobuf.ByteString getParentIdsBytes(int index) { * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -57311,7 +57367,8 @@ public boolean hasCreateTime() { * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -57326,7 +57383,8 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-     * The time that the revision was created.
+     * The time that the revision was created, internally generated by
+     * doc proto storage at the time of create.
      * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58278,7 +58336,8 @@ public Builder setProcessorBytes(com.google.protobuf.ByteString value) { * * *
-       * Id of the revision.  Unique within the context of the document.
+       * Id of the revision, internally generated by doc proto storage.
+       * Unique within the context of the document.
        * 
* * string id = 1; @@ -58300,7 +58359,8 @@ public java.lang.String getId() { * * *
-       * Id of the revision.  Unique within the context of the document.
+       * Id of the revision, internally generated by doc proto storage.
+       * Unique within the context of the document.
        * 
* * string id = 1; @@ -58322,7 +58382,8 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-       * Id of the revision.  Unique within the context of the document.
+       * Id of the revision, internally generated by doc proto storage.
+       * Unique within the context of the document.
        * 
* * string id = 1; @@ -58343,7 +58404,8 @@ public Builder setId(java.lang.String value) { * * *
-       * Id of the revision.  Unique within the context of the document.
+       * Id of the revision, internally generated by doc proto storage.
+       * Unique within the context of the document.
        * 
* * string id = 1; @@ -58360,7 +58422,8 @@ public Builder clearId() { * * *
-       * Id of the revision.  Unique within the context of the document.
+       * Id of the revision, internally generated by doc proto storage.
+       * Unique within the context of the document.
        * 
* * string id = 1; @@ -58399,7 +58462,7 @@ private void ensureParentIsMutable() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return A list containing the parent. */ @java.lang.Deprecated @@ -58420,7 +58483,7 @@ public java.util.List getParentList() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return The count of parent. */ @java.lang.Deprecated @@ -58439,7 +58502,7 @@ public int getParentCount() { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param index The index of the element to return. * @return The parent at the given index. */ @@ -58459,7 +58522,7 @@ public int getParent(int index) { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param index The index to set the value at. * @param value The parent to set. * @return This builder for chaining. @@ -58484,7 +58547,7 @@ public Builder setParent(int index, int value) { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param value The parent to add. * @return This builder for chaining. */ @@ -58508,7 +58571,7 @@ public Builder addParent(int value) { * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @param values The parent to add. * @return This builder for chaining. */ @@ -58531,7 +58594,7 @@ public Builder addAllParent(java.lang.Iterable valu * repeated int32 parent = 2 [deprecated = true]; * * @deprecated google.cloud.documentai.v1.Document.Revision.parent is deprecated. See - * google/cloud/documentai/v1/document.proto;l=794 + * google/cloud/documentai/v1/document.proto;l=802 * @return This builder for chaining. */ @java.lang.Deprecated @@ -58738,7 +58801,8 @@ public Builder addParentIdsBytes(com.google.protobuf.ByteString value) { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58752,7 +58816,8 @@ public boolean hasCreateTime() { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58772,7 +58837,8 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58794,7 +58860,8 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58813,7 +58880,8 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58838,7 +58906,8 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58857,7 +58926,8 @@ public Builder clearCreateTime() { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58871,7 +58941,8 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; @@ -58889,7 +58960,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-       * The time that the revision was created.
+       * The time that the revision was created, internally generated by
+       * doc proto storage at the time of create.
        * 
* * .google.protobuf.Timestamp create_time = 3; diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiEvaluation.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiEvaluation.java new file mode 100644 index 000000000000..d86567cad0f7 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiEvaluation.java @@ -0,0 +1,227 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/evaluation.proto + +package com.google.cloud.documentai.v1; + +public final class DocumentAiEvaluation { + private DocumentAiEvaluation() {} + + 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_EvaluationReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EvaluationReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_Counters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_Metrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_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/evaluation." + + "proto\022\032google.cloud.documentai.v1\032\031googl" + + "e/api/resource.proto\032\037google/protobuf/ti" + + "mestamp.proto\"\203\002\n\023EvaluationReference\022\021\n" + + "\toperation\030\001 \001(\t\022=\n\nevaluation\030\002 \001(\tB)\372A" + + "&\n$documentai.googleapis.com/Evaluation\022" + + "I\n\021aggregate_metrics\030\004 \001(\0132..google.clou" + + "d.documentai.v1.Evaluation.Metrics\022O\n\027ag" + + "gregate_metrics_exact\030\005 \001(\0132..google.clo" + + "ud.documentai.v1.Evaluation.Metrics\"\345\r\n\n" + + "Evaluation\022\014\n\004name\030\001 \001(\t\022/\n\013create_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\022J\n\021doc" + + "ument_counters\030\005 \001(\0132/.google.cloud.docu" + + "mentai.v1.Evaluation.Counters\022[\n\024all_ent" + + "ities_metrics\030\003 \001(\0132=.google.cloud.docum" + + "entai.v1.Evaluation.MultiConfidenceMetri" + + "cs\022Q\n\016entity_metrics\030\004 \003(\01329.google.clou" + + "d.documentai.v1.Evaluation.EntityMetrics" + + "Entry\022\024\n\014kms_key_name\030\006 \001(\t\022\034\n\024kms_key_v" + + "ersion_name\030\007 \001(\t\032\215\001\n\010Counters\022\035\n\025input_" + + "documents_count\030\001 \001(\005\022\037\n\027invalid_documen" + + "ts_count\030\002 \001(\005\022\036\n\026failed_documents_count" + + "\030\003 \001(\005\022!\n\031evaluated_documents_count\030\004 \001(" + + "\005\032\315\002\n\007Metrics\022\021\n\tprecision\030\001 \001(\002\022\016\n\006reca" + + "ll\030\002 \001(\002\022\020\n\010f1_score\030\003 \001(\002\022#\n\033predicted_" + + "occurrences_count\030\004 \001(\005\022&\n\036ground_truth_" + + "occurrences_count\030\005 \001(\005\022 \n\030predicted_doc" + + "ument_count\030\n \001(\005\022#\n\033ground_truth_docume" + + "nt_count\030\013 \001(\005\022\034\n\024true_positives_count\030\006" + + " \001(\005\022\035\n\025false_positives_count\030\007 \001(\005\022\035\n\025f" + + "alse_negatives_count\030\010 \001(\005\022\035\n\025total_docu" + + "ments_count\030\t \001(\005\032s\n\026ConfidenceLevelMetr" + + "ics\022\030\n\020confidence_level\030\001 \001(\002\022?\n\007metrics" + + "\030\002 \001(\0132..google.cloud.documentai.v1.Eval" + + "uation.Metrics\032\361\003\n\026MultiConfidenceMetric" + + "s\022_\n\030confidence_level_metrics\030\001 \003(\0132=.go" + + "ogle.cloud.documentai.v1.Evaluation.Conf" + + "idenceLevelMetrics\022e\n\036confidence_level_m" + + "etrics_exact\030\004 \003(\0132=.google.cloud.docume" + + "ntai.v1.Evaluation.ConfidenceLevelMetric" + + "s\022\r\n\005auprc\030\002 \001(\002\022#\n\033estimated_calibratio" + + "n_error\030\003 \001(\002\022\023\n\013auprc_exact\030\005 \001(\002\022)\n!es" + + "timated_calibration_error_exact\030\006 \001(\002\022_\n" + + "\014metrics_type\030\007 \001(\0162I.google.cloud.docum" + + "entai.v1.Evaluation.MultiConfidenceMetri" + + "cs.MetricsType\":\n\013MetricsType\022\034\n\030METRICS" + + "_TYPE_UNSPECIFIED\020\000\022\r\n\tAGGREGATE\020\001\032s\n\022En" + + "tityMetricsEntry\022\013\n\003key\030\001 \001(\t\022L\n\005value\030\002" + + " \001(\0132=.google.cloud.documentai.v1.Evalua" + + "tion.MultiConfidenceMetrics:\0028\001:\251\001\352A\245\001\n$" + + "documentai.googleapis.com/Evaluation\022}pr" + + "ojects/{project}/locations/{location}/pr" + + "ocessors/{processor}/processorVersions/{" + + "processor_version}/evaluations/{evaluati" + + "on}B\322\001\n\036com.google.cloud.documentai.v1B\024" + + "DocumentAiEvaluationP\001Z>cloud.google.com" + + "/go/documentai/apiv1/documentaipb;docume" + + "ntaipb\252\002\032Google.Cloud.DocumentAI.V1\312\002\032Go" + + "ogle\\Cloud\\DocumentAI\\V1\352\002\035Google::Cloud" + + "::DocumentAI::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_documentai_v1_EvaluationReference_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_documentai_v1_EvaluationReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EvaluationReference_descriptor, + new java.lang.String[] { + "Operation", "Evaluation", "AggregateMetrics", "AggregateMetricsExact", + }); + internal_static_google_cloud_documentai_v1_Evaluation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_documentai_v1_Evaluation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "DocumentCounters", + "AllEntitiesMetrics", + "EntityMetrics", + "KmsKeyName", + "KmsKeyVersionName", + }); + internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor = + internal_static_google_cloud_documentai_v1_Evaluation_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_documentai_v1_Evaluation_Counters_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor, + new java.lang.String[] { + "InputDocumentsCount", + "InvalidDocumentsCount", + "FailedDocumentsCount", + "EvaluatedDocumentsCount", + }); + internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor = + internal_static_google_cloud_documentai_v1_Evaluation_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_documentai_v1_Evaluation_Metrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor, + new java.lang.String[] { + "Precision", + "Recall", + "F1Score", + "PredictedOccurrencesCount", + "GroundTruthOccurrencesCount", + "PredictedDocumentCount", + "GroundTruthDocumentCount", + "TruePositivesCount", + "FalsePositivesCount", + "FalseNegativesCount", + "TotalDocumentsCount", + }); + internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor = + internal_static_google_cloud_documentai_v1_Evaluation_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor, + new java.lang.String[] { + "ConfidenceLevel", "Metrics", + }); + internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor = + internal_static_google_cloud_documentai_v1_Evaluation_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor, + new java.lang.String[] { + "ConfidenceLevelMetrics", + "ConfidenceLevelMetricsExact", + "Auprc", + "EstimatedCalibrationError", + "AuprcExact", + "EstimatedCalibrationErrorExact", + "MetricsType", + }); + internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_descriptor = + internal_static_google_cloud_documentai_v1_Evaluation_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java index b90d12b5f9d7..19586adb1cf1 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessor.java @@ -52,49 +52,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "roto\022\032google.cloud.documentai.v1\032\037google" + "/api/field_behavior.proto\032\031google/api/re" + "source.proto\0320google/cloud/documentai/v1" - + "/document_schema.proto\032\037google/protobuf/" - + "timestamp.proto\"\325\006\n\020ProcessorVersion\022\014\n\004" - + "name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022C\n\017docu" - + "ment_schema\030\014 \001(\0132*.google.cloud.documen" - + "tai.v1.DocumentSchema\022A\n\005state\030\006 \001(\01622.g" - + "oogle.cloud.documentai.v1.ProcessorVersi" - + "on.State\022/\n\013create_time\030\007 \001(\0132\032.google.p" - + "rotobuf.Timestamp\022\024\n\014kms_key_name\030\t \001(\t\022" - + "\034\n\024kms_key_version_name\030\n \001(\t\022\026\n\016google_" - + "managed\030\013 \001(\010\022V\n\020deprecation_info\030\r \001(\0132" - + "<.google.cloud.documentai.v1.ProcessorVe" - + "rsion.DeprecationInfo\032\237\001\n\017DeprecationInf" - + "o\0224\n\020deprecation_time\030\001 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022V\n\035replacement_processor" - + "_version\030\002 \001(\tB/\372A,\n*documentai.googleap" - + "is.com/ProcessorVersion\"\204\001\n\005State\022\025\n\021STA" - + "TE_UNSPECIFIED\020\000\022\014\n\010DEPLOYED\020\001\022\r\n\tDEPLOY" - + "ING\020\002\022\016\n\nUNDEPLOYED\020\003\022\017\n\013UNDEPLOYING\020\004\022\014" - + "\n\010CREATING\020\005\022\014\n\010DELETING\020\006\022\n\n\006FAILED\020\007:\226" - + "\001\352A\222\001\n*documentai.googleapis.com/Process" - + "orVersion\022dprojects/{project}/locations/" - + "{location}/processors/{processor}/proces" - + "sorVersions/{processor_version}\"\255\004\n\tProc" - + "essor\022\024\n\004name\030\001 \001(\tB\006\340A\005\340A\003\022\014\n\004type\030\002 \001(" - + "\t\022\024\n\014display_name\030\003 \001(\t\022?\n\005state\030\004 \001(\0162+" - + ".google.cloud.documentai.v1.Processor.St" - + "ateB\003\340A\003\022R\n\031default_processor_version\030\t " - + "\001(\tB/\372A,\n*documentai.googleapis.com/Proc" - + "essorVersion\022 \n\020process_endpoint\030\006 \001(\tB\006" - + "\340A\003\340A\005\022/\n\013create_time\030\007 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022\024\n\014kms_key_name\030\010 \001(\t\"~\n" - + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABLED" - + "\020\001\022\014\n\010DISABLED\020\002\022\014\n\010ENABLING\020\003\022\r\n\tDISABL" - + "ING\020\004\022\014\n\010CREATING\020\005\022\n\n\006FAILED\020\006\022\014\n\010DELET" - + "ING\020\007:h\352Ae\n#documentai.googleapis.com/Pr" - + "ocessor\022>projects/{project}/locations/{l" - + "ocation}/processors/{processor}B\321\001\n\036com." - + "google.cloud.documentai.v1B\023DocumentAiPr" - + "ocessorP\001Z>cloud.google.com/go/documenta" - + "i/apiv1/documentaipb;documentaipb\252\002\032Goog" - + "le.Cloud.DocumentAI.V1\312\002\032Google\\Cloud\\Do" - + "cumentAI\\V1\352\002\035Google::Cloud::DocumentAI:" - + ":V1b\006proto3" + + "/document_schema.proto\032+google/cloud/doc" + + "umentai/v1/evaluation.proto\032\037google/prot" + + "obuf/timestamp.proto\"\241\007\n\020ProcessorVersio" + + "n\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022C\n" + + "\017document_schema\030\014 \001(\0132*.google.cloud.do" + + "cumentai.v1.DocumentSchema\022A\n\005state\030\006 \001(" + + "\01622.google.cloud.documentai.v1.Processor" + + "Version.State\022/\n\013create_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022J\n\021latest_evaluat" + + "ion\030\010 \001(\0132/.google.cloud.documentai.v1.E" + + "valuationReference\022\024\n\014kms_key_name\030\t \001(\t" + + "\022\034\n\024kms_key_version_name\030\n \001(\t\022\026\n\016google" + + "_managed\030\013 \001(\010\022V\n\020deprecation_info\030\r \001(\013" + + "2<.google.cloud.documentai.v1.ProcessorV" + + "ersion.DeprecationInfo\032\237\001\n\017DeprecationIn" + + "fo\0224\n\020deprecation_time\030\001 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022V\n\035replacement_processo" + + "r_version\030\002 \001(\tB/\372A,\n*documentai.googlea" + + "pis.com/ProcessorVersion\"\204\001\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\014\n\010DEPLOYED\020\001\022\r\n\tDEPLO" + + "YING\020\002\022\016\n\nUNDEPLOYED\020\003\022\017\n\013UNDEPLOYING\020\004\022" + + "\014\n\010CREATING\020\005\022\014\n\010DELETING\020\006\022\n\n\006FAILED\020\007:" + + "\226\001\352A\222\001\n*documentai.googleapis.com/Proces" + + "sorVersion\022dprojects/{project}/locations" + + "/{location}/processors/{processor}/proce" + + "ssorVersions/{processor_version}\"\255\004\n\tPro" + + "cessor\022\024\n\004name\030\001 \001(\tB\006\340A\005\340A\003\022\014\n\004type\030\002 \001" + + "(\t\022\024\n\014display_name\030\003 \001(\t\022?\n\005state\030\004 \001(\0162" + + "+.google.cloud.documentai.v1.Processor.S" + + "tateB\003\340A\003\022R\n\031default_processor_version\030\t" + + " \001(\tB/\372A,\n*documentai.googleapis.com/Pro" + + "cessorVersion\022 \n\020process_endpoint\030\006 \001(\tB" + + "\006\340A\003\340A\005\022/\n\013create_time\030\007 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\024\n\014kms_key_name\030\010 \001(\t\"~" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABLE" + + "D\020\001\022\014\n\010DISABLED\020\002\022\014\n\010ENABLING\020\003\022\r\n\tDISAB" + + "LING\020\004\022\014\n\010CREATING\020\005\022\n\n\006FAILED\020\006\022\014\n\010DELE" + + "TING\020\007:h\352Ae\n#documentai.googleapis.com/P" + + "rocessor\022>projects/{project}/locations/{" + + "location}/processors/{processor}B\321\001\n\036com" + + ".google.cloud.documentai.v1B\023DocumentAiP" + + "rocessorP\001Z>cloud.google.com/go/document" + + "ai/apiv1/documentaipb;documentaipb\252\002\032Goo" + + "gle.Cloud.DocumentAI.V1\312\002\032Google\\Cloud\\D" + + "ocumentAI\\V1\352\002\035Google::Cloud::DocumentAI" + + "::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -103,6 +106,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(), + com.google.cloud.documentai.v1.DocumentAiEvaluation.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_documentai_v1_ProcessorVersion_descriptor = @@ -116,6 +120,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocumentSchema", "State", "CreateTime", + "LatestEvaluation", "KmsKeyName", "KmsKeyVersionName", "GoogleManaged", @@ -156,6 +161,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(); + com.google.cloud.documentai.v1.DocumentAiEvaluation.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java index f32b4445dfc0..0d4d3bd6fe83 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentAiProcessorService.java @@ -179,6 +179,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1_SetDefaultProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -191,6 +211,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_GetEvaluationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_GetEvaluationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -208,268 +252,341 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "roto\032)google/cloud/documentai/v1/documen" + "t.proto\032,google/cloud/documentai/v1/docu" + "ment_io.proto\0320google/cloud/documentai/v" - + "1/document_schema.proto\0323google/cloud/do" - + "cumentai/v1/operation_metadata.proto\032*go" - + "ogle/cloud/documentai/v1/processor.proto" - + "\032/google/cloud/documentai/v1/processor_t" - + "ype.proto\032#google/longrunning/operations" - + ".proto\032 google/protobuf/field_mask.proto" - + "\032\037google/protobuf/timestamp.proto\032\027googl" - + "e/rpc/status.proto\"\200\002\n\016ProcessRequest\022?\n" - + "\017inline_document\030\004 \001(\0132$.google.cloud.do" - + "cumentai.v1.DocumentH\000\022?\n\014raw_document\030\005" - + " \001(\0132\'.google.cloud.documentai.v1.RawDoc" - + "umentH\000\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022\031\n\021skip" - + "_human_review\030\003 \001(\010\022.\n\nfield_mask\030\006 \001(\0132" - + "\032.google.protobuf.FieldMaskB\010\n\006source\"\356\001" - + "\n\021HumanReviewStatus\022B\n\005state\030\001 \001(\01623.goo" - + "gle.cloud.documentai.v1.HumanReviewStatu" - + "s.State\022\025\n\rstate_message\030\002 \001(\t\022\036\n\026human_" - + "review_operation\030\003 \001(\t\"^\n\005State\022\025\n\021STATE" - + "_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025\n\021VALIDATIO" - + "N_PASSED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t\n\005ERROR\020\004\"\225" - + "\001\n\017ProcessResponse\0226\n\010document\030\001 \001(\0132$.g" - + "oogle.cloud.documentai.v1.Document\022J\n\023hu" - + "man_review_status\030\003 \001(\0132-.google.cloud.d" - + "ocumentai.v1.HumanReviewStatus\"\353\001\n\023Batch" - + "ProcessRequest\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022" - + "N\n\017input_documents\030\005 \001(\01325.google.cloud." - + "documentai.v1.BatchDocumentsInputConfig\022" - + "P\n\026document_output_config\030\006 \001(\01320.google" - + ".cloud.documentai.v1.DocumentOutputConfi" - + "g\022\031\n\021skip_human_review\030\004 \001(\010\"\026\n\024BatchPro" - + "cessResponse\"\377\004\n\024BatchProcessMetadata\022E\n" - + "\005state\030\001 \001(\01626.google.cloud.documentai.v" - + "1.BatchProcessMetadata.State\022\025\n\rstate_me" - + "ssage\030\002 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.googl" - + "e.protobuf.Timestamp\022/\n\013update_time\030\004 \001(" - + "\0132\032.google.protobuf.Timestamp\022m\n\033individ" - + "ual_process_statuses\030\005 \003(\0132H.google.clou" - + "d.documentai.v1.BatchProcessMetadata.Ind" - + "ividualProcessStatus\032\303\001\n\027IndividualProce" - + "ssStatus\022\030\n\020input_gcs_source\030\001 \001(\t\022\"\n\006st" - + "atus\030\002 \001(\0132\022.google.rpc.Status\022\036\n\026output" - + "_gcs_destination\030\003 \001(\t\022J\n\023human_review_s" - + "tatus\030\005 \001(\0132-.google.cloud.documentai.v1" - + ".HumanReviewStatus\"r\n\005State\022\025\n\021STATE_UNS" - + "PECIFIED\020\000\022\013\n\007WAITING\020\001\022\013\n\007RUNNING\020\002\022\r\n\t" - + "SUCCEEDED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED" - + "\020\005\022\n\n\006FAILED\020\006\"]\n\032FetchProcessorTypesReq" - + "uest\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'documentai" - + ".googleapis.com/ProcessorType\"a\n\033FetchPr" - + "ocessorTypesResponse\022B\n\017processor_types\030" - + "\001 \003(\0132).google.cloud.documentai.v1.Proce" - + "ssorType\"\203\001\n\031ListProcessorTypesRequest\022?" + + "1/document_schema.proto\032+google/cloud/do" + + "cumentai/v1/evaluation.proto\0323google/clo" + + "ud/documentai/v1/operation_metadata.prot" + + "o\032*google/cloud/documentai/v1/processor." + + "proto\032/google/cloud/documentai/v1/proces" + + "sor_type.proto\032#google/longrunning/opera" + + "tions.proto\032\033google/protobuf/empty.proto" + + "\032 google/protobuf/field_mask.proto\032\037goog" + + "le/protobuf/timestamp.proto\032\027google/rpc/" + + "status.proto\"\200\002\n\016ProcessRequest\022?\n\017inlin" + + "e_document\030\004 \001(\0132$.google.cloud.document" + + "ai.v1.DocumentH\000\022?\n\014raw_document\030\005 \001(\0132\'" + + ".google.cloud.documentai.v1.RawDocumentH" + + "\000\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022\031\n\021skip_human" + + "_review\030\003 \001(\010\022.\n\nfield_mask\030\006 \001(\0132\032.goog" + + "le.protobuf.FieldMaskB\010\n\006source\"\356\001\n\021Huma" + + "nReviewStatus\022B\n\005state\030\001 \001(\01623.google.cl" + + "oud.documentai.v1.HumanReviewStatus.Stat" + + "e\022\025\n\rstate_message\030\002 \001(\t\022\036\n\026human_review" + + "_operation\030\003 \001(\t\"^\n\005State\022\025\n\021STATE_UNSPE" + + "CIFIED\020\000\022\013\n\007SKIPPED\020\001\022\025\n\021VALIDATION_PASS" + + "ED\020\002\022\017\n\013IN_PROGRESS\020\003\022\t\n\005ERROR\020\004\"\225\001\n\017Pro" + + "cessResponse\0226\n\010document\030\001 \001(\0132$.google." + + "cloud.documentai.v1.Document\022J\n\023human_re" + + "view_status\030\003 \001(\0132-.google.cloud.documen" + + "tai.v1.HumanReviewStatus\"\353\001\n\023BatchProces" + + "sRequest\022\027\n\004name\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022N\n\017inp" + + "ut_documents\030\005 \001(\01325.google.cloud.docume" + + "ntai.v1.BatchDocumentsInputConfig\022P\n\026doc" + + "ument_output_config\030\006 \001(\01320.google.cloud" + + ".documentai.v1.DocumentOutputConfig\022\031\n\021s" + + "kip_human_review\030\004 \001(\010\"\026\n\024BatchProcessRe" + + "sponse\"\377\004\n\024BatchProcessMetadata\022E\n\005state" + + "\030\001 \001(\01626.google.cloud.documentai.v1.Batc" + + "hProcessMetadata.State\022\025\n\rstate_message\030" + + "\002 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.google.prot" + + "obuf.Timestamp\022/\n\013update_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022m\n\033individual_pr" + + "ocess_statuses\030\005 \003(\0132H.google.cloud.docu" + + "mentai.v1.BatchProcessMetadata.Individua" + + "lProcessStatus\032\303\001\n\027IndividualProcessStat" + + "us\022\030\n\020input_gcs_source\030\001 \001(\t\022\"\n\006status\030\002" + + " \001(\0132\022.google.rpc.Status\022\036\n\026output_gcs_d" + + "estination\030\003 \001(\t\022J\n\023human_review_status\030" + + "\005 \001(\0132-.google.cloud.documentai.v1.Human" + + "ReviewStatus\"r\n\005State\022\025\n\021STATE_UNSPECIFI" + + "ED\020\000\022\013\n\007WAITING\020\001\022\013\n\007RUNNING\020\002\022\r\n\tSUCCEE" + + "DED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020\005\022\n\n\006" + + "FAILED\020\006\"]\n\032FetchProcessorTypesRequest\022?" + "\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'documentai.googl" - + "eapis.com/ProcessorType\022\021\n\tpage_size\030\002 \001" - + "(\005\022\022\n\npage_token\030\003 \001(\t\"y\n\032ListProcessorT" - + "ypesResponse\022B\n\017processor_types\030\001 \003(\0132)." - + "google.cloud.documentai.v1.ProcessorType" - + "\022\027\n\017next_page_token\030\002 \001(\t\"{\n\025ListProcess" - + "orsRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#docu" - + "mentai.googleapis.com/Processor\022\021\n\tpage_" - + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"l\n\026ListPr" - + "ocessorsResponse\0229\n\nprocessors\030\001 \003(\0132%.g" - + "oogle.cloud.documentai.v1.Processor\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\"X\n\027GetProcessorType" - + "Request\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'documenta" - + "i.googleapis.com/ProcessorType\"P\n\023GetPro" - + "cessorRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#doc" - + "umentai.googleapis.com/Processor\"^\n\032GetP" - + "rocessorVersionRequest\022@\n\004name\030\001 \001(\tB2\340A" - + "\002\372A,\n*documentai.googleapis.com/Processo" - + "rVersion\"\211\001\n\034ListProcessorVersionsReques" - + "t\022B\n\006parent\030\001 \001(\tB2\340A\002\372A,\022*documentai.go" - + "ogleapis.com/ProcessorVersion\022\021\n\tpage_si" - + "ze\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\202\001\n\035ListPro" - + "cessorVersionsResponse\022H\n\022processor_vers" - + "ions\030\001 \003(\0132,.google.cloud.documentai.v1." - + "ProcessorVersion\022\027\n\017next_page_token\030\002 \001(" - + "\t\"a\n\035DeleteProcessorVersionRequest\022@\n\004na" - + "me\030\001 \001(\tB2\340A\002\372A,\n*documentai.googleapis." - + "com/ProcessorVersion\"n\n\036DeleteProcessorV" - + "ersionMetadata\022L\n\017common_metadata\030\001 \001(\0132" - + "3.google.cloud.documentai.v1.CommonOpera" - + "tionMetadata\"a\n\035DeployProcessorVersionRe" - + "quest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*documentai." - + "googleapis.com/ProcessorVersion\" \n\036Deplo" - + "yProcessorVersionResponse\"n\n\036DeployProce" - + "ssorVersionMetadata\022L\n\017common_metadata\030\001" - + " \001(\01323.google.cloud.documentai.v1.Common" - + "OperationMetadata\"c\n\037UndeployProcessorVe" - + "rsionRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*docu" - + "mentai.googleapis.com/ProcessorVersion\"\"" - + "\n UndeployProcessorVersionResponse\"p\n Un" - + "deployProcessorVersionMetadata\022L\n\017common" - + "_metadata\030\001 \001(\01323.google.cloud.documenta" - + "i.v1.CommonOperationMetadata\"\224\001\n\026CreateP" - + "rocessorRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022" - + "#documentai.googleapis.com/Processor\022=\n\t" - + "processor\030\002 \001(\0132%.google.cloud.documenta" - + "i.v1.ProcessorB\003\340A\002\"S\n\026DeleteProcessorRe" - + "quest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documentai." - + "googleapis.com/Processor\"g\n\027DeleteProces" - + "sorMetadata\022L\n\017common_metadata\030\005 \001(\01323.g" - + "oogle.cloud.documentai.v1.CommonOperatio" - + "nMetadata\"S\n\026EnableProcessorRequest\0229\n\004n" - + "ame\030\001 \001(\tB+\340A\002\372A%\n#documentai.googleapis" - + ".com/Processor\"\031\n\027EnableProcessorRespons" - + "e\"g\n\027EnableProcessorMetadata\022L\n\017common_m" - + "etadata\030\005 \001(\01323.google.cloud.documentai." - + "v1.CommonOperationMetadata\"T\n\027DisablePro" - + "cessorRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#doc" - + "umentai.googleapis.com/Processor\"\032\n\030Disa" - + "bleProcessorResponse\"h\n\030DisableProcessor" - + "Metadata\022L\n\017common_metadata\030\005 \001(\01323.goog" + + "eapis.com/ProcessorType\"a\n\033FetchProcesso" + + "rTypesResponse\022B\n\017processor_types\030\001 \003(\0132" + + ").google.cloud.documentai.v1.ProcessorTy" + + "pe\"\203\001\n\031ListProcessorTypesRequest\022?\n\006pare" + + "nt\030\001 \001(\tB/\340A\002\372A)\022\'documentai.googleapis." + + "com/ProcessorType\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"y\n\032ListProcessorTypesRe" + + "sponse\022B\n\017processor_types\030\001 \003(\0132).google" + + ".cloud.documentai.v1.ProcessorType\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"{\n\025ListProcessorsReq" + + "uest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#documentai" + + ".googleapis.com/Processor\022\021\n\tpage_size\030\002" + + " \001(\005\022\022\n\npage_token\030\003 \001(\t\"l\n\026ListProcesso" + + "rsResponse\0229\n\nprocessors\030\001 \003(\0132%.google." + + "cloud.documentai.v1.Processor\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\"X\n\027GetProcessorTypeReques" + + "t\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'documentai.goog" + + "leapis.com/ProcessorType\"P\n\023GetProcessor" + + "Request\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documenta" + + "i.googleapis.com/Processor\"^\n\032GetProcess" + + "orVersionRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*" + + "documentai.googleapis.com/ProcessorVersi" + + "on\"\211\001\n\034ListProcessorVersionsRequest\022B\n\006p" + + "arent\030\001 \001(\tB2\340A\002\372A,\022*documentai.googleap" + + "is.com/ProcessorVersion\022\021\n\tpage_size\030\002 \001" + + "(\005\022\022\n\npage_token\030\003 \001(\t\"\202\001\n\035ListProcessor" + + "VersionsResponse\022H\n\022processor_versions\030\001" + + " \003(\0132,.google.cloud.documentai.v1.Proces" + + "sorVersion\022\027\n\017next_page_token\030\002 \001(\t\"a\n\035D" + + "eleteProcessorVersionRequest\022@\n\004name\030\001 \001" + + "(\tB2\340A\002\372A,\n*documentai.googleapis.com/Pr" + + "ocessorVersion\"n\n\036DeleteProcessorVersion" + + "Metadata\022L\n\017common_metadata\030\001 \001(\01323.goog" + "le.cloud.documentai.v1.CommonOperationMe" - + "tadata\"\272\001\n!SetDefaultProcessorVersionReq" - + "uest\022>\n\tprocessor\030\001 \001(\tB+\340A\002\372A%\n#documen" - + "tai.googleapis.com/Processor\022U\n\031default_" - + "processor_version\030\002 \001(\tB2\340A\002\372A,\n*documen" - + "tai.googleapis.com/ProcessorVersion\"$\n\"S" - + "etDefaultProcessorVersionResponse\"r\n\"Set" - + "DefaultProcessorVersionMetadata\022L\n\017commo" - + "n_metadata\030\001 \001(\01323.google.cloud.document" - + "ai.v1.CommonOperationMetadata\"\216\003\n\025Review" - + "DocumentRequest\022?\n\017inline_document\030\004 \001(\013" - + "2$.google.cloud.documentai.v1.DocumentH\000" - + "\022P\n\023human_review_config\030\001 \001(\tB3\340A\002\372A-\n+d" - + "ocumentai.googleapis.com/HumanReviewConf" - + "ig\022 \n\030enable_schema_validation\030\003 \001(\010\022L\n\010" - + "priority\030\005 \001(\0162:.google.cloud.documentai" - + ".v1.ReviewDocumentRequest.Priority\022C\n\017do" - + "cument_schema\030\006 \001(\0132*.google.cloud.docum" - + "entai.v1.DocumentSchema\"#\n\010Priority\022\013\n\007D" - + "EFAULT\020\000\022\n\n\006URGENT\020\001B\010\n\006source\"\321\001\n\026Revie" - + "wDocumentResponse\022\027\n\017gcs_destination\030\001 \001" - + "(\t\022G\n\005state\030\002 \001(\01628.google.cloud.documen" - + "tai.v1.ReviewDocumentResponse.State\022\030\n\020r" - + "ejection_reason\030\003 \001(\t\";\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\014\n\010REJECTED\020\001\022\r\n\tSUCCEEDED" - + "\020\002\"\204\001\n\037ReviewDocumentOperationMetadata\022L" - + "\n\017common_metadata\030\005 \001(\01323.google.cloud.d" - + "ocumentai.v1.CommonOperationMetadata\022\023\n\013" - + "question_id\030\006 \001(\t2\200\"\n\030DocumentProcessorS" - + "ervice\022\207\002\n\017ProcessDocument\022*.google.clou" - + "d.documentai.v1.ProcessRequest\032+.google." - + "cloud.documentai.v1.ProcessResponse\"\232\001\202\323" - + "\344\223\002\214\001\"6/v1/{name=projects/*/locations/*/" - + "processors/*}:process:\001*ZO\"J/v1/{name=pr" - + "ojects/*/locations/*/processors/*/proces" - + "sorVersions/*}:process:\001*\332A\004name\022\275\002\n\025Bat" - + "chProcessDocuments\022/.google.cloud.docume" - + "ntai.v1.BatchProcessRequest\032\035.google.lon" - + "grunning.Operation\"\323\001\202\323\344\223\002\226\001\";/v1/{name=" - + "projects/*/locations/*/processors/*}:bat" - + "chProcess:\001*ZT\"O/v1/{name=projects/*/loc" - + "ations/*/processors/*/processorVersions/" - + "*}:batchProcess:\001*\332A\004name\312A,\n\024BatchProce" - + "ssResponse\022\024BatchProcessMetadata\022\320\001\n\023Fet" - + "chProcessorTypes\0226.google.cloud.document" - + "ai.v1.FetchProcessorTypesRequest\0327.googl" - + "e.cloud.documentai.v1.FetchProcessorType" - + "sResponse\"H\202\323\344\223\0029\0227/v1/{parent=projects/" - + "*/locations/*}:fetchProcessorTypes\332A\006par" - + "ent\022\310\001\n\022ListProcessorTypes\0225.google.clou" - + "d.documentai.v1.ListProcessorTypesReques" - + "t\0326.google.cloud.documentai.v1.ListProce" - + "ssorTypesResponse\"C\202\323\344\223\0024\0222/v1/{parent=p" - + "rojects/*/locations/*}/processorTypes\332A\006" - + "parent\022\265\001\n\020GetProcessorType\0223.google.clo" - + "ud.documentai.v1.GetProcessorTypeRequest" - + "\032).google.cloud.documentai.v1.ProcessorT" - + "ype\"A\202\323\344\223\0024\0222/v1/{name=projects/*/locati" - + "ons/*/processorTypes/*}\332A\004name\022\270\001\n\016ListP" - + "rocessors\0221.google.cloud.documentai.v1.L" - + "istProcessorsRequest\0322.google.cloud.docu" - + "mentai.v1.ListProcessorsResponse\"?\202\323\344\223\0020" - + "\022./v1/{parent=projects/*/locations/*}/pr" - + "ocessors\332A\006parent\022\245\001\n\014GetProcessor\022/.goo" - + "gle.cloud.documentai.v1.GetProcessorRequ" - + "est\032%.google.cloud.documentai.v1.Process" - + "or\"=\202\323\344\223\0020\022./v1/{name=projects/*/locatio" - + "ns/*/processors/*}\332A\004name\022\316\001\n\023GetProcess" - + "orVersion\0226.google.cloud.documentai.v1.G" - + "etProcessorVersionRequest\032,.google.cloud" - + ".documentai.v1.ProcessorVersion\"Q\202\323\344\223\002D\022" - + "B/v1/{name=projects/*/locations/*/proces" - + "sors/*/processorVersions/*}\332A\004name\022\341\001\n\025L" - + "istProcessorVersions\0228.google.cloud.docu" - + "mentai.v1.ListProcessorVersionsRequest\0329" + + "tadata\"a\n\035DeployProcessorVersionRequest\022" + + "@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*documentai.google" + + "apis.com/ProcessorVersion\" \n\036DeployProce" + + "ssorVersionResponse\"n\n\036DeployProcessorVe" + + "rsionMetadata\022L\n\017common_metadata\030\001 \001(\01323" + + ".google.cloud.documentai.v1.CommonOperat" + + "ionMetadata\"c\n\037UndeployProcessorVersionR" + + "equest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*documentai" + + ".googleapis.com/ProcessorVersion\"\"\n Unde" + + "ployProcessorVersionResponse\"p\n Undeploy" + + "ProcessorVersionMetadata\022L\n\017common_metad" + + "ata\030\001 \001(\01323.google.cloud.documentai.v1.C" + + "ommonOperationMetadata\"\224\001\n\026CreateProcess" + + "orRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#docum" + + "entai.googleapis.com/Processor\022=\n\tproces" + + "sor\030\002 \001(\0132%.google.cloud.documentai.v1.P" + + "rocessorB\003\340A\002\"S\n\026DeleteProcessorRequest\022" + + "9\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documentai.google" + + "apis.com/Processor\"g\n\027DeleteProcessorMet" + + "adata\022L\n\017common_metadata\030\005 \001(\01323.google." + + "cloud.documentai.v1.CommonOperationMetad" + + "ata\"S\n\026EnableProcessorRequest\0229\n\004name\030\001 " + + "\001(\tB+\340A\002\372A%\n#documentai.googleapis.com/P" + + "rocessor\"\031\n\027EnableProcessorResponse\"g\n\027E" + + "nableProcessorMetadata\022L\n\017common_metadat" + + "a\030\005 \001(\01323.google.cloud.documentai.v1.Com" + + "monOperationMetadata\"T\n\027DisableProcessor" + + "Request\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#documenta" + + "i.googleapis.com/Processor\"\032\n\030DisablePro" + + "cessorResponse\"h\n\030DisableProcessorMetada" + + "ta\022L\n\017common_metadata\030\005 \001(\01323.google.clo" + + "ud.documentai.v1.CommonOperationMetadata" + + "\"\272\001\n!SetDefaultProcessorVersionRequest\022>" + + "\n\tprocessor\030\001 \001(\tB+\340A\002\372A%\n#documentai.go" + + "ogleapis.com/Processor\022U\n\031default_proces" + + "sor_version\030\002 \001(\tB2\340A\002\372A,\n*documentai.go" + + "ogleapis.com/ProcessorVersion\"$\n\"SetDefa" + + "ultProcessorVersionResponse\"r\n\"SetDefaul" + + "tProcessorVersionMetadata\022L\n\017common_meta" + + "data\030\001 \001(\01323.google.cloud.documentai.v1." + + "CommonOperationMetadata\"\245\004\n\034TrainProcess" + + "orVersionRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%" + + "\n#documentai.googleapis.com/Processor\022L\n" + + "\021processor_version\030\002 \001(\0132,.google.cloud." + + "documentai.v1.ProcessorVersionB\003\340A\002\022H\n\017d" + + "ocument_schema\030\n \001(\0132*.google.cloud.docu" + + "mentai.v1.DocumentSchemaB\003\340A\001\022[\n\ninput_d" + + "ata\030\004 \001(\0132B.google.cloud.documentai.v1.T" + + "rainProcessorVersionRequest.InputDataB\003\340" + + "A\001\022#\n\026base_processor_version\030\010 \001(\tB\003\340A\001\032" + + "\255\001\n\tInputData\022Q\n\022training_documents\030\003 \001(" + + "\01325.google.cloud.documentai.v1.BatchDocu" + + "mentsInputConfig\022M\n\016test_documents\030\004 \001(\013" + + "25.google.cloud.documentai.v1.BatchDocum" + + "entsInputConfig\":\n\035TrainProcessorVersion" + + "Response\022\031\n\021processor_version\030\001 \001(\t\"\367\003\n\035" + + "TrainProcessorVersionMetadata\022L\n\017common_" + + "metadata\030\001 \001(\01323.google.cloud.documentai" + + ".v1.CommonOperationMetadata\022p\n\033training_" + + "dataset_validation\030\002 \001(\0132K.google.cloud." + + "documentai.v1.TrainProcessorVersionMetad" + + "ata.DatasetValidation\022l\n\027test_dataset_va" + + "lidation\030\003 \001(\0132K.google.cloud.documentai" + + ".v1.TrainProcessorVersionMetadata.Datase" + + "tValidation\032\247\001\n\021DatasetValidation\022\034\n\024doc" + + "ument_error_count\030\003 \001(\005\022\033\n\023dataset_error" + + "_count\030\004 \001(\005\022+\n\017document_errors\030\001 \003(\0132\022." + + "google.rpc.Status\022*\n\016dataset_errors\030\002 \003(" + + "\0132\022.google.rpc.Status\"\216\003\n\025ReviewDocument" + + "Request\022?\n\017inline_document\030\004 \001(\0132$.googl" + + "e.cloud.documentai.v1.DocumentH\000\022P\n\023huma" + + "n_review_config\030\001 \001(\tB3\340A\002\372A-\n+documenta" + + "i.googleapis.com/HumanReviewConfig\022 \n\030en" + + "able_schema_validation\030\003 \001(\010\022L\n\010priority" + + "\030\005 \001(\0162:.google.cloud.documentai.v1.Revi" + + "ewDocumentRequest.Priority\022C\n\017document_s" + + "chema\030\006 \001(\0132*.google.cloud.documentai.v1" + + ".DocumentSchema\"#\n\010Priority\022\013\n\007DEFAULT\020\000" + + "\022\n\n\006URGENT\020\001B\010\n\006source\"\321\001\n\026ReviewDocumen" + + "tResponse\022\027\n\017gcs_destination\030\001 \001(\t\022G\n\005st" + + "ate\030\002 \001(\01628.google.cloud.documentai.v1.R" + + "eviewDocumentResponse.State\022\030\n\020rejection" + + "_reason\030\003 \001(\t\";\n\005State\022\025\n\021STATE_UNSPECIF" + + "IED\020\000\022\014\n\010REJECTED\020\001\022\r\n\tSUCCEEDED\020\002\"\204\001\n\037R" + + "eviewDocumentOperationMetadata\022L\n\017common" + + "_metadata\030\005 \001(\01323.google.cloud.documenta" + + "i.v1.CommonOperationMetadata\022\023\n\013question" + + "_id\030\006 \001(\t\"\312\001\n\037EvaluateProcessorVersionRe" + + "quest\022M\n\021processor_version\030\001 \001(\tB2\340A\002\372A," + + "\n*documentai.googleapis.com/ProcessorVer" + + "sion\022X\n\024evaluation_documents\030\003 \001(\01325.goo" + + "gle.cloud.documentai.v1.BatchDocumentsIn" + + "putConfigB\003\340A\001\"p\n EvaluateProcessorVersi" + + "onMetadata\022L\n\017common_metadata\030\001 \001(\01323.go" + + "ogle.cloud.documentai.v1.CommonOperation" + + "Metadata\"6\n EvaluateProcessorVersionResp" + + "onse\022\022\n\nevaluation\030\002 \001(\t\"R\n\024GetEvaluatio" + + "nRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$document" + + "ai.googleapis.com/Evaluation\"\203\001\n\026ListEva" + + "luationsRequest\022B\n\006parent\030\001 \001(\tB2\340A\002\372A,\n" + + "*documentai.googleapis.com/ProcessorVers" + + "ion\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + + "(\t\"o\n\027ListEvaluationsResponse\022;\n\013evaluat" + + "ions\030\001 \003(\0132&.google.cloud.documentai.v1." + + "Evaluation\022\027\n\017next_page_token\030\002 \001(\t2\234*\n\030" + + "DocumentProcessorService\022\207\002\n\017ProcessDocu" + + "ment\022*.google.cloud.documentai.v1.Proces" + + "sRequest\032+.google.cloud.documentai.v1.Pr" + + "ocessResponse\"\232\001\202\323\344\223\002\214\001\"6/v1/{name=proje" + + "cts/*/locations/*/processors/*}:process:" + + "\001*ZO\"J/v1/{name=projects/*/locations/*/p" + + "rocessors/*/processorVersions/*}:process" + + ":\001*\332A\004name\022\275\002\n\025BatchProcessDocuments\022/.g" + + "oogle.cloud.documentai.v1.BatchProcessRe" + + "quest\032\035.google.longrunning.Operation\"\323\001\202" + + "\323\344\223\002\226\001\";/v1/{name=projects/*/locations/*" + + "/processors/*}:batchProcess:\001*ZT\"O/v1/{n" + + "ame=projects/*/locations/*/processors/*/" + + "processorVersions/*}:batchProcess:\001*\332A\004n" + + "ame\312A,\n\024BatchProcessResponse\022\024BatchProce" + + "ssMetadata\022\320\001\n\023FetchProcessorTypes\0226.goo" + + "gle.cloud.documentai.v1.FetchProcessorTy" + + "pesRequest\0327.google.cloud.documentai.v1." + + "FetchProcessorTypesResponse\"H\202\323\344\223\0029\0227/v1" + + "/{parent=projects/*/locations/*}:fetchPr" + + "ocessorTypes\332A\006parent\022\310\001\n\022ListProcessorT" + + "ypes\0225.google.cloud.documentai.v1.ListPr" + + "ocessorTypesRequest\0326.google.cloud.docum" + + "entai.v1.ListProcessorTypesResponse\"C\202\323\344" + + "\223\0024\0222/v1/{parent=projects/*/locations/*}" + + "/processorTypes\332A\006parent\022\265\001\n\020GetProcesso" + + "rType\0223.google.cloud.documentai.v1.GetPr" + + "ocessorTypeRequest\032).google.cloud.docume" + + "ntai.v1.ProcessorType\"A\202\323\344\223\0024\0222/v1/{name" + + "=projects/*/locations/*/processorTypes/*" + + "}\332A\004name\022\270\001\n\016ListProcessors\0221.google.clo" + + "ud.documentai.v1.ListProcessorsRequest\0322" + ".google.cloud.documentai.v1.ListProcesso" - + "rVersionsResponse\"S\202\323\344\223\002D\022B/v1/{parent=p" - + "rojects/*/locations/*/processors/*}/proc" - + "essorVersions\332A\006parent\022\200\002\n\026DeleteProcess" - + "orVersion\0229.google.cloud.documentai.v1.D" - + "eleteProcessorVersionRequest\032\035.google.lo" - + "ngrunning.Operation\"\213\001\202\323\344\223\002D*B/v1/{name=" - + "projects/*/locations/*/processors/*/proc" - + "essorVersions/*}\332A\004name\312A7\n\025google.proto" - + "buf.Empty\022\036DeleteProcessorVersionMetadat" - + "a\022\223\002\n\026DeployProcessorVersion\0229.google.cl" - + "oud.documentai.v1.DeployProcessorVersion" - + "Request\032\035.google.longrunning.Operation\"\236" - + "\001\202\323\344\223\002N\"I/v1/{name=projects/*/locations/" - + "*/processors/*/processorVersions/*}:depl" - + "oy:\001*\332A\004name\312A@\n\036DeployProcessorVersionR" - + "esponse\022\036DeployProcessorVersionMetadata\022" - + "\235\002\n\030UndeployProcessorVersion\022;.google.cl" - + "oud.documentai.v1.UndeployProcessorVersi" - + "onRequest\032\035.google.longrunning.Operation" - + "\"\244\001\202\323\344\223\002P\"K/v1/{name=projects/*/location" - + "s/*/processors/*/processorVersions/*}:un" - + "deploy:\001*\332A\004name\312AD\n UndeployProcessorVe" - + "rsionResponse\022 UndeployProcessorVersionM" - + "etadata\022\302\001\n\017CreateProcessor\0222.google.clo" - + "ud.documentai.v1.CreateProcessorRequest\032" - + "%.google.cloud.documentai.v1.Processor\"T" - + "\202\323\344\223\002;\"./v1/{parent=projects/*/locations" - + "/*}/processors:\tprocessor\332A\020parent,proce" - + "ssor\022\326\001\n\017DeleteProcessor\0222.google.cloud." - + "documentai.v1.DeleteProcessorRequest\032\035.g" - + "oogle.longrunning.Operation\"p\202\323\344\223\0020*./v1" - + "/{name=projects/*/locations/*/processors" - + "/*}\332A\004name\312A0\n\025google.protobuf.Empty\022\027De" - + "leteProcessorMetadata\022\333\001\n\017EnableProcesso" - + "r\0222.google.cloud.documentai.v1.EnablePro" - + "cessorRequest\032\035.google.longrunning.Opera" - + "tion\"u\202\323\344\223\002:\"5/v1/{name=projects/*/locat" - + "ions/*/processors/*}:enable:\001*\312A2\n\027Enabl" - + "eProcessorResponse\022\027EnableProcessorMetad" - + "ata\022\340\001\n\020DisableProcessor\0223.google.cloud." - + "documentai.v1.DisableProcessorRequest\032\035." - + "google.longrunning.Operation\"x\202\323\344\223\002;\"6/v" - + "1/{name=projects/*/locations/*/processor" - + "s/*}:disable:\001*\312A4\n\030DisableProcessorResp" - + "onse\022\030DisableProcessorMetadata\022\241\002\n\032SetDe" - + "faultProcessorVersion\022=.google.cloud.doc" - + "umentai.v1.SetDefaultProcessorVersionReq" - + "uest\032\035.google.longrunning.Operation\"\244\001\202\323" - + "\344\223\002S\"N/v1/{processor=projects/*/location" - + "s/*/processors/*}:setDefaultProcessorVer" - + "sion:\001*\312AH\n\"SetDefaultProcessorVersionRe" - + "sponse\022\"SetDefaultProcessorVersionMetada" - + "ta\022\240\002\n\016ReviewDocument\0221.google.cloud.doc" - + "umentai.v1.ReviewDocumentRequest\032\035.googl" - + "e.longrunning.Operation\"\273\001\202\323\344\223\002c\"^/v1/{h" - + "uman_review_config=projects/*/locations/" - + "*/processors/*/humanReviewConfig}:review" - + "Document:\001*\332A\023human_review_config\312A9\n\026Re" - + "viewDocumentResponse\022\037ReviewDocumentOper" - + "ationMetadata\032M\312A\031documentai.googleapis." - + "com\322A.https://www.googleapis.com/auth/cl" - + "oud-platformB\252\003\n\036com.google.cloud.docume" - + "ntai.v1B\032DocumentAiProcessorServiceP\001Z>c" - + "loud.google.com/go/documentai/apiv1/docu" - + "mentaipb;documentaipb\252\002\032Google.Cloud.Doc" - + "umentAI.V1\312\002\032Google\\Cloud\\DocumentAI\\V1\352" - + "\002\035Google::Cloud::DocumentAI::V1\352A\177\n+docu" - + "mentai.googleapis.com/HumanReviewConfig\022" - + "Pprojects/{project}/locations/{location}" - + "/processors/{processor}/humanReviewConfi" - + "g\352AM\n\"documentai.googleapis.com/Location" - + "\022\'projects/{project}/locations/{location" - + "}b\006proto3" + + "rsResponse\"?\202\323\344\223\0020\022./v1/{parent=projects" + + "/*/locations/*}/processors\332A\006parent\022\245\001\n\014" + + "GetProcessor\022/.google.cloud.documentai.v" + + "1.GetProcessorRequest\032%.google.cloud.doc" + + "umentai.v1.Processor\"=\202\323\344\223\0020\022./v1/{name=" + + "projects/*/locations/*/processors/*}\332A\004n" + + "ame\022\242\002\n\025TrainProcessorVersion\0228.google.c" + + "loud.documentai.v1.TrainProcessorVersion" + + "Request\032\035.google.longrunning.Operation\"\257" + + "\001\202\323\344\223\002M\"H/v1/{parent=projects/*/location" + + "s/*/processors/*}/processorVersions:trai" + + "n:\001*\332A\030parent,processor_version\312A>\n\035Trai" + + "nProcessorVersionResponse\022\035TrainProcesso" + + "rVersionMetadata\022\316\001\n\023GetProcessorVersion" + + "\0226.google.cloud.documentai.v1.GetProcess" + + "orVersionRequest\032,.google.cloud.document" + + "ai.v1.ProcessorVersion\"Q\202\323\344\223\002D\022B/v1/{nam" + + "e=projects/*/locations/*/processors/*/pr" + + "ocessorVersions/*}\332A\004name\022\341\001\n\025ListProces" + + "sorVersions\0228.google.cloud.documentai.v1" + + ".ListProcessorVersionsRequest\0329.google.c" + + "loud.documentai.v1.ListProcessorVersions" + + "Response\"S\202\323\344\223\002D\022B/v1/{parent=projects/*" + + "/locations/*/processors/*}/processorVers" + + "ions\332A\006parent\022\200\002\n\026DeleteProcessorVersion" + + "\0229.google.cloud.documentai.v1.DeleteProc" + + "essorVersionRequest\032\035.google.longrunning" + + ".Operation\"\213\001\202\323\344\223\002D*B/v1/{name=projects/" + + "*/locations/*/processors/*/processorVers" + + "ions/*}\332A\004name\312A7\n\025google.protobuf.Empty" + + "\022\036DeleteProcessorVersionMetadata\022\223\002\n\026Dep" + + "loyProcessorVersion\0229.google.cloud.docum" + + "entai.v1.DeployProcessorVersionRequest\032\035" + + ".google.longrunning.Operation\"\236\001\202\323\344\223\002N\"I" + + "/v1/{name=projects/*/locations/*/process" + + "ors/*/processorVersions/*}:deploy:\001*\332A\004n" + + "ame\312A@\n\036DeployProcessorVersionResponse\022\036" + + "DeployProcessorVersionMetadata\022\235\002\n\030Undep" + + "loyProcessorVersion\022;.google.cloud.docum" + + "entai.v1.UndeployProcessorVersionRequest" + + "\032\035.google.longrunning.Operation\"\244\001\202\323\344\223\002P" + + "\"K/v1/{name=projects/*/locations/*/proce" + + "ssors/*/processorVersions/*}:undeploy:\001*" + + "\332A\004name\312AD\n UndeployProcessorVersionResp" + + "onse\022 UndeployProcessorVersionMetadata\022\302" + + "\001\n\017CreateProcessor\0222.google.cloud.docume" + + "ntai.v1.CreateProcessorRequest\032%.google." + + "cloud.documentai.v1.Processor\"T\202\323\344\223\002;\"./" + + "v1/{parent=projects/*/locations/*}/proce" + + "ssors:\tprocessor\332A\020parent,processor\022\326\001\n\017" + + "DeleteProcessor\0222.google.cloud.documenta" + + "i.v1.DeleteProcessorRequest\032\035.google.lon" + + "grunning.Operation\"p\202\323\344\223\0020*./v1/{name=pr" + + "ojects/*/locations/*/processors/*}\332A\004nam" + + "e\312A0\n\025google.protobuf.Empty\022\027DeleteProce" + + "ssorMetadata\022\333\001\n\017EnableProcessor\0222.googl" + + "e.cloud.documentai.v1.EnableProcessorReq" + + "uest\032\035.google.longrunning.Operation\"u\202\323\344" + + "\223\002:\"5/v1/{name=projects/*/locations/*/pr" + + "ocessors/*}:enable:\001*\312A2\n\027EnableProcesso" + + "rResponse\022\027EnableProcessorMetadata\022\340\001\n\020D" + + "isableProcessor\0223.google.cloud.documenta" + + "i.v1.DisableProcessorRequest\032\035.google.lo" + + "ngrunning.Operation\"x\202\323\344\223\002;\"6/v1/{name=p" + + "rojects/*/locations/*/processors/*}:disa" + + "ble:\001*\312A4\n\030DisableProcessorResponse\022\030Dis" + + "ableProcessorMetadata\022\241\002\n\032SetDefaultProc" + + "essorVersion\022=.google.cloud.documentai.v" + + "1.SetDefaultProcessorVersionRequest\032\035.go" + + "ogle.longrunning.Operation\"\244\001\202\323\344\223\002S\"N/v1" + + "/{processor=projects/*/locations/*/proce" + + "ssors/*}:setDefaultProcessorVersion:\001*\312A" + + "H\n\"SetDefaultProcessorVersionResponse\022\"S" + + "etDefaultProcessorVersionMetadata\022\240\002\n\016Re" + + "viewDocument\0221.google.cloud.documentai.v" + + "1.ReviewDocumentRequest\032\035.google.longrun" + + "ning.Operation\"\273\001\202\323\344\223\002c\"^/v1/{human_revi" + + "ew_config=projects/*/locations/*/process" + + "ors/*/humanReviewConfig}:reviewDocument:" + + "\001*\332A\023human_review_config\312A9\n\026ReviewDocum" + + "entResponse\022\037ReviewDocumentOperationMeta" + + "data\022\307\002\n\030EvaluateProcessorVersion\022;.goog" + + "le.cloud.documentai.v1.EvaluateProcessor" + + "VersionRequest\032\035.google.longrunning.Oper" + + "ation\"\316\001\202\323\344\223\002m\"h/v1/{processor_version=p" + + "rojects/*/locations/*/processors/*/proce" + + "ssorVersions/*}:evaluateProcessorVersion" + + ":\001*\332A\021processor_version\312AD\n EvaluateProc" + + "essorVersionResponse\022 EvaluateProcessorV" + + "ersionMetadata\022\312\001\n\rGetEvaluation\0220.googl" + + "e.cloud.documentai.v1.GetEvaluationReque" + + "st\032&.google.cloud.documentai.v1.Evaluati" + + "on\"_\202\323\344\223\002R\022P/v1/{name=projects/*/locatio" + + "ns/*/processors/*/processorVersions/*/ev" + + "aluations/*}\332A\004name\022\335\001\n\017ListEvaluations\022" + + "2.google.cloud.documentai.v1.ListEvaluat" + + "ionsRequest\0323.google.cloud.documentai.v1" + + ".ListEvaluationsResponse\"a\202\323\344\223\002R\022P/v1/{p" + + "arent=projects/*/locations/*/processors/" + + "*/processorVersions/*}/evaluations\332A\006par" + + "ent\032M\312A\031documentai.googleapis.com\322A.http" + + "s://www.googleapis.com/auth/cloud-platfo" + + "rmB\252\003\n\036com.google.cloud.documentai.v1B\032D" + + "ocumentAiProcessorServiceP\001Z>cloud.googl" + + "e.com/go/documentai/apiv1/documentaipb;d" + + "ocumentaipb\252\002\032Google.Cloud.DocumentAI.V1" + + "\312\002\032Google\\Cloud\\DocumentAI\\V1\352\002\035Google::" + + "Cloud::DocumentAI::V1\352A\177\n+documentai.goo" + + "gleapis.com/HumanReviewConfig\022Pprojects/" + + "{project}/locations/{location}/processor" + + "s/{processor}/humanReviewConfig\352AM\n\"docu" + + "mentai.googleapis.com/Location\022\'projects" + + "/{project}/locations/{location}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -482,10 +599,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.documentai.v1.DocumentProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentIoProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(), + com.google.cloud.documentai.v1.DocumentAiEvaluation.getDescriptor(), com.google.cloud.documentai.v1.OperationMetadataProto.getDescriptor(), com.google.cloud.documentai.v1.DocumentAiProcessor.getDescriptor(), com.google.cloud.documentai.v1.DocumentAiProcessorType.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), @@ -784,8 +903,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "CommonMetadata", }); - internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor = + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor = getDescriptor().getMessageTypes().get(37); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor, + new java.lang.String[] { + "Parent", "ProcessorVersion", "DocumentSchema", "InputData", "BaseProcessorVersion", + }); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_descriptor = + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_descriptor, + new java.lang.String[] { + "TrainingDocuments", "TestDocuments", + }); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_descriptor, + new java.lang.String[] { + "ProcessorVersion", + }); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", "TrainingDatasetValidation", "TestDatasetValidation", + }); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_descriptor = + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_descriptor, + new java.lang.String[] { + "DocumentErrorCount", "DatasetErrorCount", "DocumentErrors", "DatasetErrors", + }); + internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(40); internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentRequest_descriptor, @@ -798,7 +961,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Source", }); internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(41); internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentResponse_descriptor, @@ -806,13 +969,61 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "GcsDestination", "State", "RejectionReason", }); internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(42); internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_documentai_v1_ReviewDocumentOperationMetadata_descriptor, new java.lang.String[] { "CommonMetadata", "QuestionId", }); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_descriptor, + new java.lang.String[] { + "ProcessorVersion", "EvaluationDocuments", + }); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", + }); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_descriptor, + new java.lang.String[] { + "Evaluation", + }); + internal_static_google_cloud_documentai_v1_GetEvaluationRequest_descriptor = + getDescriptor().getMessageTypes().get(46); + internal_static_google_cloud_documentai_v1_GetEvaluationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_GetEvaluationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor = + getDescriptor().getMessageTypes().get(47); + internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor = + getDescriptor().getMessageTypes().get(48); + internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor, + new java.lang.String[] { + "Evaluations", "NextPageToken", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -832,10 +1043,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.documentai.v1.DocumentProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentIoProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentAiDocumentSchema.getDescriptor(); + com.google.cloud.documentai.v1.DocumentAiEvaluation.getDescriptor(); com.google.cloud.documentai.v1.OperationMetadataProto.getDescriptor(); com.google.cloud.documentai.v1.DocumentAiProcessor.getDescriptor(); com.google.cloud.documentai.v1.DocumentAiProcessorType.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java index 3685a22e69f5..1e95aafd1b31 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java @@ -189,7 +189,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "s.proto\032\027google/type/color.proto\032\026google" + "/type/date.proto\032\032google/type/datetime.p" + "roto\032\027google/type/money.proto\032 google/ty" - + "pe/postal_address.proto\"\263A\n\010Document\022\022\n\003" + + "pe/postal_address.proto\"\317A\n\010Document\022\022\n\003" + "uri\030\001 \001(\tB\003\340A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A\001H\000" + "\022\021\n\tmime_type\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A\001\022C" + "\n\013text_styles\030\005 \003(\0132*.google.cloud.docum" @@ -376,35 +376,35 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "nce\030\005 \001(\002B\003\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_" + "TYPE_UNSPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRA" + "PH\020\002\022\010\n\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEM" - + "ENT\020\005\022\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\214\003\n\nPro" - + "venance\022\020\n\010revision\030\001 \001(\005\022\016\n\002id\030\002 \001(\005B\002\030" - + "\001\022G\n\007parents\030\003 \003(\01326.google.cloud.docume" - + "ntai.v1.Document.Provenance.Parent\022K\n\004ty" - + "pe\030\004 \001(\0162=.google.cloud.documentai.v1.Do" - + "cument.Provenance.OperationType\0329\n\006Paren" - + "t\022\020\n\010revision\030\001 \001(\005\022\r\n\005index\030\003 \001(\005\022\016\n\002id" - + "\030\002 \001(\005B\002\030\001\"\212\001\n\rOperationType\022\036\n\032OPERATIO" - + "N_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020" - + "\002\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_REQUESTED\020\004\022\021\n\rEV" - + "AL_APPROVED\020\005\022\020\n\014EVAL_SKIPPED\020\006\032\245\002\n\010Revi" - + "sion\022\017\n\005agent\030\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\t" - + "H\000\022\n\n\002id\030\001 \001(\t\022\022\n\006parent\030\002 \003(\005B\002\030\001\022\022\n\npa" - + "rent_ids\030\007 \003(\t\022/\n\013create_time\030\003 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022O\n\014human_review\030" - + "\006 \001(\01329.google.cloud.documentai.v1.Docum" - + "ent.Revision.HumanReview\0323\n\013HumanReview\022" - + "\r\n\005state\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB\010\n" - + "\006source\032\261\001\n\nTextChange\022D\n\013text_anchor\030\001 " - + "\001(\0132/.google.cloud.documentai.v1.Documen" - + "t.TextAnchor\022\024\n\014changed_text\030\002 \001(\t\022G\n\npr" - + "ovenance\030\003 \003(\0132/.google.cloud.documentai" - + ".v1.Document.ProvenanceB\002\030\001B\010\n\006sourceB\313\001" - + "\n\036com.google.cloud.documentai.v1B\rDocume" - + "ntProtoP\001Z>cloud.google.com/go/documenta" - + "i/apiv1/documentaipb;documentaipb\252\002\032Goog" - + "le.Cloud.DocumentAI.V1\312\002\032Google\\Cloud\\Do" - + "cumentAI\\V1\352\002\035Google::Cloud::DocumentAI:" - + ":V1b\006proto3" + + "ENT\020\005\022\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\250\003\n\nPro" + + "venance\022\024\n\010revision\030\001 \001(\005B\002\030\001\022\016\n\002id\030\002 \001(" + + "\005B\002\030\001\022G\n\007parents\030\003 \003(\01326.google.cloud.do" + + "cumentai.v1.Document.Provenance.Parent\022K" + + "\n\004type\030\004 \001(\0162=.google.cloud.documentai.v" + + "1.Document.Provenance.OperationType\0329\n\006P" + + "arent\022\020\n\010revision\030\001 \001(\005\022\r\n\005index\030\003 \001(\005\022\016" + + "\n\002id\030\002 \001(\005B\002\030\001\"\242\001\n\rOperationType\022\036\n\032OPER" + + "ATION_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REM" + + "OVE\020\002\022\n\n\006UPDATE\020\007\022\013\n\007REPLACE\020\003\022\026\n\016EVAL_R" + + "EQUESTED\020\004\032\002\010\001\022\025\n\rEVAL_APPROVED\020\005\032\002\010\001\022\024\n" + + "\014EVAL_SKIPPED\020\006\032\002\010\001\032\245\002\n\010Revision\022\017\n\005agen" + + "t\030\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001" + + "(\t\022\022\n\006parent\030\002 \003(\005B\002\030\001\022\022\n\nparent_ids\030\007 \003" + + "(\t\022/\n\013create_time\030\003 \001(\0132\032.google.protobu" + + "f.Timestamp\022O\n\014human_review\030\006 \001(\01329.goog" + + "le.cloud.documentai.v1.Document.Revision" + + ".HumanReview\0323\n\013HumanReview\022\r\n\005state\030\001 \001" + + "(\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006source\032\261\001\n\n" + + "TextChange\022D\n\013text_anchor\030\001 \001(\0132/.google" + + ".cloud.documentai.v1.Document.TextAnchor" + + "\022\024\n\014changed_text\030\002 \001(\t\022G\n\nprovenance\030\003 \003" + + "(\0132/.google.cloud.documentai.v1.Document" + + ".ProvenanceB\002\030\001B\010\n\006sourceB\313\001\n\036com.google" + + ".cloud.documentai.v1B\rDocumentProtoP\001Z>c" + + "loud.google.com/go/documentai/apiv1/docu" + + "mentaipb;documentaipb\252\002\032Google.Cloud.Doc" + + "umentAI.V1\312\002\032Google\\Cloud\\DocumentAI\\V1\352" + + "\002\035Google::Cloud::DocumentAI::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java index e8393cf72e9d..ceebcc0a9f6a 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentSchema.java @@ -258,7 +258,7 @@ public interface EntityTypeOrBuilder * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -270,7 +270,7 @@ public interface EntityTypeOrBuilder * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -281,7 +281,7 @@ public interface EntityTypeOrBuilder * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -292,7 +292,7 @@ public interface EntityTypeOrBuilder * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -305,7 +305,7 @@ public interface EntityTypeOrBuilder * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -1301,9 +1301,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * Types of occurrences of the entity type in the document.  Note: this
-       * represents the number of instances of an entity types, not number of
-       * mentions of a given entity instance.
+       * Types of occurrences of the entity type in the document.  This
+       * represents the number of instances of instances of an entity, not
+       * number of mentions of an entity.  For example, a bank statement may
+       * only have one `account_number`, but this account number may be
+       * mentioned in several places on the document.  In this case the
+       * 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
+       * on the other hand, we expect a bank statement to contain the status of
+       * multiple different accounts for the customers, the occurrence type will
+       * be set to `REQUIRED_MULTIPLE`.
        * 
* * Protobuf enum {@code @@ -1324,7 +1330,8 @@ public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * There will be zero or one instance of this entity type.
+         * There will be zero or one instance of this entity type.  The same
+         * entity instance may be mentioned multiple times.
          * 
* * OPTIONAL_ONCE = 1; @@ -1344,7 +1351,8 @@ public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * The entity type will only appear exactly once.
+         * The entity type will only appear exactly once.  The same
+         * entity instance may be mentioned multiple times.
          * 
* * REQUIRED_ONCE = 3; @@ -1377,7 +1385,8 @@ public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * There will be zero or one instance of this entity type.
+         * There will be zero or one instance of this entity type.  The same
+         * entity instance may be mentioned multiple times.
          * 
* * OPTIONAL_ONCE = 1; @@ -1397,7 +1406,8 @@ public enum OccurrenceType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * The entity type will only appear exactly once.
+         * The entity type will only appear exactly once.  The same
+         * entity instance may be mentioned multiple times.
          * 
* * REQUIRED_ONCE = 3; @@ -2783,7 +2793,7 @@ public com.google.protobuf.ByteString getBaseTypesBytes(int index) { * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -2798,7 +2808,7 @@ public com.google.protobuf.ByteString getBaseTypesBytes(int index) { * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -2814,7 +2824,7 @@ public com.google.protobuf.ByteString getBaseTypesBytes(int index) { * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -2828,7 +2838,7 @@ public int getPropertiesCount() { * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -2843,7 +2853,7 @@ public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property getProp * * *
-     * Describing the nested structure, or composition of an entity.
+     * Description the nested structure, or composition of an entity.
      * 
* * repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; @@ -4155,7 +4165,7 @@ private void ensurePropertiesIsMutable() { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4174,7 +4184,7 @@ private void ensurePropertiesIsMutable() { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4192,7 +4202,7 @@ public int getPropertiesCount() { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4211,7 +4221,7 @@ public com.google.cloud.documentai.v1.DocumentSchema.EntityType.Property getProp * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4236,7 +4246,7 @@ public Builder setProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4260,7 +4270,7 @@ public Builder setProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4285,7 +4295,7 @@ public Builder addProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4310,7 +4320,7 @@ public Builder addProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4333,7 +4343,7 @@ public Builder addProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4357,7 +4367,7 @@ public Builder addProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4381,7 +4391,7 @@ public Builder addAllProperties( * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4402,7 +4412,7 @@ public Builder clearProperties() { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4423,7 +4433,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4438,7 +4448,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4457,7 +4467,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4477,7 +4487,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4495,7 +4505,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * @@ -4514,7 +4524,7 @@ public Builder removeProperties(int index) { * * *
-       * Describing the nested structure, or composition of an entity.
+       * Description the nested structure, or composition of an entity.
        * 
* * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadata.java new file mode 100644 index 000000000000..efdcdbbffbe9 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadata.java @@ -0,0 +1,726 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Metadata of the EvaluateProcessorVersion method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} + */ +public final class EvaluateProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) + EvaluateProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use EvaluateProcessorVersionMetadata.newBuilder() to construct. + private EvaluateProcessorVersionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EvaluateProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EvaluateProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.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.EvaluateProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) 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.EvaluateProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata of the EvaluateProcessorVersion method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.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_EvaluateProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.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.EvaluateProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EvaluateProcessorVersionMetadata 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.EvaluateProcessorVersionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadataOrBuilder.java new file mode 100644 index 000000000000..74777e83e494 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EvaluateProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) + 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/EvaluateProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionRequest.java new file mode 100644 index 000000000000..5e16acc0c64b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionRequest.java @@ -0,0 +1,983 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Evaluates the given ProcessorVersion against the supplied documents.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionRequest} + */ +public final class EvaluateProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EvaluateProcessorVersionRequest) + EvaluateProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use EvaluateProcessorVersionRequest.newBuilder() to construct. + private EvaluateProcessorVersionRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EvaluateProcessorVersionRequest() { + processorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EvaluateProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.Builder.class); + } + + public static final int PROCESSOR_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object processorVersion_ = ""; + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+   * evaluate.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processorVersion. + */ + @java.lang.Override + public java.lang.String getProcessorVersion() { + java.lang.Object ref = processorVersion_; + 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(); + processorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+   * evaluate.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProcessorVersionBytes() { + java.lang.Object ref = processorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVALUATION_DOCUMENTS_FIELD_NUMBER = 3; + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig evaluationDocuments_; + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the evaluationDocuments field is set. + */ + @java.lang.Override + public boolean hasEvaluationDocuments() { + return evaluationDocuments_ != null; + } + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The evaluationDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getEvaluationDocuments() { + return evaluationDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : evaluationDocuments_; + } + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getEvaluationDocumentsOrBuilder() { + return evaluationDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : evaluationDocuments_; + } + + 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(processorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, processorVersion_); + } + if (evaluationDocuments_ != null) { + output.writeMessage(3, getEvaluationDocuments()); + } + 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(processorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, processorVersion_); + } + if (evaluationDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEvaluationDocuments()); + } + 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.EvaluateProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest other = + (com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest) obj; + + if (!getProcessorVersion().equals(other.getProcessorVersion())) return false; + if (hasEvaluationDocuments() != other.hasEvaluationDocuments()) return false; + if (hasEvaluationDocuments()) { + if (!getEvaluationDocuments().equals(other.getEvaluationDocuments())) 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) + PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getProcessorVersion().hashCode(); + if (hasEvaluationDocuments()) { + hash = (37 * hash) + EVALUATION_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getEvaluationDocuments().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest 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; + } + /** + * + * + *
+   * Evaluates the given ProcessorVersion against the supplied documents.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EvaluateProcessorVersionRequest) + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + processorVersion_ = ""; + evaluationDocuments_ = null; + if (evaluationDocumentsBuilder_ != null) { + evaluationDocumentsBuilder_.dispose(); + evaluationDocumentsBuilder_ = 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_EvaluateProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest build() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest result = + new com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.processorVersion_ = processorVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.evaluationDocuments_ = + evaluationDocumentsBuilder_ == null + ? evaluationDocuments_ + : evaluationDocumentsBuilder_.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.EvaluateProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest other) { + if (other + == com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getProcessorVersion().isEmpty()) { + processorVersion_ = other.processorVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEvaluationDocuments()) { + mergeEvaluationDocuments(other.getEvaluationDocuments()); + } + 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: + { + processorVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage( + getEvaluationDocumentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 processorVersion_ = ""; + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+     * evaluate.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processorVersion. + */ + public java.lang.String getProcessorVersion() { + java.lang.Object ref = processorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + processorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+     * evaluate.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processorVersion. + */ + public com.google.protobuf.ByteString getProcessorVersionBytes() { + java.lang.Object ref = processorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+     * evaluate.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The processorVersion to set. + * @return This builder for chaining. + */ + public Builder setProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + processorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+     * evaluate.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProcessorVersion() { + processorVersion_ = getDefaultInstance().getProcessorVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+     * evaluate.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for processorVersion to set. + * @return This builder for chaining. + */ + public Builder setProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + processorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig evaluationDocuments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + evaluationDocumentsBuilder_; + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the evaluationDocuments field is set. + */ + public boolean hasEvaluationDocuments() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The evaluationDocuments. + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getEvaluationDocuments() { + if (evaluationDocumentsBuilder_ == null) { + return evaluationDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : evaluationDocuments_; + } else { + return evaluationDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEvaluationDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (evaluationDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + evaluationDocuments_ = value; + } else { + evaluationDocumentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEvaluationDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder builderForValue) { + if (evaluationDocumentsBuilder_ == null) { + evaluationDocuments_ = builderForValue.build(); + } else { + evaluationDocumentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEvaluationDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (evaluationDocumentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && evaluationDocuments_ != null + && evaluationDocuments_ + != com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance()) { + getEvaluationDocumentsBuilder().mergeFrom(value); + } else { + evaluationDocuments_ = value; + } + } else { + evaluationDocumentsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEvaluationDocuments() { + bitField0_ = (bitField0_ & ~0x00000002); + evaluationDocuments_ = null; + if (evaluationDocumentsBuilder_ != null) { + evaluationDocumentsBuilder_.dispose(); + evaluationDocumentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder + getEvaluationDocumentsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEvaluationDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getEvaluationDocumentsOrBuilder() { + if (evaluationDocumentsBuilder_ != null) { + return evaluationDocumentsBuilder_.getMessageOrBuilder(); + } else { + return evaluationDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : evaluationDocuments_; + } + } + /** + * + * + *
+     * Optional. The documents used in the evaluation. If unspecified, use the
+     * processor's dataset as evaluation input.
+     * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + getEvaluationDocumentsFieldBuilder() { + if (evaluationDocumentsBuilder_ == null) { + evaluationDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder>( + getEvaluationDocuments(), getParentForChildren(), isClean()); + evaluationDocuments_ = null; + } + return evaluationDocumentsBuilder_; + } + + @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.EvaluateProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EvaluateProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EvaluateProcessorVersionRequest 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.EvaluateProcessorVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionRequestOrBuilder.java new file mode 100644 index 000000000000..c19da06b0247 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EvaluateProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EvaluateProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+   * evaluate.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The processorVersion. + */ + java.lang.String getProcessorVersion(); + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
+   * evaluate.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for processorVersion. + */ + com.google.protobuf.ByteString getProcessorVersionBytes(); + + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the evaluationDocuments field is set. + */ + boolean hasEvaluationDocuments(); + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The evaluationDocuments. + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfig getEvaluationDocuments(); + /** + * + * + *
+   * Optional. The documents used in the evaluation. If unspecified, use the
+   * processor's dataset as evaluation input.
+   * 
+ * + * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getEvaluationDocumentsOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponse.java new file mode 100644 index 000000000000..80589867d17d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponse.java @@ -0,0 +1,638 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Metadata of the EvaluateProcessorVersion method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionResponse} + */ +public final class EvaluateProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EvaluateProcessorVersionResponse) + EvaluateProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use EvaluateProcessorVersionResponse.newBuilder() to construct. + private EvaluateProcessorVersionResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EvaluateProcessorVersionResponse() { + evaluation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EvaluateProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.Builder.class); + } + + public static final int EVALUATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object evaluation_ = ""; + /** + * + * + *
+   * The resource name of the created evaluation.
+   * 
+ * + * string evaluation = 2; + * + * @return The evaluation. + */ + @java.lang.Override + public java.lang.String getEvaluation() { + java.lang.Object ref = evaluation_; + 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(); + evaluation_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the created evaluation.
+   * 
+ * + * string evaluation = 2; + * + * @return The bytes for evaluation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvaluationBytes() { + java.lang.Object ref = evaluation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + evaluation_ = 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(evaluation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, evaluation_); + } + 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(evaluation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, evaluation_); + } + 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.EvaluateProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse other = + (com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse) obj; + + if (!getEvaluation().equals(other.getEvaluation())) 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) + EVALUATION_FIELD_NUMBER; + hash = (53 * hash) + getEvaluation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata of the EvaluateProcessorVersion method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluateProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EvaluateProcessorVersionResponse) + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_EvaluateProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.class, + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + evaluation_ = ""; + 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_EvaluateProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse build() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse result = + new com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.evaluation_ = evaluation_; + } + } + + @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.EvaluateProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse.getDefaultInstance()) + return this; + if (!other.getEvaluation().isEmpty()) { + evaluation_ = other.evaluation_; + 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 18: + { + evaluation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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 evaluation_ = ""; + /** + * + * + *
+     * The resource name of the created evaluation.
+     * 
+ * + * string evaluation = 2; + * + * @return The evaluation. + */ + public java.lang.String getEvaluation() { + java.lang.Object ref = evaluation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + evaluation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the created evaluation.
+     * 
+ * + * string evaluation = 2; + * + * @return The bytes for evaluation. + */ + public com.google.protobuf.ByteString getEvaluationBytes() { + java.lang.Object ref = evaluation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + evaluation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the created evaluation.
+     * 
+ * + * string evaluation = 2; + * + * @param value The evaluation to set. + * @return This builder for chaining. + */ + public Builder setEvaluation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + evaluation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the created evaluation.
+     * 
+ * + * string evaluation = 2; + * + * @return This builder for chaining. + */ + public Builder clearEvaluation() { + evaluation_ = getDefaultInstance().getEvaluation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the created evaluation.
+     * 
+ * + * string evaluation = 2; + * + * @param value The bytes for evaluation to set. + * @return This builder for chaining. + */ + public Builder setEvaluationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + evaluation_ = 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.EvaluateProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EvaluateProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EvaluateProcessorVersionResponse 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.EvaluateProcessorVersionResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponseOrBuilder.java new file mode 100644 index 000000000000..2f521fdb6fda --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluateProcessorVersionResponseOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface EvaluateProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EvaluateProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the created evaluation.
+   * 
+ * + * string evaluation = 2; + * + * @return The evaluation. + */ + java.lang.String getEvaluation(); + /** + * + * + *
+   * The resource name of the created evaluation.
+   * 
+ * + * string evaluation = 2; + * + * @return The bytes for evaluation. + */ + com.google.protobuf.ByteString getEvaluationBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Evaluation.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Evaluation.java new file mode 100644 index 000000000000..625322eeb63d --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Evaluation.java @@ -0,0 +1,8118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/evaluation.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * An evaluation of a ProcessorVersion's performance.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation} + */ +public final class Evaluation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Evaluation) + EvaluationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Evaluation.newBuilder() to construct. + private Evaluation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Evaluation() { + name_ = ""; + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Evaluation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEntityMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.class, + com.google.cloud.documentai.v1.Evaluation.Builder.class); + } + + public interface CountersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Evaluation.Counters) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * How many documents were sent for evaluation.
+     * 
+ * + * int32 input_documents_count = 1; + * + * @return The inputDocumentsCount. + */ + int getInputDocumentsCount(); + + /** + * + * + *
+     * How many documents were not included in the evaluation as they didn't
+     * pass validation.
+     * 
+ * + * int32 invalid_documents_count = 2; + * + * @return The invalidDocumentsCount. + */ + int getInvalidDocumentsCount(); + + /** + * + * + *
+     * How many documents were not included in the evaluation as Document AI
+     * failed to process them.
+     * 
+ * + * int32 failed_documents_count = 3; + * + * @return The failedDocumentsCount. + */ + int getFailedDocumentsCount(); + + /** + * + * + *
+     * How many documents were used in the evaluation.
+     * 
+ * + * int32 evaluated_documents_count = 4; + * + * @return The evaluatedDocumentsCount. + */ + int getEvaluatedDocumentsCount(); + } + /** + * + * + *
+   * Evaluation counters for the documents that were used.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.Counters} + */ + public static final class Counters extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Evaluation.Counters) + CountersOrBuilder { + private static final long serialVersionUID = 0L; + // Use Counters.newBuilder() to construct. + private Counters(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Counters() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Counters(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Counters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.Counters.class, + com.google.cloud.documentai.v1.Evaluation.Counters.Builder.class); + } + + public static final int INPUT_DOCUMENTS_COUNT_FIELD_NUMBER = 1; + private int inputDocumentsCount_ = 0; + /** + * + * + *
+     * How many documents were sent for evaluation.
+     * 
+ * + * int32 input_documents_count = 1; + * + * @return The inputDocumentsCount. + */ + @java.lang.Override + public int getInputDocumentsCount() { + return inputDocumentsCount_; + } + + public static final int INVALID_DOCUMENTS_COUNT_FIELD_NUMBER = 2; + private int invalidDocumentsCount_ = 0; + /** + * + * + *
+     * How many documents were not included in the evaluation as they didn't
+     * pass validation.
+     * 
+ * + * int32 invalid_documents_count = 2; + * + * @return The invalidDocumentsCount. + */ + @java.lang.Override + public int getInvalidDocumentsCount() { + return invalidDocumentsCount_; + } + + public static final int FAILED_DOCUMENTS_COUNT_FIELD_NUMBER = 3; + private int failedDocumentsCount_ = 0; + /** + * + * + *
+     * How many documents were not included in the evaluation as Document AI
+     * failed to process them.
+     * 
+ * + * int32 failed_documents_count = 3; + * + * @return The failedDocumentsCount. + */ + @java.lang.Override + public int getFailedDocumentsCount() { + return failedDocumentsCount_; + } + + public static final int EVALUATED_DOCUMENTS_COUNT_FIELD_NUMBER = 4; + private int evaluatedDocumentsCount_ = 0; + /** + * + * + *
+     * How many documents were used in the evaluation.
+     * 
+ * + * int32 evaluated_documents_count = 4; + * + * @return The evaluatedDocumentsCount. + */ + @java.lang.Override + public int getEvaluatedDocumentsCount() { + return evaluatedDocumentsCount_; + } + + 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 (inputDocumentsCount_ != 0) { + output.writeInt32(1, inputDocumentsCount_); + } + if (invalidDocumentsCount_ != 0) { + output.writeInt32(2, invalidDocumentsCount_); + } + if (failedDocumentsCount_ != 0) { + output.writeInt32(3, failedDocumentsCount_); + } + if (evaluatedDocumentsCount_ != 0) { + output.writeInt32(4, evaluatedDocumentsCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputDocumentsCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, inputDocumentsCount_); + } + if (invalidDocumentsCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, invalidDocumentsCount_); + } + if (failedDocumentsCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, failedDocumentsCount_); + } + if (evaluatedDocumentsCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, evaluatedDocumentsCount_); + } + 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.Evaluation.Counters)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Evaluation.Counters other = + (com.google.cloud.documentai.v1.Evaluation.Counters) obj; + + if (getInputDocumentsCount() != other.getInputDocumentsCount()) return false; + if (getInvalidDocumentsCount() != other.getInvalidDocumentsCount()) return false; + if (getFailedDocumentsCount() != other.getFailedDocumentsCount()) return false; + if (getEvaluatedDocumentsCount() != other.getEvaluatedDocumentsCount()) 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_DOCUMENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getInputDocumentsCount(); + hash = (37 * hash) + INVALID_DOCUMENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getInvalidDocumentsCount(); + hash = (37 * hash) + FAILED_DOCUMENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getFailedDocumentsCount(); + hash = (37 * hash) + EVALUATED_DOCUMENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getEvaluatedDocumentsCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters 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.Evaluation.Counters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters 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.Evaluation.Counters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters 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.Evaluation.Counters parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters 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.Evaluation.Counters parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters 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.Evaluation.Counters 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.Evaluation.Counters 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.Evaluation.Counters 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; + } + /** + * + * + *
+     * Evaluation counters for the documents that were used.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.Counters} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Evaluation.Counters) + com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Counters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.Counters.class, + com.google.cloud.documentai.v1.Evaluation.Counters.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Evaluation.Counters.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputDocumentsCount_ = 0; + invalidDocumentsCount_ = 0; + failedDocumentsCount_ = 0; + evaluatedDocumentsCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Counters_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Counters getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Counters build() { + com.google.cloud.documentai.v1.Evaluation.Counters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Counters buildPartial() { + com.google.cloud.documentai.v1.Evaluation.Counters result = + new com.google.cloud.documentai.v1.Evaluation.Counters(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Evaluation.Counters result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputDocumentsCount_ = inputDocumentsCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.invalidDocumentsCount_ = invalidDocumentsCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.failedDocumentsCount_ = failedDocumentsCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.evaluatedDocumentsCount_ = evaluatedDocumentsCount_; + } + } + + @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.Evaluation.Counters) { + return mergeFrom((com.google.cloud.documentai.v1.Evaluation.Counters) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Evaluation.Counters other) { + if (other == com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance()) + return this; + if (other.getInputDocumentsCount() != 0) { + setInputDocumentsCount(other.getInputDocumentsCount()); + } + if (other.getInvalidDocumentsCount() != 0) { + setInvalidDocumentsCount(other.getInvalidDocumentsCount()); + } + if (other.getFailedDocumentsCount() != 0) { + setFailedDocumentsCount(other.getFailedDocumentsCount()); + } + if (other.getEvaluatedDocumentsCount() != 0) { + setEvaluatedDocumentsCount(other.getEvaluatedDocumentsCount()); + } + 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: + { + inputDocumentsCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + invalidDocumentsCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + failedDocumentsCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + evaluatedDocumentsCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 inputDocumentsCount_; + /** + * + * + *
+       * How many documents were sent for evaluation.
+       * 
+ * + * int32 input_documents_count = 1; + * + * @return The inputDocumentsCount. + */ + @java.lang.Override + public int getInputDocumentsCount() { + return inputDocumentsCount_; + } + /** + * + * + *
+       * How many documents were sent for evaluation.
+       * 
+ * + * int32 input_documents_count = 1; + * + * @param value The inputDocumentsCount to set. + * @return This builder for chaining. + */ + public Builder setInputDocumentsCount(int value) { + + inputDocumentsCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * How many documents were sent for evaluation.
+       * 
+ * + * int32 input_documents_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearInputDocumentsCount() { + bitField0_ = (bitField0_ & ~0x00000001); + inputDocumentsCount_ = 0; + onChanged(); + return this; + } + + private int invalidDocumentsCount_; + /** + * + * + *
+       * How many documents were not included in the evaluation as they didn't
+       * pass validation.
+       * 
+ * + * int32 invalid_documents_count = 2; + * + * @return The invalidDocumentsCount. + */ + @java.lang.Override + public int getInvalidDocumentsCount() { + return invalidDocumentsCount_; + } + /** + * + * + *
+       * How many documents were not included in the evaluation as they didn't
+       * pass validation.
+       * 
+ * + * int32 invalid_documents_count = 2; + * + * @param value The invalidDocumentsCount to set. + * @return This builder for chaining. + */ + public Builder setInvalidDocumentsCount(int value) { + + invalidDocumentsCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * How many documents were not included in the evaluation as they didn't
+       * pass validation.
+       * 
+ * + * int32 invalid_documents_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearInvalidDocumentsCount() { + bitField0_ = (bitField0_ & ~0x00000002); + invalidDocumentsCount_ = 0; + onChanged(); + return this; + } + + private int failedDocumentsCount_; + /** + * + * + *
+       * How many documents were not included in the evaluation as Document AI
+       * failed to process them.
+       * 
+ * + * int32 failed_documents_count = 3; + * + * @return The failedDocumentsCount. + */ + @java.lang.Override + public int getFailedDocumentsCount() { + return failedDocumentsCount_; + } + /** + * + * + *
+       * How many documents were not included in the evaluation as Document AI
+       * failed to process them.
+       * 
+ * + * int32 failed_documents_count = 3; + * + * @param value The failedDocumentsCount to set. + * @return This builder for chaining. + */ + public Builder setFailedDocumentsCount(int value) { + + failedDocumentsCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * How many documents were not included in the evaluation as Document AI
+       * failed to process them.
+       * 
+ * + * int32 failed_documents_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailedDocumentsCount() { + bitField0_ = (bitField0_ & ~0x00000004); + failedDocumentsCount_ = 0; + onChanged(); + return this; + } + + private int evaluatedDocumentsCount_; + /** + * + * + *
+       * How many documents were used in the evaluation.
+       * 
+ * + * int32 evaluated_documents_count = 4; + * + * @return The evaluatedDocumentsCount. + */ + @java.lang.Override + public int getEvaluatedDocumentsCount() { + return evaluatedDocumentsCount_; + } + /** + * + * + *
+       * How many documents were used in the evaluation.
+       * 
+ * + * int32 evaluated_documents_count = 4; + * + * @param value The evaluatedDocumentsCount to set. + * @return This builder for chaining. + */ + public Builder setEvaluatedDocumentsCount(int value) { + + evaluatedDocumentsCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * How many documents were used in the evaluation.
+       * 
+ * + * int32 evaluated_documents_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearEvaluatedDocumentsCount() { + bitField0_ = (bitField0_ & ~0x00000008); + evaluatedDocumentsCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Evaluation.Counters) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Evaluation.Counters) + private static final com.google.cloud.documentai.v1.Evaluation.Counters DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Evaluation.Counters(); + } + + public static com.google.cloud.documentai.v1.Evaluation.Counters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Counters 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.Evaluation.Counters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Evaluation.Metrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The calculated precision.
+     * 
+ * + * float precision = 1; + * + * @return The precision. + */ + float getPrecision(); + + /** + * + * + *
+     * The calculated recall.
+     * 
+ * + * float recall = 2; + * + * @return The recall. + */ + float getRecall(); + + /** + * + * + *
+     * The calculated f1 score.
+     * 
+ * + * float f1_score = 3; + * + * @return The f1Score. + */ + float getF1Score(); + + /** + * + * + *
+     * The amount of occurrences in predicted documents.
+     * 
+ * + * int32 predicted_occurrences_count = 4; + * + * @return The predictedOccurrencesCount. + */ + int getPredictedOccurrencesCount(); + + /** + * + * + *
+     * The amount of occurrences in ground truth documents.
+     * 
+ * + * int32 ground_truth_occurrences_count = 5; + * + * @return The groundTruthOccurrencesCount. + */ + int getGroundTruthOccurrencesCount(); + + /** + * + * + *
+     * The amount of documents with a predicted occurrence.
+     * 
+ * + * int32 predicted_document_count = 10; + * + * @return The predictedDocumentCount. + */ + int getPredictedDocumentCount(); + + /** + * + * + *
+     * The amount of documents with a ground truth occurrence.
+     * 
+ * + * int32 ground_truth_document_count = 11; + * + * @return The groundTruthDocumentCount. + */ + int getGroundTruthDocumentCount(); + + /** + * + * + *
+     * The amount of true positives.
+     * 
+ * + * int32 true_positives_count = 6; + * + * @return The truePositivesCount. + */ + int getTruePositivesCount(); + + /** + * + * + *
+     * The amount of false positives.
+     * 
+ * + * int32 false_positives_count = 7; + * + * @return The falsePositivesCount. + */ + int getFalsePositivesCount(); + + /** + * + * + *
+     * The amount of false negatives.
+     * 
+ * + * int32 false_negatives_count = 8; + * + * @return The falseNegativesCount. + */ + int getFalseNegativesCount(); + + /** + * + * + *
+     * The amount of documents that had an occurrence of this label.
+     * 
+ * + * int32 total_documents_count = 9; + * + * @return The totalDocumentsCount. + */ + int getTotalDocumentsCount(); + } + /** + * + * + *
+   * Evaluation metrics, either in aggregate or about a specific entity.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.Metrics} + */ + public static final class Metrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Evaluation.Metrics) + MetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metrics.newBuilder() to construct. + private Metrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.Metrics.class, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder.class); + } + + public static final int PRECISION_FIELD_NUMBER = 1; + private float precision_ = 0F; + /** + * + * + *
+     * The calculated precision.
+     * 
+ * + * float precision = 1; + * + * @return The precision. + */ + @java.lang.Override + public float getPrecision() { + return precision_; + } + + public static final int RECALL_FIELD_NUMBER = 2; + private float recall_ = 0F; + /** + * + * + *
+     * The calculated recall.
+     * 
+ * + * float recall = 2; + * + * @return The recall. + */ + @java.lang.Override + public float getRecall() { + return recall_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 3; + private float f1Score_ = 0F; + /** + * + * + *
+     * The calculated f1 score.
+     * 
+ * + * float f1_score = 3; + * + * @return The f1Score. + */ + @java.lang.Override + public float getF1Score() { + return f1Score_; + } + + public static final int PREDICTED_OCCURRENCES_COUNT_FIELD_NUMBER = 4; + private int predictedOccurrencesCount_ = 0; + /** + * + * + *
+     * The amount of occurrences in predicted documents.
+     * 
+ * + * int32 predicted_occurrences_count = 4; + * + * @return The predictedOccurrencesCount. + */ + @java.lang.Override + public int getPredictedOccurrencesCount() { + return predictedOccurrencesCount_; + } + + public static final int GROUND_TRUTH_OCCURRENCES_COUNT_FIELD_NUMBER = 5; + private int groundTruthOccurrencesCount_ = 0; + /** + * + * + *
+     * The amount of occurrences in ground truth documents.
+     * 
+ * + * int32 ground_truth_occurrences_count = 5; + * + * @return The groundTruthOccurrencesCount. + */ + @java.lang.Override + public int getGroundTruthOccurrencesCount() { + return groundTruthOccurrencesCount_; + } + + public static final int PREDICTED_DOCUMENT_COUNT_FIELD_NUMBER = 10; + private int predictedDocumentCount_ = 0; + /** + * + * + *
+     * The amount of documents with a predicted occurrence.
+     * 
+ * + * int32 predicted_document_count = 10; + * + * @return The predictedDocumentCount. + */ + @java.lang.Override + public int getPredictedDocumentCount() { + return predictedDocumentCount_; + } + + public static final int GROUND_TRUTH_DOCUMENT_COUNT_FIELD_NUMBER = 11; + private int groundTruthDocumentCount_ = 0; + /** + * + * + *
+     * The amount of documents with a ground truth occurrence.
+     * 
+ * + * int32 ground_truth_document_count = 11; + * + * @return The groundTruthDocumentCount. + */ + @java.lang.Override + public int getGroundTruthDocumentCount() { + return groundTruthDocumentCount_; + } + + public static final int TRUE_POSITIVES_COUNT_FIELD_NUMBER = 6; + private int truePositivesCount_ = 0; + /** + * + * + *
+     * The amount of true positives.
+     * 
+ * + * int32 true_positives_count = 6; + * + * @return The truePositivesCount. + */ + @java.lang.Override + public int getTruePositivesCount() { + return truePositivesCount_; + } + + public static final int FALSE_POSITIVES_COUNT_FIELD_NUMBER = 7; + private int falsePositivesCount_ = 0; + /** + * + * + *
+     * The amount of false positives.
+     * 
+ * + * int32 false_positives_count = 7; + * + * @return The falsePositivesCount. + */ + @java.lang.Override + public int getFalsePositivesCount() { + return falsePositivesCount_; + } + + public static final int FALSE_NEGATIVES_COUNT_FIELD_NUMBER = 8; + private int falseNegativesCount_ = 0; + /** + * + * + *
+     * The amount of false negatives.
+     * 
+ * + * int32 false_negatives_count = 8; + * + * @return The falseNegativesCount. + */ + @java.lang.Override + public int getFalseNegativesCount() { + return falseNegativesCount_; + } + + public static final int TOTAL_DOCUMENTS_COUNT_FIELD_NUMBER = 9; + private int totalDocumentsCount_ = 0; + /** + * + * + *
+     * The amount of documents that had an occurrence of this label.
+     * 
+ * + * int32 total_documents_count = 9; + * + * @return The totalDocumentsCount. + */ + @java.lang.Override + public int getTotalDocumentsCount() { + return totalDocumentsCount_; + } + + 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(precision_) != 0) { + output.writeFloat(1, precision_); + } + if (java.lang.Float.floatToRawIntBits(recall_) != 0) { + output.writeFloat(2, recall_); + } + if (java.lang.Float.floatToRawIntBits(f1Score_) != 0) { + output.writeFloat(3, f1Score_); + } + if (predictedOccurrencesCount_ != 0) { + output.writeInt32(4, predictedOccurrencesCount_); + } + if (groundTruthOccurrencesCount_ != 0) { + output.writeInt32(5, groundTruthOccurrencesCount_); + } + if (truePositivesCount_ != 0) { + output.writeInt32(6, truePositivesCount_); + } + if (falsePositivesCount_ != 0) { + output.writeInt32(7, falsePositivesCount_); + } + if (falseNegativesCount_ != 0) { + output.writeInt32(8, falseNegativesCount_); + } + if (totalDocumentsCount_ != 0) { + output.writeInt32(9, totalDocumentsCount_); + } + if (predictedDocumentCount_ != 0) { + output.writeInt32(10, predictedDocumentCount_); + } + if (groundTruthDocumentCount_ != 0) { + output.writeInt32(11, groundTruthDocumentCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(precision_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, precision_); + } + if (java.lang.Float.floatToRawIntBits(recall_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_); + } + if (java.lang.Float.floatToRawIntBits(f1Score_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, f1Score_); + } + if (predictedOccurrencesCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(4, predictedOccurrencesCount_); + } + if (groundTruthOccurrencesCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(5, groundTruthOccurrencesCount_); + } + if (truePositivesCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, truePositivesCount_); + } + if (falsePositivesCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, falsePositivesCount_); + } + if (falseNegativesCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, falseNegativesCount_); + } + if (totalDocumentsCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, totalDocumentsCount_); + } + if (predictedDocumentCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(10, predictedDocumentCount_); + } + if (groundTruthDocumentCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(11, groundTruthDocumentCount_); + } + 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.Evaluation.Metrics)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Evaluation.Metrics other = + (com.google.cloud.documentai.v1.Evaluation.Metrics) obj; + + if (java.lang.Float.floatToIntBits(getPrecision()) + != java.lang.Float.floatToIntBits(other.getPrecision())) return false; + if (java.lang.Float.floatToIntBits(getRecall()) + != java.lang.Float.floatToIntBits(other.getRecall())) return false; + if (java.lang.Float.floatToIntBits(getF1Score()) + != java.lang.Float.floatToIntBits(other.getF1Score())) return false; + if (getPredictedOccurrencesCount() != other.getPredictedOccurrencesCount()) return false; + if (getGroundTruthOccurrencesCount() != other.getGroundTruthOccurrencesCount()) return false; + if (getPredictedDocumentCount() != other.getPredictedDocumentCount()) return false; + if (getGroundTruthDocumentCount() != other.getGroundTruthDocumentCount()) return false; + if (getTruePositivesCount() != other.getTruePositivesCount()) return false; + if (getFalsePositivesCount() != other.getFalsePositivesCount()) return false; + if (getFalseNegativesCount() != other.getFalseNegativesCount()) return false; + if (getTotalDocumentsCount() != other.getTotalDocumentsCount()) 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) + PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision()); + hash = (37 * hash) + RECALL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall()); + hash = (37 * hash) + F1_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score()); + hash = (37 * hash) + PREDICTED_OCCURRENCES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPredictedOccurrencesCount(); + hash = (37 * hash) + GROUND_TRUTH_OCCURRENCES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getGroundTruthOccurrencesCount(); + hash = (37 * hash) + PREDICTED_DOCUMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPredictedDocumentCount(); + hash = (37 * hash) + GROUND_TRUTH_DOCUMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getGroundTruthDocumentCount(); + hash = (37 * hash) + TRUE_POSITIVES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTruePositivesCount(); + hash = (37 * hash) + FALSE_POSITIVES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getFalsePositivesCount(); + hash = (37 * hash) + FALSE_NEGATIVES_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getFalseNegativesCount(); + hash = (37 * hash) + TOTAL_DOCUMENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTotalDocumentsCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics 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.Evaluation.Metrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics 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.Evaluation.Metrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics 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.Evaluation.Metrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics 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.Evaluation.Metrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics 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.Evaluation.Metrics 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.Evaluation.Metrics 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.Evaluation.Metrics 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; + } + /** + * + * + *
+     * Evaluation metrics, either in aggregate or about a specific entity.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.Metrics} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Evaluation.Metrics) + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.Metrics.class, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Evaluation.Metrics.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + precision_ = 0F; + recall_ = 0F; + f1Score_ = 0F; + predictedOccurrencesCount_ = 0; + groundTruthOccurrencesCount_ = 0; + predictedDocumentCount_ = 0; + groundTruthDocumentCount_ = 0; + truePositivesCount_ = 0; + falsePositivesCount_ = 0; + falseNegativesCount_ = 0; + totalDocumentsCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_Metrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics build() { + com.google.cloud.documentai.v1.Evaluation.Metrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics buildPartial() { + com.google.cloud.documentai.v1.Evaluation.Metrics result = + new com.google.cloud.documentai.v1.Evaluation.Metrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Evaluation.Metrics result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.precision_ = precision_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recall_ = recall_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.f1Score_ = f1Score_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.predictedOccurrencesCount_ = predictedOccurrencesCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.groundTruthOccurrencesCount_ = groundTruthOccurrencesCount_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.predictedDocumentCount_ = predictedDocumentCount_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.groundTruthDocumentCount_ = groundTruthDocumentCount_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.truePositivesCount_ = truePositivesCount_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.falsePositivesCount_ = falsePositivesCount_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.falseNegativesCount_ = falseNegativesCount_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.totalDocumentsCount_ = totalDocumentsCount_; + } + } + + @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.Evaluation.Metrics) { + return mergeFrom((com.google.cloud.documentai.v1.Evaluation.Metrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Evaluation.Metrics other) { + if (other == com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance()) + return this; + if (other.getPrecision() != 0F) { + setPrecision(other.getPrecision()); + } + if (other.getRecall() != 0F) { + setRecall(other.getRecall()); + } + if (other.getF1Score() != 0F) { + setF1Score(other.getF1Score()); + } + if (other.getPredictedOccurrencesCount() != 0) { + setPredictedOccurrencesCount(other.getPredictedOccurrencesCount()); + } + if (other.getGroundTruthOccurrencesCount() != 0) { + setGroundTruthOccurrencesCount(other.getGroundTruthOccurrencesCount()); + } + if (other.getPredictedDocumentCount() != 0) { + setPredictedDocumentCount(other.getPredictedDocumentCount()); + } + if (other.getGroundTruthDocumentCount() != 0) { + setGroundTruthDocumentCount(other.getGroundTruthDocumentCount()); + } + if (other.getTruePositivesCount() != 0) { + setTruePositivesCount(other.getTruePositivesCount()); + } + if (other.getFalsePositivesCount() != 0) { + setFalsePositivesCount(other.getFalsePositivesCount()); + } + if (other.getFalseNegativesCount() != 0) { + setFalseNegativesCount(other.getFalseNegativesCount()); + } + if (other.getTotalDocumentsCount() != 0) { + setTotalDocumentsCount(other.getTotalDocumentsCount()); + } + 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: + { + precision_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: + { + recall_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: + { + f1Score_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 32: + { + predictedOccurrencesCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + groundTruthOccurrencesCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + truePositivesCount_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 56: + { + falsePositivesCount_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 56 + case 64: + { + falseNegativesCount_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 64 + case 72: + { + totalDocumentsCount_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 72 + case 80: + { + predictedDocumentCount_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 80 + case 88: + { + groundTruthDocumentCount_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 88 + 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 precision_; + /** + * + * + *
+       * The calculated precision.
+       * 
+ * + * float precision = 1; + * + * @return The precision. + */ + @java.lang.Override + public float getPrecision() { + return precision_; + } + /** + * + * + *
+       * The calculated precision.
+       * 
+ * + * float precision = 1; + * + * @param value The precision to set. + * @return This builder for chaining. + */ + public Builder setPrecision(float value) { + + precision_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The calculated precision.
+       * 
+ * + * float precision = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrecision() { + bitField0_ = (bitField0_ & ~0x00000001); + precision_ = 0F; + onChanged(); + return this; + } + + private float recall_; + /** + * + * + *
+       * The calculated recall.
+       * 
+ * + * float recall = 2; + * + * @return The recall. + */ + @java.lang.Override + public float getRecall() { + return recall_; + } + /** + * + * + *
+       * The calculated recall.
+       * 
+ * + * float recall = 2; + * + * @param value The recall to set. + * @return This builder for chaining. + */ + public Builder setRecall(float value) { + + recall_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The calculated recall.
+       * 
+ * + * float recall = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecall() { + bitField0_ = (bitField0_ & ~0x00000002); + recall_ = 0F; + onChanged(); + return this; + } + + private float f1Score_; + /** + * + * + *
+       * The calculated f1 score.
+       * 
+ * + * float f1_score = 3; + * + * @return The f1Score. + */ + @java.lang.Override + public float getF1Score() { + return f1Score_; + } + /** + * + * + *
+       * The calculated f1 score.
+       * 
+ * + * float f1_score = 3; + * + * @param value The f1Score to set. + * @return This builder for chaining. + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The calculated f1 score.
+       * 
+ * + * float f1_score = 3; + * + * @return This builder for chaining. + */ + public Builder clearF1Score() { + bitField0_ = (bitField0_ & ~0x00000004); + f1Score_ = 0F; + onChanged(); + return this; + } + + private int predictedOccurrencesCount_; + /** + * + * + *
+       * The amount of occurrences in predicted documents.
+       * 
+ * + * int32 predicted_occurrences_count = 4; + * + * @return The predictedOccurrencesCount. + */ + @java.lang.Override + public int getPredictedOccurrencesCount() { + return predictedOccurrencesCount_; + } + /** + * + * + *
+       * The amount of occurrences in predicted documents.
+       * 
+ * + * int32 predicted_occurrences_count = 4; + * + * @param value The predictedOccurrencesCount to set. + * @return This builder for chaining. + */ + public Builder setPredictedOccurrencesCount(int value) { + + predictedOccurrencesCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of occurrences in predicted documents.
+       * 
+ * + * int32 predicted_occurrences_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearPredictedOccurrencesCount() { + bitField0_ = (bitField0_ & ~0x00000008); + predictedOccurrencesCount_ = 0; + onChanged(); + return this; + } + + private int groundTruthOccurrencesCount_; + /** + * + * + *
+       * The amount of occurrences in ground truth documents.
+       * 
+ * + * int32 ground_truth_occurrences_count = 5; + * + * @return The groundTruthOccurrencesCount. + */ + @java.lang.Override + public int getGroundTruthOccurrencesCount() { + return groundTruthOccurrencesCount_; + } + /** + * + * + *
+       * The amount of occurrences in ground truth documents.
+       * 
+ * + * int32 ground_truth_occurrences_count = 5; + * + * @param value The groundTruthOccurrencesCount to set. + * @return This builder for chaining. + */ + public Builder setGroundTruthOccurrencesCount(int value) { + + groundTruthOccurrencesCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of occurrences in ground truth documents.
+       * 
+ * + * int32 ground_truth_occurrences_count = 5; + * + * @return This builder for chaining. + */ + public Builder clearGroundTruthOccurrencesCount() { + bitField0_ = (bitField0_ & ~0x00000010); + groundTruthOccurrencesCount_ = 0; + onChanged(); + return this; + } + + private int predictedDocumentCount_; + /** + * + * + *
+       * The amount of documents with a predicted occurrence.
+       * 
+ * + * int32 predicted_document_count = 10; + * + * @return The predictedDocumentCount. + */ + @java.lang.Override + public int getPredictedDocumentCount() { + return predictedDocumentCount_; + } + /** + * + * + *
+       * The amount of documents with a predicted occurrence.
+       * 
+ * + * int32 predicted_document_count = 10; + * + * @param value The predictedDocumentCount to set. + * @return This builder for chaining. + */ + public Builder setPredictedDocumentCount(int value) { + + predictedDocumentCount_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of documents with a predicted occurrence.
+       * 
+ * + * int32 predicted_document_count = 10; + * + * @return This builder for chaining. + */ + public Builder clearPredictedDocumentCount() { + bitField0_ = (bitField0_ & ~0x00000020); + predictedDocumentCount_ = 0; + onChanged(); + return this; + } + + private int groundTruthDocumentCount_; + /** + * + * + *
+       * The amount of documents with a ground truth occurrence.
+       * 
+ * + * int32 ground_truth_document_count = 11; + * + * @return The groundTruthDocumentCount. + */ + @java.lang.Override + public int getGroundTruthDocumentCount() { + return groundTruthDocumentCount_; + } + /** + * + * + *
+       * The amount of documents with a ground truth occurrence.
+       * 
+ * + * int32 ground_truth_document_count = 11; + * + * @param value The groundTruthDocumentCount to set. + * @return This builder for chaining. + */ + public Builder setGroundTruthDocumentCount(int value) { + + groundTruthDocumentCount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of documents with a ground truth occurrence.
+       * 
+ * + * int32 ground_truth_document_count = 11; + * + * @return This builder for chaining. + */ + public Builder clearGroundTruthDocumentCount() { + bitField0_ = (bitField0_ & ~0x00000040); + groundTruthDocumentCount_ = 0; + onChanged(); + return this; + } + + private int truePositivesCount_; + /** + * + * + *
+       * The amount of true positives.
+       * 
+ * + * int32 true_positives_count = 6; + * + * @return The truePositivesCount. + */ + @java.lang.Override + public int getTruePositivesCount() { + return truePositivesCount_; + } + /** + * + * + *
+       * The amount of true positives.
+       * 
+ * + * int32 true_positives_count = 6; + * + * @param value The truePositivesCount to set. + * @return This builder for chaining. + */ + public Builder setTruePositivesCount(int value) { + + truePositivesCount_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of true positives.
+       * 
+ * + * int32 true_positives_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearTruePositivesCount() { + bitField0_ = (bitField0_ & ~0x00000080); + truePositivesCount_ = 0; + onChanged(); + return this; + } + + private int falsePositivesCount_; + /** + * + * + *
+       * The amount of false positives.
+       * 
+ * + * int32 false_positives_count = 7; + * + * @return The falsePositivesCount. + */ + @java.lang.Override + public int getFalsePositivesCount() { + return falsePositivesCount_; + } + /** + * + * + *
+       * The amount of false positives.
+       * 
+ * + * int32 false_positives_count = 7; + * + * @param value The falsePositivesCount to set. + * @return This builder for chaining. + */ + public Builder setFalsePositivesCount(int value) { + + falsePositivesCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of false positives.
+       * 
+ * + * int32 false_positives_count = 7; + * + * @return This builder for chaining. + */ + public Builder clearFalsePositivesCount() { + bitField0_ = (bitField0_ & ~0x00000100); + falsePositivesCount_ = 0; + onChanged(); + return this; + } + + private int falseNegativesCount_; + /** + * + * + *
+       * The amount of false negatives.
+       * 
+ * + * int32 false_negatives_count = 8; + * + * @return The falseNegativesCount. + */ + @java.lang.Override + public int getFalseNegativesCount() { + return falseNegativesCount_; + } + /** + * + * + *
+       * The amount of false negatives.
+       * 
+ * + * int32 false_negatives_count = 8; + * + * @param value The falseNegativesCount to set. + * @return This builder for chaining. + */ + public Builder setFalseNegativesCount(int value) { + + falseNegativesCount_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of false negatives.
+       * 
+ * + * int32 false_negatives_count = 8; + * + * @return This builder for chaining. + */ + public Builder clearFalseNegativesCount() { + bitField0_ = (bitField0_ & ~0x00000200); + falseNegativesCount_ = 0; + onChanged(); + return this; + } + + private int totalDocumentsCount_; + /** + * + * + *
+       * The amount of documents that had an occurrence of this label.
+       * 
+ * + * int32 total_documents_count = 9; + * + * @return The totalDocumentsCount. + */ + @java.lang.Override + public int getTotalDocumentsCount() { + return totalDocumentsCount_; + } + /** + * + * + *
+       * The amount of documents that had an occurrence of this label.
+       * 
+ * + * int32 total_documents_count = 9; + * + * @param value The totalDocumentsCount to set. + * @return This builder for chaining. + */ + public Builder setTotalDocumentsCount(int value) { + + totalDocumentsCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of documents that had an occurrence of this label.
+       * 
+ * + * int32 total_documents_count = 9; + * + * @return This builder for chaining. + */ + public Builder clearTotalDocumentsCount() { + bitField0_ = (bitField0_ & ~0x00000400); + totalDocumentsCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Evaluation.Metrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Evaluation.Metrics) + private static final com.google.cloud.documentai.v1.Evaluation.Metrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Evaluation.Metrics(); + } + + public static com.google.cloud.documentai.v1.Evaluation.Metrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metrics 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.Evaluation.Metrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConfidenceLevelMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The confidence level.
+     * 
+ * + * float confidence_level = 1; + * + * @return The confidenceLevel. + */ + float getConfidenceLevel(); + + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return Whether the metrics field is set. + */ + boolean hasMetrics(); + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return The metrics. + */ + com.google.cloud.documentai.v1.Evaluation.Metrics getMetrics(); + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getMetricsOrBuilder(); + } + /** + * + * + *
+   * Evaluations metrics, at a specific confidence level.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} + */ + public static final class ConfidenceLevelMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) + ConfidenceLevelMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidenceLevelMetrics.newBuilder() to construct. + private ConfidenceLevelMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfidenceLevelMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConfidenceLevelMetrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.class, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder.class); + } + + public static final int CONFIDENCE_LEVEL_FIELD_NUMBER = 1; + private float confidenceLevel_ = 0F; + /** + * + * + *
+     * The confidence level.
+     * 
+ * + * float confidence_level = 1; + * + * @return The confidenceLevel. + */ + @java.lang.Override + public float getConfidenceLevel() { + return confidenceLevel_; + } + + public static final int METRICS_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.Evaluation.Metrics metrics_; + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return Whether the metrics field is set. + */ + @java.lang.Override + public boolean hasMetrics() { + return metrics_ != null; + } + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return The metrics. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics getMetrics() { + return metrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : metrics_; + } + /** + * + * + *
+     * The metrics at the specific confidence level.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getMetricsOrBuilder() { + return metrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : metrics_; + } + + 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(confidenceLevel_) != 0) { + output.writeFloat(1, confidenceLevel_); + } + if (metrics_ != null) { + output.writeMessage(2, getMetrics()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(confidenceLevel_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceLevel_); + } + if (metrics_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetrics()); + } + 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.Evaluation.ConfidenceLevelMetrics)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics other = + (com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) obj; + + if (java.lang.Float.floatToIntBits(getConfidenceLevel()) + != java.lang.Float.floatToIntBits(other.getConfidenceLevel())) return false; + if (hasMetrics() != other.hasMetrics()) return false; + if (hasMetrics()) { + if (!getMetrics().equals(other.getMetrics())) 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) + CONFIDENCE_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceLevel()); + if (hasMetrics()) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetrics().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + 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.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics 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; + } + /** + * + * + *
+     * Evaluations metrics, at a specific confidence level.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.class, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + confidenceLevel_ = 0F; + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_ConfidenceLevelMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics build() { + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics buildPartial() { + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics result = + new com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.confidenceLevel_ = confidenceLevel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metrics_ = metricsBuilder_ == null ? metrics_ : metricsBuilder_.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.Evaluation.ConfidenceLevelMetrics) { + return mergeFrom( + (com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics other) { + if (other + == com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance()) return this; + if (other.getConfidenceLevel() != 0F) { + setConfidenceLevel(other.getConfidenceLevel()); + } + if (other.hasMetrics()) { + mergeMetrics(other.getMetrics()); + } + 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: + { + confidenceLevel_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + input.readMessage(getMetricsFieldBuilder().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 float confidenceLevel_; + /** + * + * + *
+       * The confidence level.
+       * 
+ * + * float confidence_level = 1; + * + * @return The confidenceLevel. + */ + @java.lang.Override + public float getConfidenceLevel() { + return confidenceLevel_; + } + /** + * + * + *
+       * The confidence level.
+       * 
+ * + * float confidence_level = 1; + * + * @param value The confidenceLevel to set. + * @return This builder for chaining. + */ + public Builder setConfidenceLevel(float value) { + + confidenceLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The confidence level.
+       * 
+ * + * float confidence_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearConfidenceLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + confidenceLevel_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.Evaluation.Metrics metrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + metricsBuilder_; + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return Whether the metrics field is set. + */ + public boolean hasMetrics() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * + * @return The metrics. + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics getMetrics() { + if (metricsBuilder_ == null) { + return metrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : metrics_; + } else { + return metricsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public Builder setMetrics(com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + } else { + metricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public Builder setMetrics( + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder builderForValue) { + if (metricsBuilder_ == null) { + metrics_ = builderForValue.build(); + } else { + metricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public Builder mergeMetrics(com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metrics_ != null + && metrics_ + != com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance()) { + getMetricsBuilder().mergeFrom(value); + } else { + metrics_ = value; + } + } else { + metricsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public Builder clearMetrics() { + bitField0_ = (bitField0_ & ~0x00000002); + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics.Builder getMetricsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getMetricsOrBuilder() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilder(); + } else { + return metrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : metrics_; + } + } + /** + * + * + *
+       * The metrics at the specific confidence level.
+       * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder>( + getMetrics(), getParentForChildren(), isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + @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.Evaluation.ConfidenceLevelMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) + private static final com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics(); + } + + public static com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfidenceLevelMetrics 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.Evaluation.ConfidenceLevelMetrics + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MultiConfidenceMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + java.util.List + getConfidenceLevelMetricsList(); + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics getConfidenceLevelMetrics( + int index); + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + int getConfidenceLevelMetricsCount(); + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsOrBuilderList(); + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsOrBuilder(int index); + + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + java.util.List + getConfidenceLevelMetricsExactList(); + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics getConfidenceLevelMetricsExact( + int index); + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + int getConfidenceLevelMetricsExactCount(); + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsExactOrBuilderList(); + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsExactOrBuilder(int index); + + /** + * + * + *
+     * The calculated area under the precision recall curve (AUPRC), computed by
+     * integrating over all confidence thresholds.
+     * 
+ * + * float auprc = 2; + * + * @return The auprc. + */ + float getAuprc(); + + /** + * + * + *
+     * The Estimated Calibration Error (ECE) of the confidence of the predicted
+     * entities.
+     * 
+ * + * float estimated_calibration_error = 3; + * + * @return The estimatedCalibrationError. + */ + float getEstimatedCalibrationError(); + + /** + * + * + *
+     * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
+     * only.
+     * 
+ * + * float auprc_exact = 5; + * + * @return The auprcExact. + */ + float getAuprcExact(); + + /** + * + * + *
+     * The ECE for the predicted entities with fuzzy matching disabled, i.e.,
+     * exact matching only.
+     * 
+ * + * float estimated_calibration_error_exact = 6; + * + * @return The estimatedCalibrationErrorExact. + */ + float getEstimatedCalibrationErrorExact(); + + /** + * + * + *
+     * The metrics type for the label.
+     * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The enum numeric value on the wire for metricsType. + */ + int getMetricsTypeValue(); + /** + * + * + *
+     * The metrics type for the label.
+     * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The metricsType. + */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType getMetricsType(); + } + /** + * + * + *
+   * Metrics across multiple confidence levels.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} + */ + public static final class MultiConfidenceMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + MultiConfidenceMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MultiConfidenceMetrics.newBuilder() to construct. + private MultiConfidenceMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MultiConfidenceMetrics() { + confidenceLevelMetrics_ = java.util.Collections.emptyList(); + confidenceLevelMetricsExact_ = java.util.Collections.emptyList(); + metricsType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MultiConfidenceMetrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.class, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder.class); + } + + /** + * + * + *
+     * A type that determines how metrics should be interpreted.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType} + */ + public enum MetricsType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The metrics type is unspecified. By default, metrics without a
+       * particular specification are for leaf entity types (i.e., top-level
+       * entity types without child types, or child types which are not
+       * parent types themselves).
+       * 
+ * + * METRICS_TYPE_UNSPECIFIED = 0; + */ + METRICS_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Indicates whether metrics for this particular label type represent an
+       * aggregate of metrics for other types instead of being based on actual
+       * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
+       * entity types are an aggregate of metrics for their children.
+       * 
+ * + * AGGREGATE = 1; + */ + AGGREGATE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * The metrics type is unspecified. By default, metrics without a
+       * particular specification are for leaf entity types (i.e., top-level
+       * entity types without child types, or child types which are not
+       * parent types themselves).
+       * 
+ * + * METRICS_TYPE_UNSPECIFIED = 0; + */ + public static final int METRICS_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Indicates whether metrics for this particular label type represent an
+       * aggregate of metrics for other types instead of being based on actual
+       * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
+       * entity types are an aggregate of metrics for their children.
+       * 
+ * + * AGGREGATE = 1; + */ + public static final int AGGREGATE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MetricsType 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 MetricsType forNumber(int value) { + switch (value) { + case 0: + return METRICS_TYPE_UNSPECIFIED; + case 1: + return AGGREGATE; + 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 MetricsType findValueByNumber(int number) { + return MetricsType.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.Evaluation.MultiConfidenceMetrics.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MetricsType[] VALUES = values(); + + public static MetricsType 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 MetricsType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType) + } + + public static final int CONFIDENCE_LEVEL_METRICS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + confidenceLevelMetrics_; + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + @java.lang.Override + public java.util.List + getConfidenceLevelMetricsList() { + return confidenceLevelMetrics_; + } + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsOrBuilderList() { + return confidenceLevelMetrics_; + } + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + @java.lang.Override + public int getConfidenceLevelMetricsCount() { + return confidenceLevelMetrics_.size(); + } + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getConfidenceLevelMetrics(int index) { + return confidenceLevelMetrics_.get(index); + } + /** + * + * + *
+     * Metrics across confidence levels with fuzzy matching enabled.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsOrBuilder(int index) { + return confidenceLevelMetrics_.get(index); + } + + public static final int CONFIDENCE_LEVEL_METRICS_EXACT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + confidenceLevelMetricsExact_; + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + @java.lang.Override + public java.util.List + getConfidenceLevelMetricsExactList() { + return confidenceLevelMetricsExact_; + } + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsExactOrBuilderList() { + return confidenceLevelMetricsExact_; + } + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + @java.lang.Override + public int getConfidenceLevelMetricsExactCount() { + return confidenceLevelMetricsExact_.size(); + } + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getConfidenceLevelMetricsExact(int index) { + return confidenceLevelMetricsExact_.get(index); + } + /** + * + * + *
+     * Metrics across confidence levels with only exact matching.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsExactOrBuilder(int index) { + return confidenceLevelMetricsExact_.get(index); + } + + public static final int AUPRC_FIELD_NUMBER = 2; + private float auprc_ = 0F; + /** + * + * + *
+     * The calculated area under the precision recall curve (AUPRC), computed by
+     * integrating over all confidence thresholds.
+     * 
+ * + * float auprc = 2; + * + * @return The auprc. + */ + @java.lang.Override + public float getAuprc() { + return auprc_; + } + + public static final int ESTIMATED_CALIBRATION_ERROR_FIELD_NUMBER = 3; + private float estimatedCalibrationError_ = 0F; + /** + * + * + *
+     * The Estimated Calibration Error (ECE) of the confidence of the predicted
+     * entities.
+     * 
+ * + * float estimated_calibration_error = 3; + * + * @return The estimatedCalibrationError. + */ + @java.lang.Override + public float getEstimatedCalibrationError() { + return estimatedCalibrationError_; + } + + public static final int AUPRC_EXACT_FIELD_NUMBER = 5; + private float auprcExact_ = 0F; + /** + * + * + *
+     * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
+     * only.
+     * 
+ * + * float auprc_exact = 5; + * + * @return The auprcExact. + */ + @java.lang.Override + public float getAuprcExact() { + return auprcExact_; + } + + public static final int ESTIMATED_CALIBRATION_ERROR_EXACT_FIELD_NUMBER = 6; + private float estimatedCalibrationErrorExact_ = 0F; + /** + * + * + *
+     * The ECE for the predicted entities with fuzzy matching disabled, i.e.,
+     * exact matching only.
+     * 
+ * + * float estimated_calibration_error_exact = 6; + * + * @return The estimatedCalibrationErrorExact. + */ + @java.lang.Override + public float getEstimatedCalibrationErrorExact() { + return estimatedCalibrationErrorExact_; + } + + public static final int METRICS_TYPE_FIELD_NUMBER = 7; + private int metricsType_ = 0; + /** + * + * + *
+     * The metrics type for the label.
+     * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The enum numeric value on the wire for metricsType. + */ + @java.lang.Override + public int getMetricsTypeValue() { + return metricsType_; + } + /** + * + * + *
+     * The metrics type for the label.
+     * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The metricsType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + getMetricsType() { + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType result = + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType.forNumber( + metricsType_); + return result == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < confidenceLevelMetrics_.size(); i++) { + output.writeMessage(1, confidenceLevelMetrics_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(auprc_) != 0) { + output.writeFloat(2, auprc_); + } + if (java.lang.Float.floatToRawIntBits(estimatedCalibrationError_) != 0) { + output.writeFloat(3, estimatedCalibrationError_); + } + for (int i = 0; i < confidenceLevelMetricsExact_.size(); i++) { + output.writeMessage(4, confidenceLevelMetricsExact_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(auprcExact_) != 0) { + output.writeFloat(5, auprcExact_); + } + if (java.lang.Float.floatToRawIntBits(estimatedCalibrationErrorExact_) != 0) { + output.writeFloat(6, estimatedCalibrationErrorExact_); + } + if (metricsType_ + != com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + .METRICS_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, metricsType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < confidenceLevelMetrics_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, confidenceLevelMetrics_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(auprc_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, auprc_); + } + if (java.lang.Float.floatToRawIntBits(estimatedCalibrationError_) != 0) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize(3, estimatedCalibrationError_); + } + for (int i = 0; i < confidenceLevelMetricsExact_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, confidenceLevelMetricsExact_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(auprcExact_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, auprcExact_); + } + if (java.lang.Float.floatToRawIntBits(estimatedCalibrationErrorExact_) != 0) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 6, estimatedCalibrationErrorExact_); + } + if (metricsType_ + != com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + .METRICS_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, metricsType_); + } + 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.Evaluation.MultiConfidenceMetrics)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics other = + (com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) obj; + + if (!getConfidenceLevelMetricsList().equals(other.getConfidenceLevelMetricsList())) + return false; + if (!getConfidenceLevelMetricsExactList().equals(other.getConfidenceLevelMetricsExactList())) + return false; + if (java.lang.Float.floatToIntBits(getAuprc()) + != java.lang.Float.floatToIntBits(other.getAuprc())) return false; + if (java.lang.Float.floatToIntBits(getEstimatedCalibrationError()) + != java.lang.Float.floatToIntBits(other.getEstimatedCalibrationError())) return false; + if (java.lang.Float.floatToIntBits(getAuprcExact()) + != java.lang.Float.floatToIntBits(other.getAuprcExact())) return false; + if (java.lang.Float.floatToIntBits(getEstimatedCalibrationErrorExact()) + != java.lang.Float.floatToIntBits(other.getEstimatedCalibrationErrorExact())) + return false; + if (metricsType_ != other.metricsType_) 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 (getConfidenceLevelMetricsCount() > 0) { + hash = (37 * hash) + CONFIDENCE_LEVEL_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceLevelMetricsList().hashCode(); + } + if (getConfidenceLevelMetricsExactCount() > 0) { + hash = (37 * hash) + CONFIDENCE_LEVEL_METRICS_EXACT_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceLevelMetricsExactList().hashCode(); + } + hash = (37 * hash) + AUPRC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuprc()); + hash = (37 * hash) + ESTIMATED_CALIBRATION_ERROR_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getEstimatedCalibrationError()); + hash = (37 * hash) + AUPRC_EXACT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuprcExact()); + hash = (37 * hash) + ESTIMATED_CALIBRATION_ERROR_EXACT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getEstimatedCalibrationErrorExact()); + hash = (37 * hash) + METRICS_TYPE_FIELD_NUMBER; + hash = (53 * hash) + metricsType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + 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.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics 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; + } + /** + * + * + *
+     * Metrics across multiple confidence levels.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.class, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (confidenceLevelMetricsBuilder_ == null) { + confidenceLevelMetrics_ = java.util.Collections.emptyList(); + } else { + confidenceLevelMetrics_ = null; + confidenceLevelMetricsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (confidenceLevelMetricsExactBuilder_ == null) { + confidenceLevelMetricsExact_ = java.util.Collections.emptyList(); + } else { + confidenceLevelMetricsExact_ = null; + confidenceLevelMetricsExactBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + auprc_ = 0F; + estimatedCalibrationError_ = 0F; + auprcExact_ = 0F; + estimatedCalibrationErrorExact_ = 0F; + metricsType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_MultiConfidenceMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics build() { + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics buildPartial() { + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics result = + new com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics result) { + if (confidenceLevelMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + confidenceLevelMetrics_ = + java.util.Collections.unmodifiableList(confidenceLevelMetrics_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.confidenceLevelMetrics_ = confidenceLevelMetrics_; + } else { + result.confidenceLevelMetrics_ = confidenceLevelMetricsBuilder_.build(); + } + if (confidenceLevelMetricsExactBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + confidenceLevelMetricsExact_ = + java.util.Collections.unmodifiableList(confidenceLevelMetricsExact_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.confidenceLevelMetricsExact_ = confidenceLevelMetricsExact_; + } else { + result.confidenceLevelMetricsExact_ = confidenceLevelMetricsExactBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.auprc_ = auprc_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.estimatedCalibrationError_ = estimatedCalibrationError_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.auprcExact_ = auprcExact_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.estimatedCalibrationErrorExact_ = estimatedCalibrationErrorExact_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.metricsType_ = metricsType_; + } + } + + @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.Evaluation.MultiConfidenceMetrics) { + return mergeFrom( + (com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics other) { + if (other + == com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + .getDefaultInstance()) return this; + if (confidenceLevelMetricsBuilder_ == null) { + if (!other.confidenceLevelMetrics_.isEmpty()) { + if (confidenceLevelMetrics_.isEmpty()) { + confidenceLevelMetrics_ = other.confidenceLevelMetrics_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.addAll(other.confidenceLevelMetrics_); + } + onChanged(); + } + } else { + if (!other.confidenceLevelMetrics_.isEmpty()) { + if (confidenceLevelMetricsBuilder_.isEmpty()) { + confidenceLevelMetricsBuilder_.dispose(); + confidenceLevelMetricsBuilder_ = null; + confidenceLevelMetrics_ = other.confidenceLevelMetrics_; + bitField0_ = (bitField0_ & ~0x00000001); + confidenceLevelMetricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConfidenceLevelMetricsFieldBuilder() + : null; + } else { + confidenceLevelMetricsBuilder_.addAllMessages(other.confidenceLevelMetrics_); + } + } + } + if (confidenceLevelMetricsExactBuilder_ == null) { + if (!other.confidenceLevelMetricsExact_.isEmpty()) { + if (confidenceLevelMetricsExact_.isEmpty()) { + confidenceLevelMetricsExact_ = other.confidenceLevelMetricsExact_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.addAll(other.confidenceLevelMetricsExact_); + } + onChanged(); + } + } else { + if (!other.confidenceLevelMetricsExact_.isEmpty()) { + if (confidenceLevelMetricsExactBuilder_.isEmpty()) { + confidenceLevelMetricsExactBuilder_.dispose(); + confidenceLevelMetricsExactBuilder_ = null; + confidenceLevelMetricsExact_ = other.confidenceLevelMetricsExact_; + bitField0_ = (bitField0_ & ~0x00000002); + confidenceLevelMetricsExactBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConfidenceLevelMetricsExactFieldBuilder() + : null; + } else { + confidenceLevelMetricsExactBuilder_.addAllMessages( + other.confidenceLevelMetricsExact_); + } + } + } + if (other.getAuprc() != 0F) { + setAuprc(other.getAuprc()); + } + if (other.getEstimatedCalibrationError() != 0F) { + setEstimatedCalibrationError(other.getEstimatedCalibrationError()); + } + if (other.getAuprcExact() != 0F) { + setAuprcExact(other.getAuprcExact()); + } + if (other.getEstimatedCalibrationErrorExact() != 0F) { + setEstimatedCalibrationErrorExact(other.getEstimatedCalibrationErrorExact()); + } + if (other.metricsType_ != 0) { + setMetricsTypeValue(other.getMetricsTypeValue()); + } + 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.Evaluation.ConfidenceLevelMetrics m = + input.readMessage( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.parser(), + extensionRegistry); + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.add(m); + } else { + confidenceLevelMetricsBuilder_.addMessage(m); + } + break; + } // case 10 + case 21: + { + auprc_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 21 + case 29: + { + estimatedCalibrationError_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 29 + case 34: + { + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics m = + input.readMessage( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.parser(), + extensionRegistry); + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.add(m); + } else { + confidenceLevelMetricsExactBuilder_.addMessage(m); + } + break; + } // case 34 + case 45: + { + auprcExact_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } // case 45 + case 53: + { + estimatedCalibrationErrorExact_ = input.readFloat(); + bitField0_ |= 0x00000020; + break; + } // case 53 + case 56: + { + metricsType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + 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 + confidenceLevelMetrics_ = java.util.Collections.emptyList(); + + private void ensureConfidenceLevelMetricsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + confidenceLevelMetrics_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics>( + confidenceLevelMetrics_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + confidenceLevelMetricsBuilder_; + + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public java.util.List + getConfidenceLevelMetricsList() { + if (confidenceLevelMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceLevelMetrics_); + } else { + return confidenceLevelMetricsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public int getConfidenceLevelMetricsCount() { + if (confidenceLevelMetricsBuilder_ == null) { + return confidenceLevelMetrics_.size(); + } else { + return confidenceLevelMetricsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getConfidenceLevelMetrics(int index) { + if (confidenceLevelMetricsBuilder_ == null) { + return confidenceLevelMetrics_.get(index); + } else { + return confidenceLevelMetricsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder setConfidenceLevelMetrics( + int index, com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.set(index, value); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder setConfidenceLevelMetrics( + int index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder addConfidenceLevelMetrics( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.add(value); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder addConfidenceLevelMetrics( + int index, com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.add(index, value); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder addConfidenceLevelMetrics( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.add(builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder addConfidenceLevelMetrics( + int index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder addAllConfidenceLevelMetrics( + java.lang.Iterable< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics> + values) { + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceLevelMetrics_); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder clearConfidenceLevelMetrics() { + if (confidenceLevelMetricsBuilder_ == null) { + confidenceLevelMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public Builder removeConfidenceLevelMetrics(int index) { + if (confidenceLevelMetricsBuilder_ == null) { + ensureConfidenceLevelMetricsIsMutable(); + confidenceLevelMetrics_.remove(index); + onChanged(); + } else { + confidenceLevelMetricsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + getConfidenceLevelMetricsBuilder(int index) { + return getConfidenceLevelMetricsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsOrBuilder(int index) { + if (confidenceLevelMetricsBuilder_ == null) { + return confidenceLevelMetrics_.get(index); + } else { + return confidenceLevelMetricsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsOrBuilderList() { + if (confidenceLevelMetricsBuilder_ != null) { + return confidenceLevelMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceLevelMetrics_); + } + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + addConfidenceLevelMetricsBuilder() { + return getConfidenceLevelMetricsFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance()); + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + addConfidenceLevelMetricsBuilder(int index) { + return getConfidenceLevelMetricsFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance()); + } + /** + * + * + *
+       * Metrics across confidence levels with fuzzy matching enabled.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * + */ + public java.util.List< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder> + getConfidenceLevelMetricsBuilderList() { + return getConfidenceLevelMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsFieldBuilder() { + if (confidenceLevelMetricsBuilder_ == null) { + confidenceLevelMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder>( + confidenceLevelMetrics_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + confidenceLevelMetrics_ = null; + } + return confidenceLevelMetricsBuilder_; + } + + private java.util.List + confidenceLevelMetricsExact_ = java.util.Collections.emptyList(); + + private void ensureConfidenceLevelMetricsExactIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + confidenceLevelMetricsExact_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics>( + confidenceLevelMetricsExact_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + confidenceLevelMetricsExactBuilder_; + + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public java.util.List + getConfidenceLevelMetricsExactList() { + if (confidenceLevelMetricsExactBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceLevelMetricsExact_); + } else { + return confidenceLevelMetricsExactBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public int getConfidenceLevelMetricsExactCount() { + if (confidenceLevelMetricsExactBuilder_ == null) { + return confidenceLevelMetricsExact_.size(); + } else { + return confidenceLevelMetricsExactBuilder_.getCount(); + } + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + getConfidenceLevelMetricsExact(int index) { + if (confidenceLevelMetricsExactBuilder_ == null) { + return confidenceLevelMetricsExact_.get(index); + } else { + return confidenceLevelMetricsExactBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder setConfidenceLevelMetricsExact( + int index, com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsExactBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.set(index, value); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder setConfidenceLevelMetricsExact( + int index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder addConfidenceLevelMetricsExact( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsExactBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.add(value); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder addConfidenceLevelMetricsExact( + int index, com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics value) { + if (confidenceLevelMetricsExactBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.add(index, value); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder addConfidenceLevelMetricsExact( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.add(builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder addConfidenceLevelMetricsExact( + int index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + builderForValue) { + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder addAllConfidenceLevelMetricsExact( + java.lang.Iterable< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics> + values) { + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, confidenceLevelMetricsExact_); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder clearConfidenceLevelMetricsExact() { + if (confidenceLevelMetricsExactBuilder_ == null) { + confidenceLevelMetricsExact_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public Builder removeConfidenceLevelMetricsExact(int index) { + if (confidenceLevelMetricsExactBuilder_ == null) { + ensureConfidenceLevelMetricsExactIsMutable(); + confidenceLevelMetricsExact_.remove(index); + onChanged(); + } else { + confidenceLevelMetricsExactBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + getConfidenceLevelMetricsExactBuilder(int index) { + return getConfidenceLevelMetricsExactFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder + getConfidenceLevelMetricsExactOrBuilder(int index) { + if (confidenceLevelMetricsExactBuilder_ == null) { + return confidenceLevelMetricsExact_.get(index); + } else { + return confidenceLevelMetricsExactBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsExactOrBuilderList() { + if (confidenceLevelMetricsExactBuilder_ != null) { + return confidenceLevelMetricsExactBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceLevelMetricsExact_); + } + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + addConfidenceLevelMetricsExactBuilder() { + return getConfidenceLevelMetricsExactFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance()); + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder + addConfidenceLevelMetricsExactBuilder(int index) { + return getConfidenceLevelMetricsExactFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + .getDefaultInstance()); + } + /** + * + * + *
+       * Metrics across confidence levels with only exact matching.
+       * 
+ * + * + * repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * + */ + public java.util.List< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder> + getConfidenceLevelMetricsExactBuilderList() { + return getConfidenceLevelMetricsExactFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder> + getConfidenceLevelMetricsExactFieldBuilder() { + if (confidenceLevelMetricsExactBuilder_ == null) { + confidenceLevelMetricsExactBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetricsOrBuilder>( + confidenceLevelMetricsExact_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + confidenceLevelMetricsExact_ = null; + } + return confidenceLevelMetricsExactBuilder_; + } + + private float auprc_; + /** + * + * + *
+       * The calculated area under the precision recall curve (AUPRC), computed by
+       * integrating over all confidence thresholds.
+       * 
+ * + * float auprc = 2; + * + * @return The auprc. + */ + @java.lang.Override + public float getAuprc() { + return auprc_; + } + /** + * + * + *
+       * The calculated area under the precision recall curve (AUPRC), computed by
+       * integrating over all confidence thresholds.
+       * 
+ * + * float auprc = 2; + * + * @param value The auprc to set. + * @return This builder for chaining. + */ + public Builder setAuprc(float value) { + + auprc_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The calculated area under the precision recall curve (AUPRC), computed by
+       * integrating over all confidence thresholds.
+       * 
+ * + * float auprc = 2; + * + * @return This builder for chaining. + */ + public Builder clearAuprc() { + bitField0_ = (bitField0_ & ~0x00000004); + auprc_ = 0F; + onChanged(); + return this; + } + + private float estimatedCalibrationError_; + /** + * + * + *
+       * The Estimated Calibration Error (ECE) of the confidence of the predicted
+       * entities.
+       * 
+ * + * float estimated_calibration_error = 3; + * + * @return The estimatedCalibrationError. + */ + @java.lang.Override + public float getEstimatedCalibrationError() { + return estimatedCalibrationError_; + } + /** + * + * + *
+       * The Estimated Calibration Error (ECE) of the confidence of the predicted
+       * entities.
+       * 
+ * + * float estimated_calibration_error = 3; + * + * @param value The estimatedCalibrationError to set. + * @return This builder for chaining. + */ + public Builder setEstimatedCalibrationError(float value) { + + estimatedCalibrationError_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The Estimated Calibration Error (ECE) of the confidence of the predicted
+       * entities.
+       * 
+ * + * float estimated_calibration_error = 3; + * + * @return This builder for chaining. + */ + public Builder clearEstimatedCalibrationError() { + bitField0_ = (bitField0_ & ~0x00000008); + estimatedCalibrationError_ = 0F; + onChanged(); + return this; + } + + private float auprcExact_; + /** + * + * + *
+       * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
+       * only.
+       * 
+ * + * float auprc_exact = 5; + * + * @return The auprcExact. + */ + @java.lang.Override + public float getAuprcExact() { + return auprcExact_; + } + /** + * + * + *
+       * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
+       * only.
+       * 
+ * + * float auprc_exact = 5; + * + * @param value The auprcExact to set. + * @return This builder for chaining. + */ + public Builder setAuprcExact(float value) { + + auprcExact_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
+       * only.
+       * 
+ * + * float auprc_exact = 5; + * + * @return This builder for chaining. + */ + public Builder clearAuprcExact() { + bitField0_ = (bitField0_ & ~0x00000010); + auprcExact_ = 0F; + onChanged(); + return this; + } + + private float estimatedCalibrationErrorExact_; + /** + * + * + *
+       * The ECE for the predicted entities with fuzzy matching disabled, i.e.,
+       * exact matching only.
+       * 
+ * + * float estimated_calibration_error_exact = 6; + * + * @return The estimatedCalibrationErrorExact. + */ + @java.lang.Override + public float getEstimatedCalibrationErrorExact() { + return estimatedCalibrationErrorExact_; + } + /** + * + * + *
+       * The ECE for the predicted entities with fuzzy matching disabled, i.e.,
+       * exact matching only.
+       * 
+ * + * float estimated_calibration_error_exact = 6; + * + * @param value The estimatedCalibrationErrorExact to set. + * @return This builder for chaining. + */ + public Builder setEstimatedCalibrationErrorExact(float value) { + + estimatedCalibrationErrorExact_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * The ECE for the predicted entities with fuzzy matching disabled, i.e.,
+       * exact matching only.
+       * 
+ * + * float estimated_calibration_error_exact = 6; + * + * @return This builder for chaining. + */ + public Builder clearEstimatedCalibrationErrorExact() { + bitField0_ = (bitField0_ & ~0x00000020); + estimatedCalibrationErrorExact_ = 0F; + onChanged(); + return this; + } + + private int metricsType_ = 0; + /** + * + * + *
+       * The metrics type for the label.
+       * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The enum numeric value on the wire for metricsType. + */ + @java.lang.Override + public int getMetricsTypeValue() { + return metricsType_; + } + /** + * + * + *
+       * The metrics type for the label.
+       * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @param value The enum numeric value on the wire for metricsType to set. + * @return This builder for chaining. + */ + public Builder setMetricsTypeValue(int value) { + metricsType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics type for the label.
+       * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return The metricsType. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + getMetricsType() { + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType result = + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType.forNumber( + metricsType_); + return result == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The metrics type for the label.
+       * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @param value The metricsType to set. + * @return This builder for chaining. + */ + public Builder setMetricsType( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + metricsType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The metrics type for the label.
+       * 
+ * + * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearMetricsType() { + bitField0_ = (bitField0_ & ~0x00000040); + metricsType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + private static final com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics(); + } + + public static com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultiConfidenceMetrics 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.Evaluation.MultiConfidenceMetrics + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The resource name of the evaluation.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the evaluation.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int DOCUMENT_COUNTERS_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.Evaluation.Counters documentCounters_; + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return Whether the documentCounters field is set. + */ + @java.lang.Override + public boolean hasDocumentCounters() { + return documentCounters_ != null; + } + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return The documentCounters. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Counters getDocumentCounters() { + return documentCounters_ == null + ? com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance() + : documentCounters_; + } + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder + getDocumentCountersOrBuilder() { + return documentCounters_ == null + ? com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance() + : documentCounters_; + } + + public static final int ALL_ENTITIES_METRICS_FIELD_NUMBER = 3; + private com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics allEntitiesMetrics_; + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return Whether the allEntitiesMetrics field is set. + */ + @java.lang.Override + public boolean hasAllEntitiesMetrics() { + return allEntitiesMetrics_ != null; + } + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return The allEntitiesMetrics. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getAllEntitiesMetrics() { + return allEntitiesMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.getDefaultInstance() + : allEntitiesMetrics_; + } + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder + getAllEntitiesMetricsOrBuilder() { + return allEntitiesMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.getDefaultInstance() + : allEntitiesMetrics_; + } + + public static final int ENTITY_METRICS_FIELD_NUMBER = 4; + + private static final class EntityMetricsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_EntityMetricsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + entityMetrics_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + internalGetEntityMetrics() { + if (entityMetrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EntityMetricsDefaultEntryHolder.defaultEntry); + } + return entityMetrics_; + } + + public int getEntityMetricsCount() { + return internalGetEntityMetrics().getMap().size(); + } + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public boolean containsEntityMetrics(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEntityMetrics().getMap().containsKey(key); + } + /** Use {@link #getEntityMetricsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + getEntityMetrics() { + return getEntityMetricsMap(); + } + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + getEntityMetricsMap() { + return internalGetEntityMetrics().getMap(); + } + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + getEntityMetricsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + map = internalGetEntityMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getEntityMetricsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + map = internalGetEntityMetrics().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 6; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 6; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersionName_ = ""; + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 7; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } + } + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 7; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (allEntitiesMetrics_ != null) { + output.writeMessage(3, getAllEntitiesMetrics()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetEntityMetrics(), EntityMetricsDefaultEntryHolder.defaultEntry, 4); + if (documentCounters_ != null) { + output.writeMessage(5, getDocumentCounters()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, kmsKeyVersionName_); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (allEntitiesMetrics_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAllEntitiesMetrics()); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + entry : internalGetEntityMetrics().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + entityMetrics__ = + EntityMetricsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, entityMetrics__); + } + if (documentCounters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDocumentCounters()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, kmsKeyVersionName_); + } + 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.Evaluation)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.Evaluation other = + (com.google.cloud.documentai.v1.Evaluation) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasDocumentCounters() != other.hasDocumentCounters()) return false; + if (hasDocumentCounters()) { + if (!getDocumentCounters().equals(other.getDocumentCounters())) return false; + } + if (hasAllEntitiesMetrics() != other.hasAllEntitiesMetrics()) return false; + if (hasAllEntitiesMetrics()) { + if (!getAllEntitiesMetrics().equals(other.getAllEntitiesMetrics())) return false; + } + if (!internalGetEntityMetrics().equals(other.internalGetEntityMetrics())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasDocumentCounters()) { + hash = (37 * hash) + DOCUMENT_COUNTERS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentCounters().hashCode(); + } + if (hasAllEntitiesMetrics()) { + hash = (37 * hash) + ALL_ENTITIES_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getAllEntitiesMetrics().hashCode(); + } + if (!internalGetEntityMetrics().getMap().isEmpty()) { + hash = (37 * hash) + ENTITY_METRICS_FIELD_NUMBER; + hash = (53 * hash) + internalGetEntityMetrics().hashCode(); + } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.Evaluation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation 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.Evaluation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation 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.Evaluation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.Evaluation 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.Evaluation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation 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.Evaluation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.Evaluation 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.Evaluation 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.Evaluation 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.Evaluation 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; + } + /** + * + * + *
+   * An evaluation of a ProcessorVersion's performance.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.Evaluation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.Evaluation) + com.google.cloud.documentai.v1.EvaluationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEntityMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableEntityMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.Evaluation.class, + com.google.cloud.documentai.v1.Evaluation.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.Evaluation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + documentCounters_ = null; + if (documentCountersBuilder_ != null) { + documentCountersBuilder_.dispose(); + documentCountersBuilder_ = null; + } + allEntitiesMetrics_ = null; + if (allEntitiesMetricsBuilder_ != null) { + allEntitiesMetricsBuilder_.dispose(); + allEntitiesMetricsBuilder_ = null; + } + internalGetMutableEntityMetrics().clear(); + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_Evaluation_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.Evaluation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation build() { + com.google.cloud.documentai.v1.Evaluation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation buildPartial() { + com.google.cloud.documentai.v1.Evaluation result = + new com.google.cloud.documentai.v1.Evaluation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.Evaluation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentCounters_ = + documentCountersBuilder_ == null ? documentCounters_ : documentCountersBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allEntitiesMetrics_ = + allEntitiesMetricsBuilder_ == null + ? allEntitiesMetrics_ + : allEntitiesMetricsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.entityMetrics_ = internalGetEntityMetrics(); + result.entityMetrics_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.kmsKeyVersionName_ = kmsKeyVersionName_; + } + } + + @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.Evaluation) { + return mergeFrom((com.google.cloud.documentai.v1.Evaluation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.Evaluation other) { + if (other == com.google.cloud.documentai.v1.Evaluation.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasDocumentCounters()) { + mergeDocumentCounters(other.getDocumentCounters()); + } + if (other.hasAllEntitiesMetrics()) { + mergeAllEntitiesMetrics(other.getAllEntitiesMetrics()); + } + internalGetMutableEntityMetrics().mergeFrom(other.internalGetEntityMetrics()); + bitField0_ |= 0x00000010; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + bitField0_ |= 0x00000040; + 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 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getAllEntitiesMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + entityMetrics__ = + input.readMessage( + EntityMetricsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableEntityMetrics() + .getMutableMap() + .put(entityMetrics__.getKey(), entityMetrics__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + input.readMessage( + getDocumentCountersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + kmsKeyVersionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + 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_ = ""; + /** + * + * + *
+     * The resource name of the evaluation.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time that the evaluation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + 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.cloud.documentai.v1.Evaluation.Counters documentCounters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Counters, + com.google.cloud.documentai.v1.Evaluation.Counters.Builder, + com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder> + documentCountersBuilder_; + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return Whether the documentCounters field is set. + */ + public boolean hasDocumentCounters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return The documentCounters. + */ + public com.google.cloud.documentai.v1.Evaluation.Counters getDocumentCounters() { + if (documentCountersBuilder_ == null) { + return documentCounters_ == null + ? com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance() + : documentCounters_; + } else { + return documentCountersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public Builder setDocumentCounters(com.google.cloud.documentai.v1.Evaluation.Counters value) { + if (documentCountersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentCounters_ = value; + } else { + documentCountersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public Builder setDocumentCounters( + com.google.cloud.documentai.v1.Evaluation.Counters.Builder builderForValue) { + if (documentCountersBuilder_ == null) { + documentCounters_ = builderForValue.build(); + } else { + documentCountersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public Builder mergeDocumentCounters(com.google.cloud.documentai.v1.Evaluation.Counters value) { + if (documentCountersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && documentCounters_ != null + && documentCounters_ + != com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance()) { + getDocumentCountersBuilder().mergeFrom(value); + } else { + documentCounters_ = value; + } + } else { + documentCountersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public Builder clearDocumentCounters() { + bitField0_ = (bitField0_ & ~0x00000004); + documentCounters_ = null; + if (documentCountersBuilder_ != null) { + documentCountersBuilder_.dispose(); + documentCountersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public com.google.cloud.documentai.v1.Evaluation.Counters.Builder getDocumentCountersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDocumentCountersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + public com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder + getDocumentCountersOrBuilder() { + if (documentCountersBuilder_ != null) { + return documentCountersBuilder_.getMessageOrBuilder(); + } else { + return documentCounters_ == null + ? com.google.cloud.documentai.v1.Evaluation.Counters.getDefaultInstance() + : documentCounters_; + } + } + /** + * + * + *
+     * Counters for the documents used in the evaluation.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Counters, + com.google.cloud.documentai.v1.Evaluation.Counters.Builder, + com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder> + getDocumentCountersFieldBuilder() { + if (documentCountersBuilder_ == null) { + documentCountersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Counters, + com.google.cloud.documentai.v1.Evaluation.Counters.Builder, + com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder>( + getDocumentCounters(), getParentForChildren(), isClean()); + documentCounters_ = null; + } + return documentCountersBuilder_; + } + + private com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics allEntitiesMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder> + allEntitiesMetricsBuilder_; + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return Whether the allEntitiesMetrics field is set. + */ + public boolean hasAllEntitiesMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return The allEntitiesMetrics. + */ + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + getAllEntitiesMetrics() { + if (allEntitiesMetricsBuilder_ == null) { + return allEntitiesMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.getDefaultInstance() + : allEntitiesMetrics_; + } else { + return allEntitiesMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public Builder setAllEntitiesMetrics( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics value) { + if (allEntitiesMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allEntitiesMetrics_ = value; + } else { + allEntitiesMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public Builder setAllEntitiesMetrics( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder builderForValue) { + if (allEntitiesMetricsBuilder_ == null) { + allEntitiesMetrics_ = builderForValue.build(); + } else { + allEntitiesMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public Builder mergeAllEntitiesMetrics( + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics value) { + if (allEntitiesMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && allEntitiesMetrics_ != null + && allEntitiesMetrics_ + != com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + .getDefaultInstance()) { + getAllEntitiesMetricsBuilder().mergeFrom(value); + } else { + allEntitiesMetrics_ = value; + } + } else { + allEntitiesMetricsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public Builder clearAllEntitiesMetrics() { + bitField0_ = (bitField0_ & ~0x00000008); + allEntitiesMetrics_ = null; + if (allEntitiesMetricsBuilder_ != null) { + allEntitiesMetricsBuilder_.dispose(); + allEntitiesMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder + getAllEntitiesMetricsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAllEntitiesMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder + getAllEntitiesMetricsOrBuilder() { + if (allEntitiesMetricsBuilder_ != null) { + return allEntitiesMetricsBuilder_.getMessageOrBuilder(); + } else { + return allEntitiesMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.getDefaultInstance() + : allEntitiesMetrics_; + } + } + /** + * + * + *
+     * Metrics for all the entities in aggregate.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder> + getAllEntitiesMetricsFieldBuilder() { + if (allEntitiesMetricsBuilder_ == null) { + allEntitiesMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder>( + getAllEntitiesMetrics(), getParentForChildren(), isClean()); + allEntitiesMetrics_ = null; + } + return allEntitiesMetricsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + entityMetrics_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + internalGetEntityMetrics() { + if (entityMetrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EntityMetricsDefaultEntryHolder.defaultEntry); + } + return entityMetrics_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + internalGetMutableEntityMetrics() { + if (entityMetrics_ == null) { + entityMetrics_ = + com.google.protobuf.MapField.newMapField(EntityMetricsDefaultEntryHolder.defaultEntry); + } + if (!entityMetrics_.isMutable()) { + entityMetrics_ = entityMetrics_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return entityMetrics_; + } + + public int getEntityMetricsCount() { + return internalGetEntityMetrics().getMap().size(); + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public boolean containsEntityMetrics(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEntityMetrics().getMap().containsKey(key); + } + /** Use {@link #getEntityMetricsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + getEntityMetrics() { + return getEntityMetricsMap(); + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + getEntityMetricsMap() { + return internalGetEntityMetrics().getMap(); + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + getEntityMetricsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + map = internalGetEntityMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getEntityMetricsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + map = internalGetEntityMetrics().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEntityMetrics() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableEntityMetrics().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + public Builder removeEntityMetrics(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEntityMetrics().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + getMutableEntityMetrics() { + bitField0_ |= 0x00000010; + return internalGetMutableEntityMetrics().getMutableMap(); + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + public Builder putEntityMetrics( + java.lang.String key, + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableEntityMetrics().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Metrics across confidence levels, for different entities.
+     * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + public Builder putAllEntityMetrics( + java.util.Map< + java.lang.String, com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> + values) { + internalGetMutableEntityMetrics().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 6; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 6; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 6; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key name used for encryption.
+     * 
+ * + * string kms_key_name = 6; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersionName_ = ""; + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 7; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 7; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 7; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 7; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The KMS key version with which data is encrypted.
+     * 
+ * + * string kms_key_version_name = 7; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000040; + 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.Evaluation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.Evaluation) + private static final com.google.cloud.documentai.v1.Evaluation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.Evaluation(); + } + + public static com.google.cloud.documentai.v1.Evaluation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Evaluation 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.Evaluation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationName.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationName.java new file mode 100644 index 000000000000..34de33b19f6c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationName.java @@ -0,0 +1,306 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class EvaluationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION_EVALUATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String processor; + private final String processorVersion; + private final String evaluation; + + @Deprecated + protected EvaluationName() { + project = null; + location = null; + processor = null; + processorVersion = null; + evaluation = null; + } + + private EvaluationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + processor = Preconditions.checkNotNull(builder.getProcessor()); + processorVersion = Preconditions.checkNotNull(builder.getProcessorVersion()); + evaluation = Preconditions.checkNotNull(builder.getEvaluation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public String getEvaluation() { + return evaluation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EvaluationName of( + String project, + String location, + String processor, + String processorVersion, + String evaluation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .setEvaluation(evaluation) + .build(); + } + + public static String format( + String project, + String location, + String processor, + String processorVersion, + String evaluation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProcessor(processor) + .setProcessorVersion(processorVersion) + .setEvaluation(evaluation) + .build() + .toString(); + } + + public static EvaluationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION_EVALUATION.validatedMatch( + formattedString, "EvaluationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("processor"), + matchMap.get("processor_version"), + matchMap.get("evaluation")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (EvaluationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION_EVALUATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (processor != null) { + fieldMapBuilder.put("processor", processor); + } + if (processorVersion != null) { + fieldMapBuilder.put("processor_version", processorVersion); + } + if (evaluation != null) { + fieldMapBuilder.put("evaluation", evaluation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PROCESSOR_PROCESSOR_VERSION_EVALUATION.instantiate( + "project", + project, + "location", + location, + "processor", + processor, + "processor_version", + processorVersion, + "evaluation", + evaluation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EvaluationName that = ((EvaluationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.processor, that.processor) + && Objects.equals(this.processorVersion, that.processorVersion) + && Objects.equals(this.evaluation, that.evaluation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(processor); + h *= 1000003; + h ^= Objects.hashCode(processorVersion); + h *= 1000003; + h ^= Objects.hashCode(evaluation); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}. + */ + public static class Builder { + private String project; + private String location; + private String processor; + private String processorVersion; + private String evaluation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProcessor() { + return processor; + } + + public String getProcessorVersion() { + return processorVersion; + } + + public String getEvaluation() { + return evaluation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProcessor(String processor) { + this.processor = processor; + return this; + } + + public Builder setProcessorVersion(String processorVersion) { + this.processorVersion = processorVersion; + return this; + } + + public Builder setEvaluation(String evaluation) { + this.evaluation = evaluation; + return this; + } + + private Builder(EvaluationName evaluationName) { + this.project = evaluationName.project; + this.location = evaluationName.location; + this.processor = evaluationName.processor; + this.processorVersion = evaluationName.processorVersion; + this.evaluation = evaluationName.evaluation; + } + + public EvaluationName build() { + return new EvaluationName(this); + } + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationOrBuilder.java new file mode 100644 index 000000000000..ee168cb57e81 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationOrBuilder.java @@ -0,0 +1,284 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/evaluation.proto + +package com.google.cloud.documentai.v1; + +public interface EvaluationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.Evaluation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the evaluation.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the evaluation.
+   * Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time that the evaluation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return Whether the documentCounters field is set. + */ + boolean hasDocumentCounters(); + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * + * @return The documentCounters. + */ + com.google.cloud.documentai.v1.Evaluation.Counters getDocumentCounters(); + /** + * + * + *
+   * Counters for the documents used in the evaluation.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + com.google.cloud.documentai.v1.Evaluation.CountersOrBuilder getDocumentCountersOrBuilder(); + + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return Whether the allEntitiesMetrics field is set. + */ + boolean hasAllEntitiesMetrics(); + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + * + * @return The allEntitiesMetrics. + */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getAllEntitiesMetrics(); + /** + * + * + *
+   * Metrics for all the entities in aggregate.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * + */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetricsOrBuilder + getAllEntitiesMetricsOrBuilder(); + + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + int getEntityMetricsCount(); + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + boolean containsEntityMetrics(java.lang.String key); + /** Use {@link #getEntityMetricsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getEntityMetrics(); + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + java.util.Map + getEntityMetricsMap(); + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + /* nullable */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getEntityMetricsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics defaultValue); + /** + * + * + *
+   * Metrics across confidence levels, for different entities.
+   * 
+ * + * + * map<string, .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics> entity_metrics = 4; + * + */ + com.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics getEntityMetricsOrThrow( + java.lang.String key); + + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 6; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The KMS key name used for encryption.
+   * 
+ * + * string kms_key_name = 6; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 7; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + /** + * + * + *
+   * The KMS key version with which data is encrypted.
+   * 
+ * + * string kms_key_version_name = 7; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReference.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReference.java new file mode 100644 index 000000000000..c3b4d5fc4918 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReference.java @@ -0,0 +1,1356 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/evaluation.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Gives a short summary of an evaluation, and links to the evaluation itself.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluationReference} + */ +public final class EvaluationReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.EvaluationReference) + EvaluationReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use EvaluationReference.newBuilder() to construct. + private EvaluationReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EvaluationReference() { + operation_ = ""; + evaluation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EvaluationReference(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_EvaluationReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_EvaluationReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluationReference.class, + com.google.cloud.documentai.v1.EvaluationReference.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** + * + * + *
+   * The resource name of the Long Running Operation for the evaluation.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the Long Running Operation for the evaluation.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVALUATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object evaluation_ = ""; + /** + * + * + *
+   * The resource name of the evaluation.
+   * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The evaluation. + */ + @java.lang.Override + public java.lang.String getEvaluation() { + java.lang.Object ref = evaluation_; + 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(); + evaluation_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the evaluation.
+   * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for evaluation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvaluationBytes() { + java.lang.Object ref = evaluation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + evaluation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGGREGATE_METRICS_FIELD_NUMBER = 4; + private com.google.cloud.documentai.v1.Evaluation.Metrics aggregateMetrics_; + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return Whether the aggregateMetrics field is set. + */ + @java.lang.Override + public boolean hasAggregateMetrics() { + return aggregateMetrics_ != null; + } + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return The aggregateMetrics. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetrics() { + return aggregateMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetrics_; + } + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getAggregateMetricsOrBuilder() { + return aggregateMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetrics_; + } + + public static final int AGGREGATE_METRICS_EXACT_FIELD_NUMBER = 5; + private com.google.cloud.documentai.v1.Evaluation.Metrics aggregateMetricsExact_; + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return Whether the aggregateMetricsExact field is set. + */ + @java.lang.Override + public boolean hasAggregateMetricsExact() { + return aggregateMetricsExact_ != null; + } + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return The aggregateMetricsExact. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetricsExact() { + return aggregateMetricsExact_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetricsExact_; + } + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder + getAggregateMetricsExactOrBuilder() { + return aggregateMetricsExact_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetricsExact_; + } + + 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(operation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(evaluation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, evaluation_); + } + if (aggregateMetrics_ != null) { + output.writeMessage(4, getAggregateMetrics()); + } + if (aggregateMetricsExact_ != null) { + output.writeMessage(5, getAggregateMetricsExact()); + } + 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(operation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(evaluation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, evaluation_); + } + if (aggregateMetrics_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAggregateMetrics()); + } + if (aggregateMetricsExact_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAggregateMetricsExact()); + } + 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.EvaluationReference)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.EvaluationReference other = + (com.google.cloud.documentai.v1.EvaluationReference) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getEvaluation().equals(other.getEvaluation())) return false; + if (hasAggregateMetrics() != other.hasAggregateMetrics()) return false; + if (hasAggregateMetrics()) { + if (!getAggregateMetrics().equals(other.getAggregateMetrics())) return false; + } + if (hasAggregateMetricsExact() != other.hasAggregateMetricsExact()) return false; + if (hasAggregateMetricsExact()) { + if (!getAggregateMetricsExact().equals(other.getAggregateMetricsExact())) 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) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + EVALUATION_FIELD_NUMBER; + hash = (53 * hash) + getEvaluation().hashCode(); + if (hasAggregateMetrics()) { + hash = (37 * hash) + AGGREGATE_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getAggregateMetrics().hashCode(); + } + if (hasAggregateMetricsExact()) { + hash = (37 * hash) + AGGREGATE_METRICS_EXACT_FIELD_NUMBER; + hash = (53 * hash) + getAggregateMetricsExact().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.EvaluationReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluationReference 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.EvaluationReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluationReference 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.EvaluationReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.EvaluationReference 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.EvaluationReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluationReference 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.EvaluationReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.EvaluationReference 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.EvaluationReference 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.EvaluationReference 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.EvaluationReference 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; + } + /** + * + * + *
+   * Gives a short summary of an evaluation, and links to the evaluation itself.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.EvaluationReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.EvaluationReference) + com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_EvaluationReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_EvaluationReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.EvaluationReference.class, + com.google.cloud.documentai.v1.EvaluationReference.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.EvaluationReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + evaluation_ = ""; + aggregateMetrics_ = null; + if (aggregateMetricsBuilder_ != null) { + aggregateMetricsBuilder_.dispose(); + aggregateMetricsBuilder_ = null; + } + aggregateMetricsExact_ = null; + if (aggregateMetricsExactBuilder_ != null) { + aggregateMetricsExactBuilder_.dispose(); + aggregateMetricsExactBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiEvaluation + .internal_static_google_cloud_documentai_v1_EvaluationReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationReference getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationReference build() { + com.google.cloud.documentai.v1.EvaluationReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationReference buildPartial() { + com.google.cloud.documentai.v1.EvaluationReference result = + new com.google.cloud.documentai.v1.EvaluationReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.EvaluationReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.evaluation_ = evaluation_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.aggregateMetrics_ = + aggregateMetricsBuilder_ == null ? aggregateMetrics_ : aggregateMetricsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.aggregateMetricsExact_ = + aggregateMetricsExactBuilder_ == null + ? aggregateMetricsExact_ + : aggregateMetricsExactBuilder_.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.EvaluationReference) { + return mergeFrom((com.google.cloud.documentai.v1.EvaluationReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.EvaluationReference other) { + if (other == com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEvaluation().isEmpty()) { + evaluation_ = other.evaluation_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasAggregateMetrics()) { + mergeAggregateMetrics(other.getAggregateMetrics()); + } + if (other.hasAggregateMetricsExact()) { + mergeAggregateMetricsExact(other.getAggregateMetricsExact()); + } + 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: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + evaluation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage( + getAggregateMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage( + getAggregateMetricsExactFieldBuilder().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 operation_ = ""; + /** + * + * + *
+     * The resource name of the Long Running Operation for the evaluation.
+     * 
+ * + * string operation = 1; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the Long Running Operation for the evaluation.
+     * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the Long Running Operation for the evaluation.
+     * 
+ * + * string operation = 1; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Long Running Operation for the evaluation.
+     * 
+ * + * string operation = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Long Running Operation for the evaluation.
+     * 
+ * + * string operation = 1; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object evaluation_ = ""; + /** + * + * + *
+     * The resource name of the evaluation.
+     * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The evaluation. + */ + public java.lang.String getEvaluation() { + java.lang.Object ref = evaluation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + evaluation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for evaluation. + */ + public com.google.protobuf.ByteString getEvaluationBytes() { + java.lang.Object ref = evaluation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + evaluation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The evaluation to set. + * @return This builder for chaining. + */ + public Builder setEvaluation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + evaluation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearEvaluation() { + evaluation_ = getDefaultInstance().getEvaluation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the evaluation.
+     * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for evaluation to set. + * @return This builder for chaining. + */ + public Builder setEvaluationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + evaluation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.Evaluation.Metrics aggregateMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + aggregateMetricsBuilder_; + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return Whether the aggregateMetrics field is set. + */ + public boolean hasAggregateMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return The aggregateMetrics. + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetrics() { + if (aggregateMetricsBuilder_ == null) { + return aggregateMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetrics_; + } else { + return aggregateMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public Builder setAggregateMetrics(com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (aggregateMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregateMetrics_ = value; + } else { + aggregateMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public Builder setAggregateMetrics( + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder builderForValue) { + if (aggregateMetricsBuilder_ == null) { + aggregateMetrics_ = builderForValue.build(); + } else { + aggregateMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public Builder mergeAggregateMetrics(com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (aggregateMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && aggregateMetrics_ != null + && aggregateMetrics_ + != com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance()) { + getAggregateMetricsBuilder().mergeFrom(value); + } else { + aggregateMetrics_ = value; + } + } else { + aggregateMetricsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public Builder clearAggregateMetrics() { + bitField0_ = (bitField0_ & ~0x00000004); + aggregateMetrics_ = null; + if (aggregateMetricsBuilder_ != null) { + aggregateMetricsBuilder_.dispose(); + aggregateMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics.Builder getAggregateMetricsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAggregateMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder + getAggregateMetricsOrBuilder() { + if (aggregateMetricsBuilder_ != null) { + return aggregateMetricsBuilder_.getMessageOrBuilder(); + } else { + return aggregateMetrics_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetrics_; + } + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching on.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + getAggregateMetricsFieldBuilder() { + if (aggregateMetricsBuilder_ == null) { + aggregateMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder>( + getAggregateMetrics(), getParentForChildren(), isClean()); + aggregateMetrics_ = null; + } + return aggregateMetricsBuilder_; + } + + private com.google.cloud.documentai.v1.Evaluation.Metrics aggregateMetricsExact_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + aggregateMetricsExactBuilder_; + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return Whether the aggregateMetricsExact field is set. + */ + public boolean hasAggregateMetricsExact() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return The aggregateMetricsExact. + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetricsExact() { + if (aggregateMetricsExactBuilder_ == null) { + return aggregateMetricsExact_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetricsExact_; + } else { + return aggregateMetricsExactBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public Builder setAggregateMetricsExact( + com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (aggregateMetricsExactBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregateMetricsExact_ = value; + } else { + aggregateMetricsExactBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public Builder setAggregateMetricsExact( + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder builderForValue) { + if (aggregateMetricsExactBuilder_ == null) { + aggregateMetricsExact_ = builderForValue.build(); + } else { + aggregateMetricsExactBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public Builder mergeAggregateMetricsExact( + com.google.cloud.documentai.v1.Evaluation.Metrics value) { + if (aggregateMetricsExactBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && aggregateMetricsExact_ != null + && aggregateMetricsExact_ + != com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance()) { + getAggregateMetricsExactBuilder().mergeFrom(value); + } else { + aggregateMetricsExact_ = value; + } + } else { + aggregateMetricsExactBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public Builder clearAggregateMetricsExact() { + bitField0_ = (bitField0_ & ~0x00000008); + aggregateMetricsExact_ = null; + if (aggregateMetricsExactBuilder_ != null) { + aggregateMetricsExactBuilder_.dispose(); + aggregateMetricsExactBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public com.google.cloud.documentai.v1.Evaluation.Metrics.Builder + getAggregateMetricsExactBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAggregateMetricsExactFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + public com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder + getAggregateMetricsExactOrBuilder() { + if (aggregateMetricsExactBuilder_ != null) { + return aggregateMetricsExactBuilder_.getMessageOrBuilder(); + } else { + return aggregateMetricsExact_ == null + ? com.google.cloud.documentai.v1.Evaluation.Metrics.getDefaultInstance() + : aggregateMetricsExact_; + } + } + /** + * + * + *
+     * An aggregate of the statistics for the evaluation with fuzzy matching off.
+     * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder> + getAggregateMetricsExactFieldBuilder() { + if (aggregateMetricsExactBuilder_ == null) { + aggregateMetricsExactBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation.Metrics, + com.google.cloud.documentai.v1.Evaluation.Metrics.Builder, + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder>( + getAggregateMetricsExact(), getParentForChildren(), isClean()); + aggregateMetricsExact_ = null; + } + return aggregateMetricsExactBuilder_; + } + + @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.EvaluationReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.EvaluationReference) + private static final com.google.cloud.documentai.v1.EvaluationReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.EvaluationReference(); + } + + public static com.google.cloud.documentai.v1.EvaluationReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EvaluationReference 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.EvaluationReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReferenceOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReferenceOrBuilder.java new file mode 100644 index 000000000000..63dc874aabe2 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/EvaluationReferenceOrBuilder.java @@ -0,0 +1,145 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/evaluation.proto + +package com.google.cloud.documentai.v1; + +public interface EvaluationReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.EvaluationReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the Long Running Operation for the evaluation.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + java.lang.String getOperation(); + /** + * + * + *
+   * The resource name of the Long Running Operation for the evaluation.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+   * The resource name of the evaluation.
+   * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The evaluation. + */ + java.lang.String getEvaluation(); + /** + * + * + *
+   * The resource name of the evaluation.
+   * 
+ * + * string evaluation = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for evaluation. + */ + com.google.protobuf.ByteString getEvaluationBytes(); + + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return Whether the aggregateMetrics field is set. + */ + boolean hasAggregateMetrics(); + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * + * @return The aggregateMetrics. + */ + com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetrics(); + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching on.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getAggregateMetricsOrBuilder(); + + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return Whether the aggregateMetricsExact field is set. + */ + boolean hasAggregateMetricsExact(); + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * + * @return The aggregateMetricsExact. + */ + com.google.cloud.documentai.v1.Evaluation.Metrics getAggregateMetricsExact(); + /** + * + * + *
+   * An aggregate of the statistics for the evaluation with fuzzy matching off.
+   * 
+ * + * .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + com.google.cloud.documentai.v1.Evaluation.MetricsOrBuilder getAggregateMetricsExactOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequest.java new file mode 100644 index 000000000000..5d844964fe56 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Retrieves a specific Evaluation.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetEvaluationRequest} + */ +public final class GetEvaluationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.GetEvaluationRequest) + GetEvaluationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEvaluationRequest.newBuilder() to construct. + private GetEvaluationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEvaluationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEvaluationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetEvaluationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetEvaluationRequest.class, + com.google.cloud.documentai.v1.GetEvaluationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the
+   * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+   * 
+ * + * + * 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 the
+   * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+   * 
+ * + * + * 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.GetEvaluationRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.GetEvaluationRequest other = + (com.google.cloud.documentai.v1.GetEvaluationRequest) 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.GetEvaluationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest 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.GetEvaluationRequest 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.GetEvaluationRequest 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; + } + /** + * + * + *
+   * Retrieves a specific Evaluation.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.GetEvaluationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.GetEvaluationRequest) + com.google.cloud.documentai.v1.GetEvaluationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetEvaluationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_GetEvaluationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.GetEvaluationRequest.class, + com.google.cloud.documentai.v1.GetEvaluationRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.GetEvaluationRequest.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_GetEvaluationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetEvaluationRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.GetEvaluationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetEvaluationRequest build() { + com.google.cloud.documentai.v1.GetEvaluationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.GetEvaluationRequest buildPartial() { + com.google.cloud.documentai.v1.GetEvaluationRequest result = + new com.google.cloud.documentai.v1.GetEvaluationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.GetEvaluationRequest 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.GetEvaluationRequest) { + return mergeFrom((com.google.cloud.documentai.v1.GetEvaluationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.GetEvaluationRequest other) { + if (other == com.google.cloud.documentai.v1.GetEvaluationRequest.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 resource name of the
+     * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+     * 
+ * + * + * 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 the
+     * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+     * 
+ * + * + * 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 the
+     * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+     * 
+ * + * + * 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 the
+     * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+     * 
+ * + * + * 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 the
+     * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+     * 
+ * + * + * 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.GetEvaluationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.GetEvaluationRequest) + private static final com.google.cloud.documentai.v1.GetEvaluationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.GetEvaluationRequest(); + } + + public static com.google.cloud.documentai.v1.GetEvaluationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEvaluationRequest 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.GetEvaluationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequestOrBuilder.java new file mode 100644 index 000000000000..9a083c853c68 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/GetEvaluationRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface GetEvaluationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.GetEvaluationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the
+   * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the
+   * [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
+   * 
+ * + * + * 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/ListEvaluationsRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsRequest.java new file mode 100644 index 000000000000..2a87392c3908 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsRequest.java @@ -0,0 +1,955 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Retrieves a list of evaluations for a given ProcessorVersion.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListEvaluationsRequest} + */ +public final class ListEvaluationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListEvaluationsRequest) + ListEvaluationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEvaluationsRequest.newBuilder() to construct. + private ListEvaluationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEvaluationsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEvaluationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListEvaluationsRequest.class, + com.google.cloud.documentai.v1.ListEvaluationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+   * evaluations for.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * 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 resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+   * evaluations for.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * The standard list page size.
+   * If unspecified, at most 5 evaluations will be returned.
+   * The maximum value is 100; values above 100 will be coerced to 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListEvaluations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListEvaluations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += 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.ListEvaluationsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListEvaluationsRequest other = + (com.google.cloud.documentai.v1.ListEvaluationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest 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.ListEvaluationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest 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.ListEvaluationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest 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.ListEvaluationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest 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.ListEvaluationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest 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.ListEvaluationsRequest 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.ListEvaluationsRequest 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.ListEvaluationsRequest 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; + } + /** + * + * + *
+   * Retrieves a list of evaluations for a given ProcessorVersion.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListEvaluationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListEvaluationsRequest) + com.google.cloud.documentai.v1.ListEvaluationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListEvaluationsRequest.class, + com.google.cloud.documentai.v1.ListEvaluationsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListEvaluationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListEvaluationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsRequest build() { + com.google.cloud.documentai.v1.ListEvaluationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsRequest buildPartial() { + com.google.cloud.documentai.v1.ListEvaluationsRequest result = + new com.google.cloud.documentai.v1.ListEvaluationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.ListEvaluationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.ListEvaluationsRequest) { + return mergeFrom((com.google.cloud.documentai.v1.ListEvaluationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListEvaluationsRequest other) { + if (other == com.google.cloud.documentai.v1.ListEvaluationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+     * evaluations for.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * 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 resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+     * evaluations for.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * 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 resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+     * evaluations for.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * 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 resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+     * evaluations for.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * 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 resource name of the
+     * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+     * evaluations for.
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+     * 
+ * + * + * 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 int pageSize_; + /** + * + * + *
+     * The standard list page size.
+     * If unspecified, at most 5 evaluations will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The standard list page size.
+     * If unspecified, at most 5 evaluations will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page size.
+     * If unspecified, at most 5 evaluations will be returned.
+     * The maximum value is 100; values above 100 will be coerced to 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListEvaluations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListEvaluations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListEvaluations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListEvaluations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListEvaluations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.ListEvaluationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListEvaluationsRequest) + private static final com.google.cloud.documentai.v1.ListEvaluationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListEvaluationsRequest(); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEvaluationsRequest 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.ListEvaluationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsRequestOrBuilder.java new file mode 100644 index 000000000000..2afc47307753 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListEvaluationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListEvaluationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+   * evaluations for.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the
+   * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
+   * evaluations for.
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The standard list page size.
+   * If unspecified, at most 5 evaluations will be returned.
+   * The maximum value is 100; values above 100 will be coerced to 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListEvaluations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListEvaluations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponse.java new file mode 100644 index 000000000000..0502f733fa09 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponse.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The response from ListEvaluations.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListEvaluationsResponse} + */ +public final class ListEvaluationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.ListEvaluationsResponse) + ListEvaluationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEvaluationsResponse.newBuilder() to construct. + private ListEvaluationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEvaluationsResponse() { + evaluations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEvaluationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListEvaluationsResponse.class, + com.google.cloud.documentai.v1.ListEvaluationsResponse.Builder.class); + } + + public static final int EVALUATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List evaluations_; + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + @java.lang.Override + public java.util.List getEvaluationsList() { + return evaluations_; + } + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + @java.lang.Override + public java.util.List + getEvaluationsOrBuilderList() { + return evaluations_; + } + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + @java.lang.Override + public int getEvaluationsCount() { + return evaluations_.size(); + } + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.Evaluation getEvaluations(int index) { + return evaluations_.get(index); + } + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationOrBuilder getEvaluationsOrBuilder(int index) { + return evaluations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < evaluations_.size(); i++) { + output.writeMessage(1, evaluations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < evaluations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, evaluations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.ListEvaluationsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.ListEvaluationsResponse other = + (com.google.cloud.documentai.v1.ListEvaluationsResponse) obj; + + if (!getEvaluationsList().equals(other.getEvaluationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) 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 (getEvaluationsCount() > 0) { + hash = (37 * hash) + EVALUATIONS_FIELD_NUMBER; + hash = (53 * hash) + getEvaluationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse 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.ListEvaluationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse 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.ListEvaluationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse 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.ListEvaluationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse 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.ListEvaluationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse 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.ListEvaluationsResponse 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.ListEvaluationsResponse 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.ListEvaluationsResponse 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 response from ListEvaluations.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.ListEvaluationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.ListEvaluationsResponse) + com.google.cloud.documentai.v1.ListEvaluationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.ListEvaluationsResponse.class, + com.google.cloud.documentai.v1.ListEvaluationsResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.ListEvaluationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (evaluationsBuilder_ == null) { + evaluations_ = java.util.Collections.emptyList(); + } else { + evaluations_ = null; + evaluationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_ListEvaluationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsResponse getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.ListEvaluationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsResponse build() { + com.google.cloud.documentai.v1.ListEvaluationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.ListEvaluationsResponse buildPartial() { + com.google.cloud.documentai.v1.ListEvaluationsResponse result = + new com.google.cloud.documentai.v1.ListEvaluationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.documentai.v1.ListEvaluationsResponse result) { + if (evaluationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + evaluations_ = java.util.Collections.unmodifiableList(evaluations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.evaluations_ = evaluations_; + } else { + result.evaluations_ = evaluationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.documentai.v1.ListEvaluationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.ListEvaluationsResponse) { + return mergeFrom((com.google.cloud.documentai.v1.ListEvaluationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.ListEvaluationsResponse other) { + if (other == com.google.cloud.documentai.v1.ListEvaluationsResponse.getDefaultInstance()) + return this; + if (evaluationsBuilder_ == null) { + if (!other.evaluations_.isEmpty()) { + if (evaluations_.isEmpty()) { + evaluations_ = other.evaluations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEvaluationsIsMutable(); + evaluations_.addAll(other.evaluations_); + } + onChanged(); + } + } else { + if (!other.evaluations_.isEmpty()) { + if (evaluationsBuilder_.isEmpty()) { + evaluationsBuilder_.dispose(); + evaluationsBuilder_ = null; + evaluations_ = other.evaluations_; + bitField0_ = (bitField0_ & ~0x00000001); + evaluationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEvaluationsFieldBuilder() + : null; + } else { + evaluationsBuilder_.addAllMessages(other.evaluations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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 10: + { + com.google.cloud.documentai.v1.Evaluation m = + input.readMessage( + com.google.cloud.documentai.v1.Evaluation.parser(), extensionRegistry); + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + evaluations_.add(m); + } else { + evaluationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = 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 java.util.List evaluations_ = + java.util.Collections.emptyList(); + + private void ensureEvaluationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + evaluations_ = + new java.util.ArrayList(evaluations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation, + com.google.cloud.documentai.v1.Evaluation.Builder, + com.google.cloud.documentai.v1.EvaluationOrBuilder> + evaluationsBuilder_; + + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public java.util.List getEvaluationsList() { + if (evaluationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(evaluations_); + } else { + return evaluationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public int getEvaluationsCount() { + if (evaluationsBuilder_ == null) { + return evaluations_.size(); + } else { + return evaluationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public com.google.cloud.documentai.v1.Evaluation getEvaluations(int index) { + if (evaluationsBuilder_ == null) { + return evaluations_.get(index); + } else { + return evaluationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder setEvaluations(int index, com.google.cloud.documentai.v1.Evaluation value) { + if (evaluationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEvaluationsIsMutable(); + evaluations_.set(index, value); + onChanged(); + } else { + evaluationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder setEvaluations( + int index, com.google.cloud.documentai.v1.Evaluation.Builder builderForValue) { + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + evaluations_.set(index, builderForValue.build()); + onChanged(); + } else { + evaluationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder addEvaluations(com.google.cloud.documentai.v1.Evaluation value) { + if (evaluationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEvaluationsIsMutable(); + evaluations_.add(value); + onChanged(); + } else { + evaluationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder addEvaluations(int index, com.google.cloud.documentai.v1.Evaluation value) { + if (evaluationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEvaluationsIsMutable(); + evaluations_.add(index, value); + onChanged(); + } else { + evaluationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder addEvaluations( + com.google.cloud.documentai.v1.Evaluation.Builder builderForValue) { + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + evaluations_.add(builderForValue.build()); + onChanged(); + } else { + evaluationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder addEvaluations( + int index, com.google.cloud.documentai.v1.Evaluation.Builder builderForValue) { + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + evaluations_.add(index, builderForValue.build()); + onChanged(); + } else { + evaluationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder addAllEvaluations( + java.lang.Iterable values) { + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, evaluations_); + onChanged(); + } else { + evaluationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder clearEvaluations() { + if (evaluationsBuilder_ == null) { + evaluations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + evaluationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public Builder removeEvaluations(int index) { + if (evaluationsBuilder_ == null) { + ensureEvaluationsIsMutable(); + evaluations_.remove(index); + onChanged(); + } else { + evaluationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public com.google.cloud.documentai.v1.Evaluation.Builder getEvaluationsBuilder(int index) { + return getEvaluationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public com.google.cloud.documentai.v1.EvaluationOrBuilder getEvaluationsOrBuilder(int index) { + if (evaluationsBuilder_ == null) { + return evaluations_.get(index); + } else { + return evaluationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public java.util.List + getEvaluationsOrBuilderList() { + if (evaluationsBuilder_ != null) { + return evaluationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(evaluations_); + } + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public com.google.cloud.documentai.v1.Evaluation.Builder addEvaluationsBuilder() { + return getEvaluationsFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1.Evaluation.getDefaultInstance()); + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public com.google.cloud.documentai.v1.Evaluation.Builder addEvaluationsBuilder(int index) { + return getEvaluationsFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1.Evaluation.getDefaultInstance()); + } + /** + * + * + *
+     * The evaluations requested.
+     * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + public java.util.List + getEvaluationsBuilderList() { + return getEvaluationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation, + com.google.cloud.documentai.v1.Evaluation.Builder, + com.google.cloud.documentai.v1.EvaluationOrBuilder> + getEvaluationsFieldBuilder() { + if (evaluationsBuilder_ == null) { + evaluationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1.Evaluation, + com.google.cloud.documentai.v1.Evaluation.Builder, + com.google.cloud.documentai.v1.EvaluationOrBuilder>( + evaluations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + evaluations_ = null; + } + return evaluationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.ListEvaluationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.ListEvaluationsResponse) + private static final com.google.cloud.documentai.v1.ListEvaluationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.ListEvaluationsResponse(); + } + + public static com.google.cloud.documentai.v1.ListEvaluationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEvaluationsResponse 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.ListEvaluationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponseOrBuilder.java new file mode 100644 index 000000000000..62daf80559d5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ListEvaluationsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface ListEvaluationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.ListEvaluationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + java.util.List getEvaluationsList(); + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + com.google.cloud.documentai.v1.Evaluation getEvaluations(int index); + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + int getEvaluationsCount(); + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + java.util.List + getEvaluationsOrBuilderList(); + /** + * + * + *
+   * The evaluations requested.
+   * 
+ * + * repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + com.google.cloud.documentai.v1.EvaluationOrBuilder getEvaluationsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java index 637522dd036c..4c2986b2ebe2 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersion.java @@ -1550,6 +1550,57 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + public static final int LATEST_EVALUATION_FIELD_NUMBER = 8; + private com.google.cloud.documentai.v1.EvaluationReference latestEvaluation_; + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return Whether the latestEvaluation field is set. + */ + @java.lang.Override + public boolean hasLatestEvaluation() { + return latestEvaluation_ != null; + } + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return The latestEvaluation. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationReference getLatestEvaluation() { + return latestEvaluation_ == null + ? com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance() + : latestEvaluation_; + } + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder + getLatestEvaluationOrBuilder() { + return latestEvaluation_ == null + ? com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance() + : latestEvaluation_; + } + public static final int KMS_KEY_NAME_FIELD_NUMBER = 9; @SuppressWarnings("serial") @@ -1751,6 +1802,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (createTime_ != null) { output.writeMessage(7, getCreateTime()); } + if (latestEvaluation_ != null) { + output.writeMessage(8, getLatestEvaluation()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, kmsKeyName_); } @@ -1788,6 +1842,9 @@ public int getSerializedSize() { if (createTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); } + if (latestEvaluation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getLatestEvaluation()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, kmsKeyName_); } @@ -1830,6 +1887,10 @@ public boolean equals(final java.lang.Object obj) { if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } + if (hasLatestEvaluation() != other.hasLatestEvaluation()) return false; + if (hasLatestEvaluation()) { + if (!getLatestEvaluation().equals(other.getLatestEvaluation())) return false; + } if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; if (getGoogleManaged() != other.getGoogleManaged()) return false; @@ -1862,6 +1923,10 @@ public int hashCode() { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } + if (hasLatestEvaluation()) { + hash = (37 * hash) + LATEST_EVALUATION_FIELD_NUMBER; + hash = (53 * hash) + getLatestEvaluation().hashCode(); + } hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; hash = (53 * hash) + getKmsKeyName().hashCode(); hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; @@ -2028,6 +2093,11 @@ public Builder clear() { createTimeBuilder_.dispose(); createTimeBuilder_ = null; } + latestEvaluation_ = null; + if (latestEvaluationBuilder_ != null) { + latestEvaluationBuilder_.dispose(); + latestEvaluationBuilder_ = null; + } kmsKeyName_ = ""; kmsKeyVersionName_ = ""; googleManaged_ = false; @@ -2089,15 +2159,19 @@ private void buildPartial0(com.google.cloud.documentai.v1.ProcessorVersion resul result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000020) != 0)) { - result.kmsKeyName_ = kmsKeyName_; + result.latestEvaluation_ = + latestEvaluationBuilder_ == null ? latestEvaluation_ : latestEvaluationBuilder_.build(); } if (((from_bitField0_ & 0x00000040) != 0)) { - result.kmsKeyVersionName_ = kmsKeyVersionName_; + result.kmsKeyName_ = kmsKeyName_; } if (((from_bitField0_ & 0x00000080) != 0)) { - result.googleManaged_ = googleManaged_; + result.kmsKeyVersionName_ = kmsKeyVersionName_; } if (((from_bitField0_ & 0x00000100) != 0)) { + result.googleManaged_ = googleManaged_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { result.deprecationInfo_ = deprecationInfoBuilder_ == null ? deprecationInfo_ : deprecationInfoBuilder_.build(); } @@ -2168,14 +2242,17 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.ProcessorVersion other) if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } + if (other.hasLatestEvaluation()) { + mergeLatestEvaluation(other.getLatestEvaluation()); + } if (!other.getKmsKeyName().isEmpty()) { kmsKeyName_ = other.kmsKeyName_; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); } if (!other.getKmsKeyVersionName().isEmpty()) { kmsKeyVersionName_ = other.kmsKeyVersionName_; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } if (other.getGoogleManaged() != false) { @@ -2234,22 +2311,29 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 58 + case 66: + { + input.readMessage( + getLatestEvaluationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 case 74: { kmsKeyName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 74 case 82: { kmsKeyVersionName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 82 case 88: { googleManaged_ = input.readBool(); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 88 case 98: @@ -2261,7 +2345,7 @@ public Builder mergeFrom( case 106: { input.readMessage(getDeprecationInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 106 default: @@ -2965,6 +3049,192 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return createTimeBuilder_; } + private com.google.cloud.documentai.v1.EvaluationReference latestEvaluation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.EvaluationReference, + com.google.cloud.documentai.v1.EvaluationReference.Builder, + com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder> + latestEvaluationBuilder_; + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return Whether the latestEvaluation field is set. + */ + public boolean hasLatestEvaluation() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return The latestEvaluation. + */ + public com.google.cloud.documentai.v1.EvaluationReference getLatestEvaluation() { + if (latestEvaluationBuilder_ == null) { + return latestEvaluation_ == null + ? com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance() + : latestEvaluation_; + } else { + return latestEvaluationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public Builder setLatestEvaluation(com.google.cloud.documentai.v1.EvaluationReference value) { + if (latestEvaluationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestEvaluation_ = value; + } else { + latestEvaluationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public Builder setLatestEvaluation( + com.google.cloud.documentai.v1.EvaluationReference.Builder builderForValue) { + if (latestEvaluationBuilder_ == null) { + latestEvaluation_ = builderForValue.build(); + } else { + latestEvaluationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public Builder mergeLatestEvaluation(com.google.cloud.documentai.v1.EvaluationReference value) { + if (latestEvaluationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && latestEvaluation_ != null + && latestEvaluation_ + != com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance()) { + getLatestEvaluationBuilder().mergeFrom(value); + } else { + latestEvaluation_ = value; + } + } else { + latestEvaluationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public Builder clearLatestEvaluation() { + bitField0_ = (bitField0_ & ~0x00000020); + latestEvaluation_ = null; + if (latestEvaluationBuilder_ != null) { + latestEvaluationBuilder_.dispose(); + latestEvaluationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public com.google.cloud.documentai.v1.EvaluationReference.Builder getLatestEvaluationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getLatestEvaluationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + public com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder + getLatestEvaluationOrBuilder() { + if (latestEvaluationBuilder_ != null) { + return latestEvaluationBuilder_.getMessageOrBuilder(); + } else { + return latestEvaluation_ == null + ? com.google.cloud.documentai.v1.EvaluationReference.getDefaultInstance() + : latestEvaluation_; + } + } + /** + * + * + *
+     * The most recently invoked evaluation for the processor version.
+     * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.EvaluationReference, + com.google.cloud.documentai.v1.EvaluationReference.Builder, + com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder> + getLatestEvaluationFieldBuilder() { + if (latestEvaluationBuilder_ == null) { + latestEvaluationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.EvaluationReference, + com.google.cloud.documentai.v1.EvaluationReference.Builder, + com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder>( + getLatestEvaluation(), getParentForChildren(), isClean()); + latestEvaluation_ = null; + } + return latestEvaluationBuilder_; + } + private java.lang.Object kmsKeyName_ = ""; /** * @@ -3027,7 +3297,7 @@ public Builder setKmsKeyName(java.lang.String value) { throw new NullPointerException(); } kmsKeyName_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -3044,7 +3314,7 @@ public Builder setKmsKeyName(java.lang.String value) { */ public Builder clearKmsKeyName() { kmsKeyName_ = getDefaultInstance().getKmsKeyName(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } @@ -3066,7 +3336,7 @@ public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); kmsKeyName_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -3133,7 +3403,7 @@ public Builder setKmsKeyVersionName(java.lang.String value) { throw new NullPointerException(); } kmsKeyVersionName_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -3150,7 +3420,7 @@ public Builder setKmsKeyVersionName(java.lang.String value) { */ public Builder clearKmsKeyVersionName() { kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } @@ -3172,7 +3442,7 @@ public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); kmsKeyVersionName_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -3208,7 +3478,7 @@ public boolean getGoogleManaged() { public Builder setGoogleManaged(boolean value) { googleManaged_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -3224,7 +3494,7 @@ public Builder setGoogleManaged(boolean value) { * @return This builder for chaining. */ public Builder clearGoogleManaged() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); googleManaged_ = false; onChanged(); return this; @@ -3249,7 +3519,7 @@ public Builder clearGoogleManaged() { * @return Whether the deprecationInfo field is set. */ public boolean hasDeprecationInfo() { - return ((bitField0_ & 0x00000100) != 0); + return ((bitField0_ & 0x00000200) != 0); } /** * @@ -3292,7 +3562,7 @@ public Builder setDeprecationInfo( } else { deprecationInfoBuilder_.setMessage(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -3313,7 +3583,7 @@ public Builder setDeprecationInfo( } else { deprecationInfoBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -3330,7 +3600,7 @@ public Builder setDeprecationInfo( public Builder mergeDeprecationInfo( com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo value) { if (deprecationInfoBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0) + if (((bitField0_ & 0x00000200) != 0) && deprecationInfo_ != null && deprecationInfo_ != com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo @@ -3342,7 +3612,7 @@ public Builder mergeDeprecationInfo( } else { deprecationInfoBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -3357,7 +3627,7 @@ public Builder mergeDeprecationInfo( *
*/ public Builder clearDeprecationInfo() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); deprecationInfo_ = null; if (deprecationInfoBuilder_ != null) { deprecationInfoBuilder_.dispose(); @@ -3378,7 +3648,7 @@ public Builder clearDeprecationInfo() { */ public com.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.Builder getDeprecationInfoBuilder() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return getDeprecationInfoFieldBuilder().getBuilder(); } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java index 2a7f12d9e80a..bb8cbaa6567d 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/ProcessorVersionOrBuilder.java @@ -172,6 +172,41 @@ public interface ProcessorVersionOrBuilder */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return Whether the latestEvaluation field is set. + */ + boolean hasLatestEvaluation(); + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * + * @return The latestEvaluation. + */ + com.google.cloud.documentai.v1.EvaluationReference getLatestEvaluation(); + /** + * + * + *
+   * The most recently invoked evaluation for the processor version.
+   * 
+ * + * .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + com.google.cloud.documentai.v1.EvaluationReferenceOrBuilder getLatestEvaluationOrBuilder(); + /** * * diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadata.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadata.java new file mode 100644 index 000000000000..4dc1bb06f90c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadata.java @@ -0,0 +1,3219 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The metadata that represents a processor version being created.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionMetadata} + */ +public final class TrainProcessorVersionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.TrainProcessorVersionMetadata) + TrainProcessorVersionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TrainProcessorVersionMetadata.newBuilder() to construct. + private TrainProcessorVersionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TrainProcessorVersionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TrainProcessorVersionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.Builder.class); + } + + public interface DatasetValidationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The total number of document errors.
+     * 
+ * + * int32 document_error_count = 3; + * + * @return The documentErrorCount. + */ + int getDocumentErrorCount(); + + /** + * + * + *
+     * The total number of dataset errors.
+     * 
+ * + * int32 dataset_error_count = 4; + * + * @return The datasetErrorCount. + */ + int getDatasetErrorCount(); + + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + java.util.List getDocumentErrorsList(); + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + com.google.rpc.Status getDocumentErrors(int index); + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + int getDocumentErrorsCount(); + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + java.util.List getDocumentErrorsOrBuilderList(); + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + com.google.rpc.StatusOrBuilder getDocumentErrorsOrBuilder(int index); + + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + java.util.List getDatasetErrorsList(); + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + com.google.rpc.Status getDatasetErrors(int index); + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + int getDatasetErrorsCount(); + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + java.util.List getDatasetErrorsOrBuilderList(); + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + com.google.rpc.StatusOrBuilder getDatasetErrorsOrBuilder(int index); + } + /** + * + * + *
+   * The dataset validation information.
+   * This includes any and all errors with documents and the dataset.
+   * 
+ * + * Protobuf type {@code + * google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} + */ + public static final class DatasetValidation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + DatasetValidationOrBuilder { + private static final long serialVersionUID = 0L; + // Use DatasetValidation.newBuilder() to construct. + private DatasetValidation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DatasetValidation() { + documentErrors_ = java.util.Collections.emptyList(); + datasetErrors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DatasetValidation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.class, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder + .class); + } + + public static final int DOCUMENT_ERROR_COUNT_FIELD_NUMBER = 3; + private int documentErrorCount_ = 0; + /** + * + * + *
+     * The total number of document errors.
+     * 
+ * + * int32 document_error_count = 3; + * + * @return The documentErrorCount. + */ + @java.lang.Override + public int getDocumentErrorCount() { + return documentErrorCount_; + } + + public static final int DATASET_ERROR_COUNT_FIELD_NUMBER = 4; + private int datasetErrorCount_ = 0; + /** + * + * + *
+     * The total number of dataset errors.
+     * 
+ * + * int32 dataset_error_count = 4; + * + * @return The datasetErrorCount. + */ + @java.lang.Override + public int getDatasetErrorCount() { + return datasetErrorCount_; + } + + public static final int DOCUMENT_ERRORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List documentErrors_; + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + @java.lang.Override + public java.util.List getDocumentErrorsList() { + return documentErrors_; + } + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + @java.lang.Override + public java.util.List + getDocumentErrorsOrBuilderList() { + return documentErrors_; + } + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + @java.lang.Override + public int getDocumentErrorsCount() { + return documentErrors_.size(); + } + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + @java.lang.Override + public com.google.rpc.Status getDocumentErrors(int index) { + return documentErrors_.get(index); + } + /** + * + * + *
+     * Error information pertaining to specific documents. A maximum of 10
+     * document errors will be returned.
+     * Any document with errors will not be used throughout training.
+     * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getDocumentErrorsOrBuilder(int index) { + return documentErrors_.get(index); + } + + public static final int DATASET_ERRORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List datasetErrors_; + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + @java.lang.Override + public java.util.List getDatasetErrorsList() { + return datasetErrors_; + } + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + @java.lang.Override + public java.util.List + getDatasetErrorsOrBuilderList() { + return datasetErrors_; + } + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + @java.lang.Override + public int getDatasetErrorsCount() { + return datasetErrors_.size(); + } + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + @java.lang.Override + public com.google.rpc.Status getDatasetErrors(int index) { + return datasetErrors_.get(index); + } + /** + * + * + *
+     * Error information for the dataset as a whole. A maximum of 10 dataset
+     * errors will be returned.
+     * A single dataset error is terminal for training.
+     * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getDatasetErrorsOrBuilder(int index) { + return datasetErrors_.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 < documentErrors_.size(); i++) { + output.writeMessage(1, documentErrors_.get(i)); + } + for (int i = 0; i < datasetErrors_.size(); i++) { + output.writeMessage(2, datasetErrors_.get(i)); + } + if (documentErrorCount_ != 0) { + output.writeInt32(3, documentErrorCount_); + } + if (datasetErrorCount_ != 0) { + output.writeInt32(4, datasetErrorCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentErrors_.get(i)); + } + for (int i = 0; i < datasetErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, datasetErrors_.get(i)); + } + if (documentErrorCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, documentErrorCount_); + } + if (datasetErrorCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, datasetErrorCount_); + } + 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.TrainProcessorVersionMetadata.DatasetValidation)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation other = + (com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) obj; + + if (getDocumentErrorCount() != other.getDocumentErrorCount()) return false; + if (getDatasetErrorCount() != other.getDatasetErrorCount()) return false; + if (!getDocumentErrorsList().equals(other.getDocumentErrorsList())) return false; + if (!getDatasetErrorsList().equals(other.getDatasetErrorsList())) 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) + DOCUMENT_ERROR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getDocumentErrorCount(); + hash = (37 * hash) + DATASET_ERROR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getDatasetErrorCount(); + if (getDocumentErrorsCount() > 0) { + hash = (37 * hash) + DOCUMENT_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentErrorsList().hashCode(); + } + if (getDatasetErrorsCount() > 0) { + hash = (37 * hash) + DATASET_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getDatasetErrorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation + 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.TrainProcessorVersionMetadata.DatasetValidation 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 dataset validation information.
+     * This includes any and all errors with documents and the dataset.
+     * 
+ * + * Protobuf type {@code + * google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_DatasetValidation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .class, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + documentErrorCount_ = 0; + datasetErrorCount_ = 0; + if (documentErrorsBuilder_ == null) { + documentErrors_ = java.util.Collections.emptyList(); + } else { + documentErrors_ = null; + documentErrorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (datasetErrorsBuilder_ == null) { + datasetErrors_ = java.util.Collections.emptyList(); + } else { + datasetErrors_ = null; + datasetErrorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + 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_TrainProcessorVersionMetadata_DatasetValidation_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + build() { + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + buildPartial() { + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation result = + new com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation result) { + if (documentErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + documentErrors_ = java.util.Collections.unmodifiableList(documentErrors_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.documentErrors_ = documentErrors_; + } else { + result.documentErrors_ = documentErrorsBuilder_.build(); + } + if (datasetErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + datasetErrors_ = java.util.Collections.unmodifiableList(datasetErrors_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.datasetErrors_ = datasetErrors_; + } else { + result.datasetErrors_ = datasetErrorsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.documentErrorCount_ = documentErrorCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.datasetErrorCount_ = datasetErrorCount_; + } + } + + @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.TrainProcessorVersionMetadata.DatasetValidation) { + return mergeFrom( + (com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation other) { + if (other + == com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance()) return this; + if (other.getDocumentErrorCount() != 0) { + setDocumentErrorCount(other.getDocumentErrorCount()); + } + if (other.getDatasetErrorCount() != 0) { + setDatasetErrorCount(other.getDatasetErrorCount()); + } + if (documentErrorsBuilder_ == null) { + if (!other.documentErrors_.isEmpty()) { + if (documentErrors_.isEmpty()) { + documentErrors_ = other.documentErrors_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureDocumentErrorsIsMutable(); + documentErrors_.addAll(other.documentErrors_); + } + onChanged(); + } + } else { + if (!other.documentErrors_.isEmpty()) { + if (documentErrorsBuilder_.isEmpty()) { + documentErrorsBuilder_.dispose(); + documentErrorsBuilder_ = null; + documentErrors_ = other.documentErrors_; + bitField0_ = (bitField0_ & ~0x00000004); + documentErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentErrorsFieldBuilder() + : null; + } else { + documentErrorsBuilder_.addAllMessages(other.documentErrors_); + } + } + } + if (datasetErrorsBuilder_ == null) { + if (!other.datasetErrors_.isEmpty()) { + if (datasetErrors_.isEmpty()) { + datasetErrors_ = other.datasetErrors_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDatasetErrorsIsMutable(); + datasetErrors_.addAll(other.datasetErrors_); + } + onChanged(); + } + } else { + if (!other.datasetErrors_.isEmpty()) { + if (datasetErrorsBuilder_.isEmpty()) { + datasetErrorsBuilder_.dispose(); + datasetErrorsBuilder_ = null; + datasetErrors_ = other.datasetErrors_; + bitField0_ = (bitField0_ & ~0x00000008); + datasetErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDatasetErrorsFieldBuilder() + : null; + } else { + datasetErrorsBuilder_.addAllMessages(other.datasetErrors_); + } + } + } + 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.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + documentErrors_.add(m); + } else { + documentErrorsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + datasetErrors_.add(m); + } else { + datasetErrorsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + documentErrorCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 24 + case 32: + { + datasetErrorCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 32 + 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 documentErrorCount_; + /** + * + * + *
+       * The total number of document errors.
+       * 
+ * + * int32 document_error_count = 3; + * + * @return The documentErrorCount. + */ + @java.lang.Override + public int getDocumentErrorCount() { + return documentErrorCount_; + } + /** + * + * + *
+       * The total number of document errors.
+       * 
+ * + * int32 document_error_count = 3; + * + * @param value The documentErrorCount to set. + * @return This builder for chaining. + */ + public Builder setDocumentErrorCount(int value) { + + documentErrorCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The total number of document errors.
+       * 
+ * + * int32 document_error_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearDocumentErrorCount() { + bitField0_ = (bitField0_ & ~0x00000001); + documentErrorCount_ = 0; + onChanged(); + return this; + } + + private int datasetErrorCount_; + /** + * + * + *
+       * The total number of dataset errors.
+       * 
+ * + * int32 dataset_error_count = 4; + * + * @return The datasetErrorCount. + */ + @java.lang.Override + public int getDatasetErrorCount() { + return datasetErrorCount_; + } + /** + * + * + *
+       * The total number of dataset errors.
+       * 
+ * + * int32 dataset_error_count = 4; + * + * @param value The datasetErrorCount to set. + * @return This builder for chaining. + */ + public Builder setDatasetErrorCount(int value) { + + datasetErrorCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The total number of dataset errors.
+       * 
+ * + * int32 dataset_error_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearDatasetErrorCount() { + bitField0_ = (bitField0_ & ~0x00000002); + datasetErrorCount_ = 0; + onChanged(); + return this; + } + + private java.util.List documentErrors_ = + java.util.Collections.emptyList(); + + private void ensureDocumentErrorsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + documentErrors_ = new java.util.ArrayList(documentErrors_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + documentErrorsBuilder_; + + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public java.util.List getDocumentErrorsList() { + if (documentErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentErrors_); + } else { + return documentErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public int getDocumentErrorsCount() { + if (documentErrorsBuilder_ == null) { + return documentErrors_.size(); + } else { + return documentErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public com.google.rpc.Status getDocumentErrors(int index) { + if (documentErrorsBuilder_ == null) { + return documentErrors_.get(index); + } else { + return documentErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder setDocumentErrors(int index, com.google.rpc.Status value) { + if (documentErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentErrorsIsMutable(); + documentErrors_.set(index, value); + onChanged(); + } else { + documentErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder setDocumentErrors(int index, com.google.rpc.Status.Builder builderForValue) { + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + documentErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + documentErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder addDocumentErrors(com.google.rpc.Status value) { + if (documentErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentErrorsIsMutable(); + documentErrors_.add(value); + onChanged(); + } else { + documentErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder addDocumentErrors(int index, com.google.rpc.Status value) { + if (documentErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentErrorsIsMutable(); + documentErrors_.add(index, value); + onChanged(); + } else { + documentErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder addDocumentErrors(com.google.rpc.Status.Builder builderForValue) { + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + documentErrors_.add(builderForValue.build()); + onChanged(); + } else { + documentErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder addDocumentErrors(int index, com.google.rpc.Status.Builder builderForValue) { + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + documentErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + documentErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder addAllDocumentErrors( + java.lang.Iterable values) { + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentErrors_); + onChanged(); + } else { + documentErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder clearDocumentErrors() { + if (documentErrorsBuilder_ == null) { + documentErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + documentErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public Builder removeDocumentErrors(int index) { + if (documentErrorsBuilder_ == null) { + ensureDocumentErrorsIsMutable(); + documentErrors_.remove(index); + onChanged(); + } else { + documentErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public com.google.rpc.Status.Builder getDocumentErrorsBuilder(int index) { + return getDocumentErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public com.google.rpc.StatusOrBuilder getDocumentErrorsOrBuilder(int index) { + if (documentErrorsBuilder_ == null) { + return documentErrors_.get(index); + } else { + return documentErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public java.util.List + getDocumentErrorsOrBuilderList() { + if (documentErrorsBuilder_ != null) { + return documentErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentErrors_); + } + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public com.google.rpc.Status.Builder addDocumentErrorsBuilder() { + return getDocumentErrorsFieldBuilder() + .addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public com.google.rpc.Status.Builder addDocumentErrorsBuilder(int index) { + return getDocumentErrorsFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+       * Error information pertaining to specific documents. A maximum of 10
+       * document errors will be returned.
+       * Any document with errors will not be used throughout training.
+       * 
+ * + * repeated .google.rpc.Status document_errors = 1; + */ + public java.util.List getDocumentErrorsBuilderList() { + return getDocumentErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getDocumentErrorsFieldBuilder() { + if (documentErrorsBuilder_ == null) { + documentErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + documentErrors_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + documentErrors_ = null; + } + return documentErrorsBuilder_; + } + + private java.util.List datasetErrors_ = + java.util.Collections.emptyList(); + + private void ensureDatasetErrorsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + datasetErrors_ = new java.util.ArrayList(datasetErrors_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + datasetErrorsBuilder_; + + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public java.util.List getDatasetErrorsList() { + if (datasetErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(datasetErrors_); + } else { + return datasetErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public int getDatasetErrorsCount() { + if (datasetErrorsBuilder_ == null) { + return datasetErrors_.size(); + } else { + return datasetErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public com.google.rpc.Status getDatasetErrors(int index) { + if (datasetErrorsBuilder_ == null) { + return datasetErrors_.get(index); + } else { + return datasetErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder setDatasetErrors(int index, com.google.rpc.Status value) { + if (datasetErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetErrorsIsMutable(); + datasetErrors_.set(index, value); + onChanged(); + } else { + datasetErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder setDatasetErrors(int index, com.google.rpc.Status.Builder builderForValue) { + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + datasetErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + datasetErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder addDatasetErrors(com.google.rpc.Status value) { + if (datasetErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetErrorsIsMutable(); + datasetErrors_.add(value); + onChanged(); + } else { + datasetErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder addDatasetErrors(int index, com.google.rpc.Status value) { + if (datasetErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetErrorsIsMutable(); + datasetErrors_.add(index, value); + onChanged(); + } else { + datasetErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder addDatasetErrors(com.google.rpc.Status.Builder builderForValue) { + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + datasetErrors_.add(builderForValue.build()); + onChanged(); + } else { + datasetErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder addDatasetErrors(int index, com.google.rpc.Status.Builder builderForValue) { + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + datasetErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + datasetErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder addAllDatasetErrors( + java.lang.Iterable values) { + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datasetErrors_); + onChanged(); + } else { + datasetErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder clearDatasetErrors() { + if (datasetErrorsBuilder_ == null) { + datasetErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + datasetErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public Builder removeDatasetErrors(int index) { + if (datasetErrorsBuilder_ == null) { + ensureDatasetErrorsIsMutable(); + datasetErrors_.remove(index); + onChanged(); + } else { + datasetErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public com.google.rpc.Status.Builder getDatasetErrorsBuilder(int index) { + return getDatasetErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public com.google.rpc.StatusOrBuilder getDatasetErrorsOrBuilder(int index) { + if (datasetErrorsBuilder_ == null) { + return datasetErrors_.get(index); + } else { + return datasetErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public java.util.List + getDatasetErrorsOrBuilderList() { + if (datasetErrorsBuilder_ != null) { + return datasetErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(datasetErrors_); + } + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public com.google.rpc.Status.Builder addDatasetErrorsBuilder() { + return getDatasetErrorsFieldBuilder() + .addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public com.google.rpc.Status.Builder addDatasetErrorsBuilder(int index) { + return getDatasetErrorsFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+       * Error information for the dataset as a whole. A maximum of 10 dataset
+       * errors will be returned.
+       * A single dataset error is terminal for training.
+       * 
+ * + * repeated .google.rpc.Status dataset_errors = 2; + */ + public java.util.List getDatasetErrorsBuilderList() { + return getDatasetErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getDatasetErrorsFieldBuilder() { + if (datasetErrorsBuilder_ == null) { + datasetErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + datasetErrors_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + datasetErrors_ = null; + } + return datasetErrorsBuilder_; + } + + @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.TrainProcessorVersionMetadata.DatasetValidation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + private static final com.google.cloud.documentai.v1.TrainProcessorVersionMetadata + .DatasetValidation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation(); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatasetValidation 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.TrainProcessorVersionMetadata.DatasetValidation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + 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_; + } + + public static final int TRAINING_DATASET_VALIDATION_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + trainingDatasetValidation_; + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return Whether the trainingDatasetValidation field is set. + */ + @java.lang.Override + public boolean hasTrainingDatasetValidation() { + return trainingDatasetValidation_ != null; + } + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return The trainingDatasetValidation. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTrainingDatasetValidation() { + return trainingDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : trainingDatasetValidation_; + } + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTrainingDatasetValidationOrBuilder() { + return trainingDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : trainingDatasetValidation_; + } + + public static final int TEST_DATASET_VALIDATION_FIELD_NUMBER = 3; + private com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + testDatasetValidation_; + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return Whether the testDatasetValidation field is set. + */ + @java.lang.Override + public boolean hasTestDatasetValidation() { + return testDatasetValidation_ != null; + } + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return The testDatasetValidation. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTestDatasetValidation() { + return testDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : testDatasetValidation_; + } + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTestDatasetValidationOrBuilder() { + return testDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : testDatasetValidation_; + } + + 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()); + } + if (trainingDatasetValidation_ != null) { + output.writeMessage(2, getTrainingDatasetValidation()); + } + if (testDatasetValidation_ != null) { + output.writeMessage(3, getTestDatasetValidation()); + } + 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()); + } + if (trainingDatasetValidation_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getTrainingDatasetValidation()); + } + if (testDatasetValidation_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTestDatasetValidation()); + } + 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.TrainProcessorVersionMetadata)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata other = + (com.google.cloud.documentai.v1.TrainProcessorVersionMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (hasTrainingDatasetValidation() != other.hasTrainingDatasetValidation()) return false; + if (hasTrainingDatasetValidation()) { + if (!getTrainingDatasetValidation().equals(other.getTrainingDatasetValidation())) + return false; + } + if (hasTestDatasetValidation() != other.hasTestDatasetValidation()) return false; + if (hasTestDatasetValidation()) { + if (!getTestDatasetValidation().equals(other.getTestDatasetValidation())) 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(); + } + if (hasTrainingDatasetValidation()) { + hash = (37 * hash) + TRAINING_DATASET_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + getTrainingDatasetValidation().hashCode(); + } + if (hasTestDatasetValidation()) { + hash = (37 * hash) + TEST_DATASET_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + getTestDatasetValidation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata 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 metadata that represents a processor version being created.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.TrainProcessorVersionMetadata) + com.google.cloud.documentai.v1.TrainProcessorVersionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.class, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.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; + } + trainingDatasetValidation_ = null; + if (trainingDatasetValidationBuilder_ != null) { + trainingDatasetValidationBuilder_.dispose(); + trainingDatasetValidationBuilder_ = null; + } + testDatasetValidation_ = null; + if (testDatasetValidationBuilder_ != null) { + testDatasetValidationBuilder_.dispose(); + testDatasetValidationBuilder_ = 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_TrainProcessorVersionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata build() { + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata buildPartial() { + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata result = + new com.google.cloud.documentai.v1.TrainProcessorVersionMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.trainingDatasetValidation_ = + trainingDatasetValidationBuilder_ == null + ? trainingDatasetValidation_ + : trainingDatasetValidationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.testDatasetValidation_ = + testDatasetValidationBuilder_ == null + ? testDatasetValidation_ + : testDatasetValidationBuilder_.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.TrainProcessorVersionMetadata) { + return mergeFrom((com.google.cloud.documentai.v1.TrainProcessorVersionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.TrainProcessorVersionMetadata other) { + if (other + == com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + if (other.hasTrainingDatasetValidation()) { + mergeTrainingDatasetValidation(other.getTrainingDatasetValidation()); + } + if (other.hasTestDatasetValidation()) { + mergeTestDatasetValidation(other.getTestDatasetValidation()); + } + 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 + case 18: + { + input.readMessage( + getTrainingDatasetValidationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getTestDatasetValidationFieldBuilder().getBuilder(), extensionRegistry); + 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 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_; + } + + private com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + trainingDatasetValidation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder> + trainingDatasetValidationBuilder_; + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return Whether the trainingDatasetValidation field is set. + */ + public boolean hasTrainingDatasetValidation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return The trainingDatasetValidation. + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTrainingDatasetValidation() { + if (trainingDatasetValidationBuilder_ == null) { + return trainingDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : trainingDatasetValidation_; + } else { + return trainingDatasetValidationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public Builder setTrainingDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation value) { + if (trainingDatasetValidationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trainingDatasetValidation_ = value; + } else { + trainingDatasetValidationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public Builder setTrainingDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder + builderForValue) { + if (trainingDatasetValidationBuilder_ == null) { + trainingDatasetValidation_ = builderForValue.build(); + } else { + trainingDatasetValidationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public Builder mergeTrainingDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation value) { + if (trainingDatasetValidationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && trainingDatasetValidation_ != null + && trainingDatasetValidation_ + != com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance()) { + getTrainingDatasetValidationBuilder().mergeFrom(value); + } else { + trainingDatasetValidation_ = value; + } + } else { + trainingDatasetValidationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public Builder clearTrainingDatasetValidation() { + bitField0_ = (bitField0_ & ~0x00000002); + trainingDatasetValidation_ = null; + if (trainingDatasetValidationBuilder_ != null) { + trainingDatasetValidationBuilder_.dispose(); + trainingDatasetValidationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder + getTrainingDatasetValidationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTrainingDatasetValidationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTrainingDatasetValidationOrBuilder() { + if (trainingDatasetValidationBuilder_ != null) { + return trainingDatasetValidationBuilder_.getMessageOrBuilder(); + } else { + return trainingDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : trainingDatasetValidation_; + } + } + /** + * + * + *
+     * The training dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder> + getTrainingDatasetValidationFieldBuilder() { + if (trainingDatasetValidationBuilder_ == null) { + trainingDatasetValidationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata + .DatasetValidationOrBuilder>( + getTrainingDatasetValidation(), getParentForChildren(), isClean()); + trainingDatasetValidation_ = null; + } + return trainingDatasetValidationBuilder_; + } + + private com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + testDatasetValidation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder> + testDatasetValidationBuilder_; + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return Whether the testDatasetValidation field is set. + */ + public boolean hasTestDatasetValidation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return The testDatasetValidation. + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTestDatasetValidation() { + if (testDatasetValidationBuilder_ == null) { + return testDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : testDatasetValidation_; + } else { + return testDatasetValidationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public Builder setTestDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation value) { + if (testDatasetValidationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + testDatasetValidation_ = value; + } else { + testDatasetValidationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public Builder setTestDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder + builderForValue) { + if (testDatasetValidationBuilder_ == null) { + testDatasetValidation_ = builderForValue.build(); + } else { + testDatasetValidationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public Builder mergeTestDatasetValidation( + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation value) { + if (testDatasetValidationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && testDatasetValidation_ != null + && testDatasetValidation_ + != com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance()) { + getTestDatasetValidationBuilder().mergeFrom(value); + } else { + testDatasetValidation_ = value; + } + } else { + testDatasetValidationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public Builder clearTestDatasetValidation() { + bitField0_ = (bitField0_ & ~0x00000004); + testDatasetValidation_ = null; + if (testDatasetValidationBuilder_ != null) { + testDatasetValidationBuilder_.dispose(); + testDatasetValidationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder + getTestDatasetValidationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getTestDatasetValidationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTestDatasetValidationOrBuilder() { + if (testDatasetValidationBuilder_ != null) { + return testDatasetValidationBuilder_.getMessageOrBuilder(); + } else { + return testDatasetValidation_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .getDefaultInstance() + : testDatasetValidation_; + } + } + /** + * + * + *
+     * The test dataset validation information.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder> + getTestDatasetValidationFieldBuilder() { + if (testDatasetValidationBuilder_ == null) { + testDatasetValidationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + .Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata + .DatasetValidationOrBuilder>( + getTestDatasetValidation(), getParentForChildren(), isClean()); + testDatasetValidation_ = null; + } + return testDatasetValidationBuilder_; + } + + @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.TrainProcessorVersionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.TrainProcessorVersionMetadata) + private static final com.google.cloud.documentai.v1.TrainProcessorVersionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.TrainProcessorVersionMetadata(); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrainProcessorVersionMetadata 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.TrainProcessorVersionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadataOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadataOrBuilder.java new file mode 100644 index 000000000000..5933c298ca9c --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionMetadataOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface TrainProcessorVersionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.TrainProcessorVersionMetadata) + 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(); + + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return Whether the trainingDatasetValidation field is set. + */ + boolean hasTrainingDatasetValidation(); + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + * + * @return The trainingDatasetValidation. + */ + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTrainingDatasetValidation(); + /** + * + * + *
+   * The training dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * + */ + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTrainingDatasetValidationOrBuilder(); + + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return Whether the testDatasetValidation field is set. + */ + boolean hasTestDatasetValidation(); + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + * + * @return The testDatasetValidation. + */ + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + getTestDatasetValidation(); + /** + * + * + *
+   * The test dataset validation information.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * + */ + com.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidationOrBuilder + getTestDatasetValidationOrBuilder(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequest.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequest.java new file mode 100644 index 000000000000..e921d73495ce --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequest.java @@ -0,0 +1,2810 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * Request message for the create processor version method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionRequest} + */ +public final class TrainProcessorVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.TrainProcessorVersionRequest) + TrainProcessorVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TrainProcessorVersionRequest.newBuilder() to construct. + private TrainProcessorVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TrainProcessorVersionRequest() { + parent_ = ""; + baseProcessorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TrainProcessorVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.class, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.Builder.class); + } + + public interface InputDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return Whether the trainingDocuments field is set. + */ + boolean hasTrainingDocuments(); + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return The trainingDocuments. + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTrainingDocuments(); + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getTrainingDocumentsOrBuilder(); + + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return Whether the testDocuments field is set. + */ + boolean hasTestDocuments(); + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return The testDocuments. + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTestDocuments(); + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder getTestDocumentsOrBuilder(); + } + /** + * + * + *
+   * The input data used to train a new `ProcessorVersion`.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} + */ + public static final class InputData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) + InputDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputData.newBuilder() to construct. + private InputData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.class, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder.class); + } + + public static final int TRAINING_DOCUMENTS_FIELD_NUMBER = 3; + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig trainingDocuments_; + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return Whether the trainingDocuments field is set. + */ + @java.lang.Override + public boolean hasTrainingDocuments() { + return trainingDocuments_ != null; + } + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return The trainingDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTrainingDocuments() { + return trainingDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : trainingDocuments_; + } + /** + * + * + *
+     * The documents used for training the new version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getTrainingDocumentsOrBuilder() { + return trainingDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : trainingDocuments_; + } + + public static final int TEST_DOCUMENTS_FIELD_NUMBER = 4; + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig testDocuments_; + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return Whether the testDocuments field is set. + */ + @java.lang.Override + public boolean hasTestDocuments() { + return testDocuments_ != null; + } + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return The testDocuments. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTestDocuments() { + return testDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : testDocuments_; + } + /** + * + * + *
+     * The documents used for testing the trained version.
+     * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + @java.lang.Override + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getTestDocumentsOrBuilder() { + return testDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : testDocuments_; + } + + 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 (trainingDocuments_ != null) { + output.writeMessage(3, getTrainingDocuments()); + } + if (testDocuments_ != null) { + output.writeMessage(4, getTestDocuments()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (trainingDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTrainingDocuments()); + } + if (testDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTestDocuments()); + } + 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.TrainProcessorVersionRequest.InputData)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData other = + (com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) obj; + + if (hasTrainingDocuments() != other.hasTrainingDocuments()) return false; + if (hasTrainingDocuments()) { + if (!getTrainingDocuments().equals(other.getTrainingDocuments())) return false; + } + if (hasTestDocuments() != other.hasTestDocuments()) return false; + if (hasTestDocuments()) { + if (!getTestDocuments().equals(other.getTestDocuments())) 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 (hasTrainingDocuments()) { + hash = (37 * hash) + TRAINING_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getTrainingDocuments().hashCode(); + } + if (hasTestDocuments()) { + hash = (37 * hash) + TEST_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getTestDocuments().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + 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.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData 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.TrainProcessorVersionRequest.InputData 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 input data used to train a new `ProcessorVersion`.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_InputData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.class, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder + .class); + } + + // Construct using + // com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + trainingDocuments_ = null; + if (trainingDocumentsBuilder_ != null) { + trainingDocumentsBuilder_.dispose(); + trainingDocumentsBuilder_ = null; + } + testDocuments_ = null; + if (testDocumentsBuilder_ != null) { + testDocumentsBuilder_.dispose(); + testDocumentsBuilder_ = 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_TrainProcessorVersionRequest_InputData_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData build() { + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData buildPartial() { + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData result = + new com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.trainingDocuments_ = + trainingDocumentsBuilder_ == null + ? trainingDocuments_ + : trainingDocumentsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.testDocuments_ = + testDocumentsBuilder_ == null ? testDocuments_ : testDocumentsBuilder_.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.TrainProcessorVersionRequest.InputData) { + return mergeFrom( + (com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData other) { + if (other + == com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + .getDefaultInstance()) return this; + if (other.hasTrainingDocuments()) { + mergeTrainingDocuments(other.getTrainingDocuments()); + } + if (other.hasTestDocuments()) { + mergeTestDocuments(other.getTestDocuments()); + } + 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 26: + { + input.readMessage( + getTrainingDocumentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 26 + case 34: + { + input.readMessage(getTestDocumentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 34 + 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.BatchDocumentsInputConfig trainingDocuments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + trainingDocumentsBuilder_; + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return Whether the trainingDocuments field is set. + */ + public boolean hasTrainingDocuments() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * + * @return The trainingDocuments. + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTrainingDocuments() { + if (trainingDocumentsBuilder_ == null) { + return trainingDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : trainingDocuments_; + } else { + return trainingDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public Builder setTrainingDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (trainingDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trainingDocuments_ = value; + } else { + trainingDocumentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public Builder setTrainingDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder builderForValue) { + if (trainingDocumentsBuilder_ == null) { + trainingDocuments_ = builderForValue.build(); + } else { + trainingDocumentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public Builder mergeTrainingDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (trainingDocumentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && trainingDocuments_ != null + && trainingDocuments_ + != com.google.cloud.documentai.v1.BatchDocumentsInputConfig + .getDefaultInstance()) { + getTrainingDocumentsBuilder().mergeFrom(value); + } else { + trainingDocuments_ = value; + } + } else { + trainingDocumentsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public Builder clearTrainingDocuments() { + bitField0_ = (bitField0_ & ~0x00000001); + trainingDocuments_ = null; + if (trainingDocumentsBuilder_ != null) { + trainingDocumentsBuilder_.dispose(); + trainingDocumentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder + getTrainingDocumentsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTrainingDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getTrainingDocumentsOrBuilder() { + if (trainingDocumentsBuilder_ != null) { + return trainingDocumentsBuilder_.getMessageOrBuilder(); + } else { + return trainingDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : trainingDocuments_; + } + } + /** + * + * + *
+       * The documents used for training the new version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + getTrainingDocumentsFieldBuilder() { + if (trainingDocumentsBuilder_ == null) { + trainingDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder>( + getTrainingDocuments(), getParentForChildren(), isClean()); + trainingDocuments_ = null; + } + return trainingDocumentsBuilder_; + } + + private com.google.cloud.documentai.v1.BatchDocumentsInputConfig testDocuments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + testDocumentsBuilder_; + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return Whether the testDocuments field is set. + */ + public boolean hasTestDocuments() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * + * @return The testDocuments. + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig getTestDocuments() { + if (testDocumentsBuilder_ == null) { + return testDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : testDocuments_; + } else { + return testDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public Builder setTestDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (testDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + testDocuments_ = value; + } else { + testDocumentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public Builder setTestDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder builderForValue) { + if (testDocumentsBuilder_ == null) { + testDocuments_ = builderForValue.build(); + } else { + testDocumentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public Builder mergeTestDocuments( + com.google.cloud.documentai.v1.BatchDocumentsInputConfig value) { + if (testDocumentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && testDocuments_ != null + && testDocuments_ + != com.google.cloud.documentai.v1.BatchDocumentsInputConfig + .getDefaultInstance()) { + getTestDocumentsBuilder().mergeFrom(value); + } else { + testDocuments_ = value; + } + } else { + testDocumentsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public Builder clearTestDocuments() { + bitField0_ = (bitField0_ & ~0x00000002); + testDocuments_ = null; + if (testDocumentsBuilder_ != null) { + testDocumentsBuilder_.dispose(); + testDocumentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder + getTestDocumentsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTestDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + public com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder + getTestDocumentsOrBuilder() { + if (testDocumentsBuilder_ != null) { + return testDocumentsBuilder_.getMessageOrBuilder(); + } else { + return testDocuments_ == null + ? com.google.cloud.documentai.v1.BatchDocumentsInputConfig.getDefaultInstance() + : testDocuments_; + } + } + /** + * + * + *
+       * The documents used for testing the trained version.
+       * 
+ * + * .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder> + getTestDocumentsFieldBuilder() { + if (testDocumentsBuilder_ == null) { + testDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.BatchDocumentsInputConfig, + com.google.cloud.documentai.v1.BatchDocumentsInputConfig.Builder, + com.google.cloud.documentai.v1.BatchDocumentsInputConfigOrBuilder>( + getTestDocuments(), getParentForChildren(), isClean()); + testDocuments_ = null; + } + return testDocumentsBuilder_; + } + + @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.TrainProcessorVersionRequest.InputData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) + private static final com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData(); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputData 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.TrainProcessorVersionRequest.InputData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent (project, location and processor) to create the new
+   * version for. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent (project, location and processor) to create the new
+   * version for. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROCESSOR_VERSION_FIELD_NUMBER = 2; + private com.google.cloud.documentai.v1.ProcessorVersion processorVersion_; + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processorVersion field is set. + */ + @java.lang.Override + public boolean hasProcessorVersion() { + return processorVersion_ != null; + } + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processorVersion. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersion() { + return processorVersion_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance() + : processorVersion_; + } + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionOrBuilder() { + return processorVersion_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance() + : processorVersion_; + } + + public static final int DOCUMENT_SCHEMA_FIELD_NUMBER = 10; + private com.google.cloud.documentai.v1.DocumentSchema documentSchema_; + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentSchema field is set. + */ + @java.lang.Override + public boolean hasDocumentSchema() { + return documentSchema_ != null; + } + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentSchema. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema() { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + + public static final int INPUT_DATA_FIELD_NUMBER = 4; + private com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData inputData_; + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputData field is set. + */ + @java.lang.Override + public boolean hasInputData() { + return inputData_ != null; + } + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputData. + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData getInputData() { + return inputData_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.getDefaultInstance() + : inputData_; + } + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder + getInputDataOrBuilder() { + return inputData_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.getDefaultInstance() + : inputData_; + } + + public static final int BASE_PROCESSOR_VERSION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object baseProcessorVersion_ = ""; + /** + * + * + *
+   * Optional. The processor version to use as a base for training. This
+   * processor version must be a child of `parent`. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+   * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The baseProcessorVersion. + */ + @java.lang.Override + public java.lang.String getBaseProcessorVersion() { + java.lang.Object ref = baseProcessorVersion_; + 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(); + baseProcessorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The processor version to use as a base for training. This
+   * processor version must be a child of `parent`. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+   * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for baseProcessorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBaseProcessorVersionBytes() { + java.lang.Object ref = baseProcessorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (processorVersion_ != null) { + output.writeMessage(2, getProcessorVersion()); + } + if (inputData_ != null) { + output.writeMessage(4, getInputData()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseProcessorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, baseProcessorVersion_); + } + if (documentSchema_ != null) { + output.writeMessage(10, getDocumentSchema()); + } + 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 (processorVersion_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProcessorVersion()); + } + if (inputData_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getInputData()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseProcessorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, baseProcessorVersion_); + } + if (documentSchema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getDocumentSchema()); + } + 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.TrainProcessorVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.TrainProcessorVersionRequest other = + (com.google.cloud.documentai.v1.TrainProcessorVersionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasProcessorVersion() != other.hasProcessorVersion()) return false; + if (hasProcessorVersion()) { + if (!getProcessorVersion().equals(other.getProcessorVersion())) return false; + } + if (hasDocumentSchema() != other.hasDocumentSchema()) return false; + if (hasDocumentSchema()) { + if (!getDocumentSchema().equals(other.getDocumentSchema())) return false; + } + if (hasInputData() != other.hasInputData()) return false; + if (hasInputData()) { + if (!getInputData().equals(other.getInputData())) return false; + } + if (!getBaseProcessorVersion().equals(other.getBaseProcessorVersion())) 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 (hasProcessorVersion()) { + hash = (37 * hash) + PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getProcessorVersion().hashCode(); + } + if (hasDocumentSchema()) { + hash = (37 * hash) + DOCUMENT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentSchema().hashCode(); + } + if (hasInputData()) { + hash = (37 * hash) + INPUT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getInputData().hashCode(); + } + hash = (37 * hash) + BASE_PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getBaseProcessorVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest 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.TrainProcessorVersionRequest 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 create processor version method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.TrainProcessorVersionRequest) + com.google.cloud.documentai.v1.TrainProcessorVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.class, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.TrainProcessorVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + processorVersion_ = null; + if (processorVersionBuilder_ != null) { + processorVersionBuilder_.dispose(); + processorVersionBuilder_ = null; + } + documentSchema_ = null; + if (documentSchemaBuilder_ != null) { + documentSchemaBuilder_.dispose(); + documentSchemaBuilder_ = null; + } + inputData_ = null; + if (inputDataBuilder_ != null) { + inputDataBuilder_.dispose(); + inputDataBuilder_ = null; + } + baseProcessorVersion_ = ""; + 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_TrainProcessorVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.TrainProcessorVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest build() { + com.google.cloud.documentai.v1.TrainProcessorVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest buildPartial() { + com.google.cloud.documentai.v1.TrainProcessorVersionRequest result = + new com.google.cloud.documentai.v1.TrainProcessorVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.documentai.v1.TrainProcessorVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.processorVersion_ = + processorVersionBuilder_ == null ? processorVersion_ : processorVersionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentSchema_ = + documentSchemaBuilder_ == null ? documentSchema_ : documentSchemaBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.inputData_ = inputDataBuilder_ == null ? inputData_ : inputDataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.baseProcessorVersion_ = baseProcessorVersion_; + } + } + + @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.TrainProcessorVersionRequest) { + return mergeFrom((com.google.cloud.documentai.v1.TrainProcessorVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.TrainProcessorVersionRequest other) { + if (other == com.google.cloud.documentai.v1.TrainProcessorVersionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasProcessorVersion()) { + mergeProcessorVersion(other.getProcessorVersion()); + } + if (other.hasDocumentSchema()) { + mergeDocumentSchema(other.getDocumentSchema()); + } + if (other.hasInputData()) { + mergeInputData(other.getInputData()); + } + if (!other.getBaseProcessorVersion().isEmpty()) { + baseProcessorVersion_ = other.baseProcessorVersion_; + bitField0_ |= 0x00000010; + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getProcessorVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getInputDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 66: + { + baseProcessorVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 66 + case 82: + { + input.readMessage(getDocumentSchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 82 + 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, location and processor) to create the new
+     * version for. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to create the new
+     * version for. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to create the new
+     * version for. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to create the new
+     * version for. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent (project, location and processor) to create the new
+     * version for. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.documentai.v1.ProcessorVersion processorVersion_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder> + processorVersionBuilder_; + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processorVersion field is set. + */ + public boolean hasProcessorVersion() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processorVersion. + */ + public com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersion() { + if (processorVersionBuilder_ == null) { + return processorVersion_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance() + : processorVersion_; + } else { + return processorVersionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessorVersion(com.google.cloud.documentai.v1.ProcessorVersion value) { + if (processorVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + processorVersion_ = value; + } else { + processorVersionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProcessorVersion( + com.google.cloud.documentai.v1.ProcessorVersion.Builder builderForValue) { + if (processorVersionBuilder_ == null) { + processorVersion_ = builderForValue.build(); + } else { + processorVersionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProcessorVersion(com.google.cloud.documentai.v1.ProcessorVersion value) { + if (processorVersionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && processorVersion_ != null + && processorVersion_ + != com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance()) { + getProcessorVersionBuilder().mergeFrom(value); + } else { + processorVersion_ = value; + } + } else { + processorVersionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProcessorVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + processorVersion_ = null; + if (processorVersionBuilder_ != null) { + processorVersionBuilder_.dispose(); + processorVersionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.ProcessorVersion.Builder getProcessorVersionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getProcessorVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionOrBuilder() { + if (processorVersionBuilder_ != null) { + return processorVersionBuilder_.getMessageOrBuilder(); + } else { + return processorVersion_ == null + ? com.google.cloud.documentai.v1.ProcessorVersion.getDefaultInstance() + : processorVersion_; + } + } + /** + * + * + *
+     * Required. The processor version to be created.
+     * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder> + getProcessorVersionFieldBuilder() { + if (processorVersionBuilder_ == null) { + processorVersionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.ProcessorVersion, + com.google.cloud.documentai.v1.ProcessorVersion.Builder, + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder>( + getProcessorVersion(), getParentForChildren(), isClean()); + processorVersion_ = null; + } + return processorVersionBuilder_; + } + + private com.google.cloud.documentai.v1.DocumentSchema documentSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder> + documentSchemaBuilder_; + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentSchema field is set. + */ + public boolean hasDocumentSchema() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentSchema. + */ + public com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema() { + if (documentSchemaBuilder_ == null) { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } else { + return documentSchemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentSchema(com.google.cloud.documentai.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentSchema_ = value; + } else { + documentSchemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentSchema( + com.google.cloud.documentai.v1.DocumentSchema.Builder builderForValue) { + if (documentSchemaBuilder_ == null) { + documentSchema_ = builderForValue.build(); + } else { + documentSchemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentSchema(com.google.cloud.documentai.v1.DocumentSchema value) { + if (documentSchemaBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && documentSchema_ != null + && documentSchema_ + != com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance()) { + getDocumentSchemaBuilder().mergeFrom(value); + } else { + documentSchema_ = value; + } + } else { + documentSchemaBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentSchema() { + bitField0_ = (bitField0_ & ~0x00000004); + documentSchema_ = null; + if (documentSchemaBuilder_ != null) { + documentSchemaBuilder_.dispose(); + documentSchemaBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.DocumentSchema.Builder getDocumentSchemaBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDocumentSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder() { + if (documentSchemaBuilder_ != null) { + return documentSchemaBuilder_.getMessageOrBuilder(); + } else { + return documentSchema_ == null + ? com.google.cloud.documentai.v1.DocumentSchema.getDefaultInstance() + : documentSchema_; + } + } + /** + * + * + *
+     * Optional. The schema the processor version will be trained with.
+     * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder> + getDocumentSchemaFieldBuilder() { + if (documentSchemaBuilder_ == null) { + documentSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.DocumentSchema, + com.google.cloud.documentai.v1.DocumentSchema.Builder, + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder>( + getDocumentSchema(), getParentForChildren(), isClean()); + documentSchema_ = null; + } + return documentSchemaBuilder_; + } + + private com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData inputData_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder> + inputDataBuilder_; + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputData field is set. + */ + public boolean hasInputData() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputData. + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData getInputData() { + if (inputDataBuilder_ == null) { + return inputData_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + .getDefaultInstance() + : inputData_; + } else { + return inputDataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputData( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData value) { + if (inputDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputData_ = value; + } else { + inputDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputData( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder + builderForValue) { + if (inputDataBuilder_ == null) { + inputData_ = builderForValue.build(); + } else { + inputDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeInputData( + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData value) { + if (inputDataBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && inputData_ != null + && inputData_ + != com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + .getDefaultInstance()) { + getInputDataBuilder().mergeFrom(value); + } else { + inputData_ = value; + } + } else { + inputDataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearInputData() { + bitField0_ = (bitField0_ & ~0x00000008); + inputData_ = null; + if (inputDataBuilder_ != null) { + inputDataBuilder_.dispose(); + inputDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder + getInputDataBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getInputDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder + getInputDataOrBuilder() { + if (inputDataBuilder_ != null) { + return inputDataBuilder_.getMessageOrBuilder(); + } else { + return inputData_ == null + ? com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + .getDefaultInstance() + : inputData_; + } + } + /** + * + * + *
+     * Optional. The input data used to train the `ProcessorVersion`.
+     * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder> + getInputDataFieldBuilder() { + if (inputDataBuilder_ == null) { + inputDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.Builder, + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder>( + getInputData(), getParentForChildren(), isClean()); + inputData_ = null; + } + return inputDataBuilder_; + } + + private java.lang.Object baseProcessorVersion_ = ""; + /** + * + * + *
+     * Optional. The processor version to use as a base for training. This
+     * processor version must be a child of `parent`. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+     * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The baseProcessorVersion. + */ + public java.lang.String getBaseProcessorVersion() { + java.lang.Object ref = baseProcessorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseProcessorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The processor version to use as a base for training. This
+     * processor version must be a child of `parent`. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+     * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for baseProcessorVersion. + */ + public com.google.protobuf.ByteString getBaseProcessorVersionBytes() { + java.lang.Object ref = baseProcessorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseProcessorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The processor version to use as a base for training. This
+     * processor version must be a child of `parent`. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+     * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The baseProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setBaseProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + baseProcessorVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The processor version to use as a base for training. This
+     * processor version must be a child of `parent`. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+     * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearBaseProcessorVersion() { + baseProcessorVersion_ = getDefaultInstance().getBaseProcessorVersion(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The processor version to use as a base for training. This
+     * processor version must be a child of `parent`. Format:
+     * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+     * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for baseProcessorVersion to set. + * @return This builder for chaining. + */ + public Builder setBaseProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + baseProcessorVersion_ = value; + bitField0_ |= 0x00000010; + 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.TrainProcessorVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.TrainProcessorVersionRequest) + private static final com.google.cloud.documentai.v1.TrainProcessorVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.TrainProcessorVersionRequest(); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrainProcessorVersionRequest 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.TrainProcessorVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequestOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequestOrBuilder.java new file mode 100644 index 000000000000..8355711f0eaa --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionRequestOrBuilder.java @@ -0,0 +1,211 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface TrainProcessorVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.TrainProcessorVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent (project, location and processor) to create the new
+   * version for. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent (project, location and processor) to create the new
+   * version for. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the processorVersion field is set. + */ + boolean hasProcessorVersion(); + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The processorVersion. + */ + com.google.cloud.documentai.v1.ProcessorVersion getProcessorVersion(); + /** + * + * + *
+   * Required. The processor version to be created.
+   * 
+ * + * + * .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1.ProcessorVersionOrBuilder getProcessorVersionOrBuilder(); + + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentSchema field is set. + */ + boolean hasDocumentSchema(); + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentSchema. + */ + com.google.cloud.documentai.v1.DocumentSchema getDocumentSchema(); + /** + * + * + *
+   * Optional. The schema the processor version will be trained with.
+   * 
+ * + * + * .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.documentai.v1.DocumentSchemaOrBuilder getDocumentSchemaOrBuilder(); + + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputData field is set. + */ + boolean hasInputData(); + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputData. + */ + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData getInputData(); + /** + * + * + *
+   * Optional. The input data used to train the `ProcessorVersion`.
+   * 
+ * + * + * .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputDataOrBuilder + getInputDataOrBuilder(); + + /** + * + * + *
+   * Optional. The processor version to use as a base for training. This
+   * processor version must be a child of `parent`. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+   * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The baseProcessorVersion. + */ + java.lang.String getBaseProcessorVersion(); + /** + * + * + *
+   * Optional. The processor version to use as a base for training. This
+   * processor version must be a child of `parent`. Format:
+   * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
+   * 
+ * + * string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for baseProcessorVersion. + */ + com.google.protobuf.ByteString getBaseProcessorVersionBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponse.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponse.java new file mode 100644 index 000000000000..c29743c949c5 --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponse.java @@ -0,0 +1,634 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +/** + * + * + *
+ * The response for the TrainProcessorVersion method.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionResponse} + */ +public final class TrainProcessorVersionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1.TrainProcessorVersionResponse) + TrainProcessorVersionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TrainProcessorVersionResponse.newBuilder() to construct. + private TrainProcessorVersionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TrainProcessorVersionResponse() { + processorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TrainProcessorVersionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionResponse.class, + com.google.cloud.documentai.v1.TrainProcessorVersionResponse.Builder.class); + } + + public static final int PROCESSOR_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object processorVersion_ = ""; + /** + * + * + *
+   * The resource name of the processor version produced by training.
+   * 
+ * + * string processor_version = 1; + * + * @return The processorVersion. + */ + @java.lang.Override + public java.lang.String getProcessorVersion() { + java.lang.Object ref = processorVersion_; + 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(); + processorVersion_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the processor version produced by training.
+   * 
+ * + * string processor_version = 1; + * + * @return The bytes for processorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProcessorVersionBytes() { + java.lang.Object ref = processorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processorVersion_ = 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(processorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, processorVersion_); + } + 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(processorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, processorVersion_); + } + 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.TrainProcessorVersionResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1.TrainProcessorVersionResponse other = + (com.google.cloud.documentai.v1.TrainProcessorVersionResponse) obj; + + if (!getProcessorVersion().equals(other.getProcessorVersion())) 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) + PROCESSOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getProcessorVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse 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.TrainProcessorVersionResponse 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 response for the TrainProcessorVersion method.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1.TrainProcessorVersionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1.TrainProcessorVersionResponse) + com.google.cloud.documentai.v1.TrainProcessorVersionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1.DocumentAiProcessorService + .internal_static_google_cloud_documentai_v1_TrainProcessorVersionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1.TrainProcessorVersionResponse.class, + com.google.cloud.documentai.v1.TrainProcessorVersionResponse.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1.TrainProcessorVersionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + processorVersion_ = ""; + 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_TrainProcessorVersionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1.TrainProcessorVersionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionResponse build() { + com.google.cloud.documentai.v1.TrainProcessorVersionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1.TrainProcessorVersionResponse buildPartial() { + com.google.cloud.documentai.v1.TrainProcessorVersionResponse result = + new com.google.cloud.documentai.v1.TrainProcessorVersionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.documentai.v1.TrainProcessorVersionResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.processorVersion_ = processorVersion_; + } + } + + @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.TrainProcessorVersionResponse) { + return mergeFrom((com.google.cloud.documentai.v1.TrainProcessorVersionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1.TrainProcessorVersionResponse other) { + if (other + == com.google.cloud.documentai.v1.TrainProcessorVersionResponse.getDefaultInstance()) + return this; + if (!other.getProcessorVersion().isEmpty()) { + processorVersion_ = other.processorVersion_; + 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: + { + processorVersion_ = 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 processorVersion_ = ""; + /** + * + * + *
+     * The resource name of the processor version produced by training.
+     * 
+ * + * string processor_version = 1; + * + * @return The processorVersion. + */ + public java.lang.String getProcessorVersion() { + java.lang.Object ref = processorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + processorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version produced by training.
+     * 
+ * + * string processor_version = 1; + * + * @return The bytes for processorVersion. + */ + public com.google.protobuf.ByteString getProcessorVersionBytes() { + java.lang.Object ref = processorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + processorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the processor version produced by training.
+     * 
+ * + * string processor_version = 1; + * + * @param value The processorVersion to set. + * @return This builder for chaining. + */ + public Builder setProcessorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + processorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version produced by training.
+     * 
+ * + * string processor_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearProcessorVersion() { + processorVersion_ = getDefaultInstance().getProcessorVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the processor version produced by training.
+     * 
+ * + * string processor_version = 1; + * + * @param value The bytes for processorVersion to set. + * @return This builder for chaining. + */ + public Builder setProcessorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + processorVersion_ = 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.TrainProcessorVersionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1.TrainProcessorVersionResponse) + private static final com.google.cloud.documentai.v1.TrainProcessorVersionResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1.TrainProcessorVersionResponse(); + } + + public static com.google.cloud.documentai.v1.TrainProcessorVersionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrainProcessorVersionResponse 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.TrainProcessorVersionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponseOrBuilder.java b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponseOrBuilder.java new file mode 100644 index 000000000000..93127e1af47a --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/TrainProcessorVersionResponseOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/documentai/v1/document_processor_service.proto + +package com.google.cloud.documentai.v1; + +public interface TrainProcessorVersionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1.TrainProcessorVersionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the processor version produced by training.
+   * 
+ * + * string processor_version = 1; + * + * @return The processorVersion. + */ + java.lang.String getProcessorVersion(); + /** + * + * + *
+   * The resource name of the processor version produced by training.
+   * 
+ * + * string processor_version = 1; + * + * @return The bytes for processorVersion. + */ + com.google.protobuf.ByteString getProcessorVersionBytes(); +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto index 18620dbca060..f3431b3d4af3 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto @@ -735,22 +735,29 @@ message Document { // Remove an element identified by `parent`. REMOVE = 2; - // Replace an element identified by `parent`. + // Updates any fields within the given provenance scope of the message. It + // 'overwrites' the fields rather than replacing them. This is + // especially relevant when we just want to update a field value of an + // entity without also affecting all the child properties. + UPDATE = 7; + + // Currently unused. Replace an element identified by `parent`. REPLACE = 3; - // Request human review for the element identified by `parent`. - EVAL_REQUESTED = 4; + // Deprecated. Request human review for the element identified by + // `parent`. + EVAL_REQUESTED = 4 [deprecated = true]; - // Element is reviewed and approved at human review, confidence will be - // set to 1.0. - EVAL_APPROVED = 5; + // Deprecated. Element is reviewed and approved at human review, + // confidence will be set to 1.0. + EVAL_APPROVED = 5 [deprecated = true]; - // Element is skipped in the validation process. - EVAL_SKIPPED = 6; + // Deprecated. Element is skipped in the validation process. + EVAL_SKIPPED = 6 [deprecated = true]; } // The index of the revision that produced this element. - int32 revision = 1; + int32 revision = 1 [deprecated = true]; // The Id of this operation. Needs to be unique within the scope of the // revision. @@ -786,7 +793,8 @@ message Document { string processor = 5; } - // Id of the revision. Unique within the context of the document. + // Id of the revision, internally generated by doc proto storage. + // Unique within the context of the document. string id = 1; // The revisions that this revision is based on. This can include one or @@ -799,7 +807,8 @@ message Document { // `provenance.parent.revision` fields that index into this field. repeated string parent_ids = 7; - // The time that the revision was created. + // The time that the revision was created, internally generated by + // doc proto storage at the time of create. google.protobuf.Timestamp create_time = 3; // Human Review information of this revision. diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto index 814cc94cc1f3..eec77bd88e4b 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_processor_service.proto @@ -23,10 +23,12 @@ import "google/api/resource.proto"; import "google/cloud/documentai/v1/document.proto"; import "google/cloud/documentai/v1/document_io.proto"; import "google/cloud/documentai/v1/document_schema.proto"; +import "google/cloud/documentai/v1/evaluation.proto"; import "google/cloud/documentai/v1/operation_metadata.proto"; import "google/cloud/documentai/v1/processor.proto"; import "google/cloud/documentai/v1/processor_type.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -131,6 +133,22 @@ service DocumentProcessorService { option (google.api.method_signature) = "name"; } + // Trains a new processor version. + // Operation metadata is returned as + // cloud_documentai_core.TrainProcessorVersionMetadata. + rpc TrainProcessorVersion(TrainProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train" + body: "*" + }; + option (google.api.method_signature) = "parent,processor_version"; + option (google.longrunning.operation_info) = { + response_type: "TrainProcessorVersionResponse" + metadata_type: "TrainProcessorVersionMetadata" + }; + } + // Gets a processor version detail. rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) { @@ -272,6 +290,38 @@ service DocumentProcessorService { metadata_type: "ReviewDocumentOperationMetadata" }; } + + // Evaluates a ProcessorVersion against annotated documents, producing an + // Evaluation. + rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion" + body: "*" + }; + option (google.api.method_signature) = "processor_version"; + option (google.longrunning.operation_info) = { + response_type: "EvaluateProcessorVersionResponse" + metadata_type: "EvaluateProcessorVersionMetadata" + }; + } + + // Retrieves a specific evaluation. + rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a set of evaluations for a given processor version. + rpc ListEvaluations(ListEvaluationsRequest) + returns (ListEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } } // Request message for the process document method. @@ -758,6 +808,81 @@ message SetDefaultProcessorVersionMetadata { CommonOperationMetadata common_metadata = 1; } +// Request message for the create processor version method. +message TrainProcessorVersionRequest { + // The input data used to train a new `ProcessorVersion`. + message InputData { + // The documents used for training the new version. + BatchDocumentsInputConfig training_documents = 3; + + // The documents used for testing the trained version. + BatchDocumentsInputConfig test_documents = 4; + } + + // Required. The parent (project, location and processor) to create the new + // version for. Format: + // `projects/{project}/locations/{location}/processors/{processor}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The processor version to be created. + ProcessorVersion processor_version = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The schema the processor version will be trained with. + DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The input data used to train the `ProcessorVersion`. + InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The processor version to use as a base for training. This + // processor version must be a child of `parent`. Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for the TrainProcessorVersion method. +message TrainProcessorVersionResponse { + // The resource name of the processor version produced by training. + string processor_version = 1; +} + +// The metadata that represents a processor version being created. +message TrainProcessorVersionMetadata { + // The dataset validation information. + // This includes any and all errors with documents and the dataset. + message DatasetValidation { + // The total number of document errors. + int32 document_error_count = 3; + + // The total number of dataset errors. + int32 dataset_error_count = 4; + + // Error information pertaining to specific documents. A maximum of 10 + // document errors will be returned. + // Any document with errors will not be used throughout training. + repeated google.rpc.Status document_errors = 1; + + // Error information for the dataset as a whole. A maximum of 10 dataset + // errors will be returned. + // A single dataset error is terminal for training. + repeated google.rpc.Status dataset_errors = 2; + } + + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; + + // The training dataset validation information. + DatasetValidation training_dataset_validation = 2; + + // The test dataset validation information. + DatasetValidation test_dataset_validation = 3; +} + // Request message for review document method. message ReviewDocumentRequest { // The priority level of the human review task. @@ -828,3 +953,80 @@ message ReviewDocumentOperationMetadata { // The Crowd Compute question ID. string question_id = 6; } + +// Evaluates the given ProcessorVersion against the supplied documents. +message EvaluateProcessorVersionRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + // evaluate. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string processor_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // Optional. The documents used in the evaluation. If unspecified, use the + // processor's dataset as evaluation input. + BatchDocumentsInputConfig evaluation_documents = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata of the EvaluateProcessorVersion method. +message EvaluateProcessorVersionMetadata { + // The basic metadata of the long running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Metadata of the EvaluateProcessorVersion method. +message EvaluateProcessorVersionResponse { + // The resource name of the created evaluation. + string evaluation = 2; +} + +// Retrieves a specific Evaluation. +message GetEvaluationRequest { + // Required. The resource name of the + // [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Evaluation" + } + ]; +} + +// Retrieves a list of evaluations for a given ProcessorVersion. +message ListEvaluationsRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + // evaluations for. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // The standard list page size. + // If unspecified, at most 5 evaluations will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous `ListEvaluations` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// The response from ListEvaluations. +message ListEvaluationsResponse { + // The evaluations requested. + repeated Evaluation evaluations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto index 3fffba9fadbd..0b2cf60c1e04 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document_schema.proto @@ -38,20 +38,28 @@ message DocumentSchema { // Defines properties that can be part of the entity type. message Property { - // Types of occurrences of the entity type in the document. Note: this - // represents the number of instances of an entity types, not number of - // mentions of a given entity instance. + // Types of occurrences of the entity type in the document. This + // represents the number of instances of instances of an entity, not + // number of mentions of an entity. For example, a bank statement may + // only have one `account_number`, but this account number may be + // mentioned in several places on the document. In this case the + // 'account_number' would be considered a `REQUIRED_ONCE` entity type. If, + // on the other hand, we expect a bank statement to contain the status of + // multiple different accounts for the customers, the occurrence type will + // be set to `REQUIRED_MULTIPLE`. enum OccurrenceType { // Unspecified occurrence type. OCCURRENCE_TYPE_UNSPECIFIED = 0; - // There will be zero or one instance of this entity type. + // There will be zero or one instance of this entity type. The same + // entity instance may be mentioned multiple times. OPTIONAL_ONCE = 1; // The entity type will appear zero or multiple times. OPTIONAL_MULTIPLE = 2; - // The entity type will only appear exactly once. + // The entity type will only appear exactly once. The same + // entity instance may be mentioned multiple times. REQUIRED_ONCE = 3; // The entity type will appear once or more times. @@ -103,7 +111,7 @@ message DocumentSchema { // one should be set. repeated string base_types = 2; - // Describing the nested structure, or composition of an entity. + // Description the nested structure, or composition of an entity. repeated Property properties = 6; } diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/evaluation.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/evaluation.proto new file mode 100644 index 000000000000..0662470a8b2b --- /dev/null +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/evaluation.proto @@ -0,0 +1,181 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.documentai.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiEvaluation"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Gives a short summary of an evaluation, and links to the evaluation itself. +message EvaluationReference { + // The resource name of the Long Running Operation for the evaluation. + string operation = 1; + + // The resource name of the evaluation. + string evaluation = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/Evaluation" + }]; + + // An aggregate of the statistics for the evaluation with fuzzy matching on. + Evaluation.Metrics aggregate_metrics = 4; + + // An aggregate of the statistics for the evaluation with fuzzy matching off. + Evaluation.Metrics aggregate_metrics_exact = 5; +} + +// An evaluation of a ProcessorVersion's performance. +message Evaluation { + option (google.api.resource) = { + type: "documentai.googleapis.com/Evaluation" + pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" + }; + + // Evaluation counters for the documents that were used. + message Counters { + // How many documents were sent for evaluation. + int32 input_documents_count = 1; + + // How many documents were not included in the evaluation as they didn't + // pass validation. + int32 invalid_documents_count = 2; + + // How many documents were not included in the evaluation as Document AI + // failed to process them. + int32 failed_documents_count = 3; + + // How many documents were used in the evaluation. + int32 evaluated_documents_count = 4; + } + + // Evaluation metrics, either in aggregate or about a specific entity. + message Metrics { + // The calculated precision. + float precision = 1; + + // The calculated recall. + float recall = 2; + + // The calculated f1 score. + float f1_score = 3; + + // The amount of occurrences in predicted documents. + int32 predicted_occurrences_count = 4; + + // The amount of occurrences in ground truth documents. + int32 ground_truth_occurrences_count = 5; + + // The amount of documents with a predicted occurrence. + int32 predicted_document_count = 10; + + // The amount of documents with a ground truth occurrence. + int32 ground_truth_document_count = 11; + + // The amount of true positives. + int32 true_positives_count = 6; + + // The amount of false positives. + int32 false_positives_count = 7; + + // The amount of false negatives. + int32 false_negatives_count = 8; + + // The amount of documents that had an occurrence of this label. + int32 total_documents_count = 9; + } + + // Evaluations metrics, at a specific confidence level. + message ConfidenceLevelMetrics { + // The confidence level. + float confidence_level = 1; + + // The metrics at the specific confidence level. + Metrics metrics = 2; + } + + // Metrics across multiple confidence levels. + message MultiConfidenceMetrics { + // A type that determines how metrics should be interpreted. + enum MetricsType { + // The metrics type is unspecified. By default, metrics without a + // particular specification are for leaf entity types (i.e., top-level + // entity types without child types, or child types which are not + // parent types themselves). + METRICS_TYPE_UNSPECIFIED = 0; + + // Indicates whether metrics for this particular label type represent an + // aggregate of metrics for other types instead of being based on actual + // TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + // entity types are an aggregate of metrics for their children. + AGGREGATE = 1; + } + + // Metrics across confidence levels with fuzzy matching enabled. + repeated ConfidenceLevelMetrics confidence_level_metrics = 1; + + // Metrics across confidence levels with only exact matching. + repeated ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + + // The calculated area under the precision recall curve (AUPRC), computed by + // integrating over all confidence thresholds. + float auprc = 2; + + // The Estimated Calibration Error (ECE) of the confidence of the predicted + // entities. + float estimated_calibration_error = 3; + + // The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + // only. + float auprc_exact = 5; + + // The ECE for the predicted entities with fuzzy matching disabled, i.e., + // exact matching only. + float estimated_calibration_error_exact = 6; + + // The metrics type for the label. + MetricsType metrics_type = 7; + } + + // The resource name of the evaluation. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + string name = 1; + + // The time that the evaluation was created. + google.protobuf.Timestamp create_time = 2; + + // Counters for the documents used in the evaluation. + Counters document_counters = 5; + + // Metrics for all the entities in aggregate. + MultiConfidenceMetrics all_entities_metrics = 3; + + // Metrics across confidence levels, for different entities. + map entity_metrics = 4; + + // The KMS key name used for encryption. + string kms_key_name = 6; + + // The KMS key version with which data is encrypted. + string kms_key_version_name = 7; +} diff --git a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto index 4dabe48fe6f5..8c257c548b6e 100644 --- a/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto +++ b/java-document-ai/proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/processor.proto @@ -19,6 +19,7 @@ package google.cloud.documentai.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/documentai/v1/document_schema.proto"; +import "google/cloud/documentai/v1/evaluation.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1"; @@ -96,6 +97,9 @@ message ProcessorVersion { // The time the processor version was created. google.protobuf.Timestamp create_time = 7; + // The most recently invoked evaluation for the processor version. + EvaluationReference latest_evaluation = 8; + // The KMS key name used for encryption. string kms_key_name = 9; diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/batchprocessdocuments/SyncBatchProcessDocumentsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/batchprocessdocuments/SyncBatchProcessDocumentsString.java index 64c2b5556491..e39f6be5b507 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/batchprocessdocuments/SyncBatchProcessDocumentsString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/batchprocessdocuments/SyncBatchProcessDocumentsString.java @@ -19,7 +19,7 @@ // [START documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_String_sync] import com.google.cloud.documentai.v1.BatchProcessResponse; import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; -import com.google.cloud.documentai.v1.HumanReviewConfigName; +import com.google.cloud.documentai.v1.EvaluationName; public class SyncBatchProcessDocumentsString { @@ -35,7 +35,10 @@ public static void syncBatchProcessDocumentsString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]") + .toString(); BatchProcessResponse response = documentProcessorServiceClient.batchProcessDocumentsAsync(name).get(); } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersion.java new file mode 100644 index 000000000000..5b7bd075a9eb --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersion.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.BatchDocumentsInputConfig; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.longrunning.Operation; + +public class AsyncEvaluateProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncEvaluateProcessorVersion(); + } + + public static void asyncEvaluateProcessorVersion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EvaluateProcessorVersionRequest request = + EvaluateProcessorVersionRequest.newBuilder() + .setProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build()) + .build(); + ApiFuture future = + documentProcessorServiceClient.evaluateProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersionLRO.java new file mode 100644 index 000000000000..714e80fe5cc8 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/AsyncEvaluateProcessorVersionLRO.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.BatchDocumentsInputConfig; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +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.ProcessorVersionName; + +public class AsyncEvaluateProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncEvaluateProcessorVersionLRO(); + } + + public static void asyncEvaluateProcessorVersionLRO() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EvaluateProcessorVersionRequest request = + EvaluateProcessorVersionRequest.newBuilder() + .setProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build()) + .build(); + OperationFuture future = + documentProcessorServiceClient + .evaluateProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + EvaluateProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_LRO_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersion.java new file mode 100644 index 000000000000..649aecd61a5f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersion.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] +import com.google.cloud.documentai.v1.BatchDocumentsInputConfig; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionRequest; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncEvaluateProcessorVersion { + + public static void main(String[] args) throws Exception { + syncEvaluateProcessorVersion(); + } + + public static void syncEvaluateProcessorVersion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EvaluateProcessorVersionRequest request = + EvaluateProcessorVersionRequest.newBuilder() + .setProcessorVersion( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setEvaluationDocuments(BatchDocumentsInputConfig.newBuilder().build()) + .build(); + EvaluateProcessorVersionResponse response = + documentProcessorServiceClient.evaluateProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionProcessorversionname.java new file mode 100644 index 000000000000..94ebdc2abc90 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionProcessorversionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_Processorversionname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncEvaluateProcessorVersionProcessorversionname { + + public static void main(String[] args) throws Exception { + syncEvaluateProcessorVersionProcessorversionname(); + } + + public static void syncEvaluateProcessorVersionProcessorversionname() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + EvaluateProcessorVersionResponse response = + documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_Processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionString.java new file mode 100644 index 000000000000..54aab5a4690e --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/evaluateprocessorversion/SyncEvaluateProcessorVersionString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_String_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.EvaluateProcessorVersionResponse; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncEvaluateProcessorVersionString { + + public static void main(String[] args) throws Exception { + syncEvaluateProcessorVersionString(); + } + + public static void syncEvaluateProcessorVersionString() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String processorVersion = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + EvaluateProcessorVersionResponse response = + documentProcessorServiceClient.evaluateProcessorVersionAsync(processorVersion).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_String_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/AsyncGetEvaluation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/AsyncGetEvaluation.java new file mode 100644 index 000000000000..fae45b3877dd --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/AsyncGetEvaluation.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_GetEvaluation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.EvaluationName; +import com.google.cloud.documentai.v1.GetEvaluationRequest; + +public class AsyncGetEvaluation { + + public static void main(String[] args) throws Exception { + asyncGetEvaluation(); + } + + public static void asyncGetEvaluation() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetEvaluationRequest request = + GetEvaluationRequest.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .build(); + ApiFuture future = + documentProcessorServiceClient.getEvaluationCallable().futureCall(request); + // Do something. + Evaluation response = future.get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluation.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluation.java new file mode 100644 index 000000000000..4814f37e8b51 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.EvaluationName; +import com.google.cloud.documentai.v1.GetEvaluationRequest; + +public class SyncGetEvaluation { + + public static void main(String[] args) throws Exception { + syncGetEvaluation(); + } + + public static void syncGetEvaluation() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + GetEvaluationRequest request = + GetEvaluationRequest.newBuilder() + .setName( + EvaluationName.of( + "[PROJECT]", + "[LOCATION]", + "[PROCESSOR]", + "[PROCESSOR_VERSION]", + "[EVALUATION]") + .toString()) + .build(); + Evaluation response = documentProcessorServiceClient.getEvaluation(request); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationEvaluationname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationEvaluationname.java new file mode 100644 index 000000000000..804d31df5f99 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationEvaluationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_GetEvaluation_Evaluationname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.EvaluationName; + +public class SyncGetEvaluationEvaluationname { + + public static void main(String[] args) throws Exception { + syncGetEvaluationEvaluationname(); + } + + public static void syncGetEvaluationEvaluationname() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + EvaluationName name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]"); + Evaluation response = documentProcessorServiceClient.getEvaluation(name); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_Evaluationname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationString.java new file mode 100644 index 000000000000..fa6ca132afbb --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/getevaluation/SyncGetEvaluationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_GetEvaluation_String_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.EvaluationName; + +public class SyncGetEvaluationString { + + public static void main(String[] args) throws Exception { + syncGetEvaluationString(); + } + + public static void syncGetEvaluationString() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]") + .toString(); + Evaluation response = documentProcessorServiceClient.getEvaluation(name); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_String_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluations.java new file mode 100644 index 000000000000..981ebc8be392 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluations.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_ListEvaluations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.ListEvaluationsRequest; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class AsyncListEvaluations { + + public static void main(String[] args) throws Exception { + asyncListEvaluations(); + } + + public static void asyncListEvaluations() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListEvaluationsRequest request = + ListEvaluationsRequest.newBuilder() + .setParent( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentProcessorServiceClient.listEvaluationsPagedCallable().futureCall(request); + // Do something. + for (Evaluation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluationsPaged.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluationsPaged.java new file mode 100644 index 000000000000..7bccae49728f --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/AsyncListEvaluationsPaged.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_ListEvaluations_Paged_async] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.ListEvaluationsRequest; +import com.google.cloud.documentai.v1.ListEvaluationsResponse; +import com.google.cloud.documentai.v1.ProcessorVersionName; +import com.google.common.base.Strings; + +public class AsyncListEvaluationsPaged { + + public static void main(String[] args) throws Exception { + asyncListEvaluationsPaged(); + } + + public static void asyncListEvaluationsPaged() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListEvaluationsRequest request = + ListEvaluationsRequest.newBuilder() + .setParent( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListEvaluationsResponse response = + documentProcessorServiceClient.listEvaluationsCallable().call(request); + for (Evaluation element : response.getEvaluationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_Paged_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluations.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluations.java new file mode 100644 index 000000000000..512365e5fe95 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluations.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.ListEvaluationsRequest; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncListEvaluations { + + public static void main(String[] args) throws Exception { + syncListEvaluations(); + } + + public static void syncListEvaluations() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ListEvaluationsRequest request = + ListEvaluationsRequest.newBuilder() + .setParent( + ProcessorVersionName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Evaluation element : + documentProcessorServiceClient.listEvaluations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsProcessorversionname.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsProcessorversionname.java new file mode 100644 index 000000000000..3c26e8686073 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsProcessorversionname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_ListEvaluations_Processorversionname_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncListEvaluationsProcessorversionname { + + public static void main(String[] args) throws Exception { + syncListEvaluationsProcessorversionname(); + } + + public static void syncListEvaluationsProcessorversionname() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorVersionName parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]"); + for (Evaluation element : + documentProcessorServiceClient.listEvaluations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_Processorversionname_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsString.java new file mode 100644 index 000000000000..982cb79c8b85 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/listevaluations/SyncListEvaluationsString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_ListEvaluations_String_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.Evaluation; +import com.google.cloud.documentai.v1.ProcessorVersionName; + +public class SyncListEvaluationsString { + + public static void main(String[] args) throws Exception { + syncListEvaluationsString(); + } + + public static void syncListEvaluationsString() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = + ProcessorVersionName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]") + .toString(); + for (Evaluation element : + documentProcessorServiceClient.listEvaluations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_String_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/processdocument/SyncProcessDocumentString.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/processdocument/SyncProcessDocumentString.java index 0e48b6797f13..148e8cb0f6ed 100644 --- a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/processdocument/SyncProcessDocumentString.java +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/processdocument/SyncProcessDocumentString.java @@ -18,7 +18,7 @@ // [START documentai_v1_generated_DocumentProcessorService_ProcessDocument_String_sync] import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; -import com.google.cloud.documentai.v1.HumanReviewConfigName; +import com.google.cloud.documentai.v1.EvaluationName; import com.google.cloud.documentai.v1.ProcessResponse; public class SyncProcessDocumentString { @@ -35,7 +35,10 @@ public static void syncProcessDocumentString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DocumentProcessorServiceClient documentProcessorServiceClient = DocumentProcessorServiceClient.create()) { - String name = HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + String name = + EvaluationName.of( + "[PROJECT]", "[LOCATION]", "[PROCESSOR]", "[PROCESSOR_VERSION]", "[EVALUATION]") + .toString(); ProcessResponse response = documentProcessorServiceClient.processDocument(name); } } diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersion.java new file mode 100644 index 000000000000..e0480b393a13 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersion.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.TrainProcessorVersionRequest; +import com.google.longrunning.Operation; + +public class AsyncTrainProcessorVersion { + + public static void main(String[] args) throws Exception { + asyncTrainProcessorVersion(); + } + + public static void asyncTrainProcessorVersion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + TrainProcessorVersionRequest request = + TrainProcessorVersionRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setProcessorVersion(ProcessorVersion.newBuilder().build()) + .setDocumentSchema(DocumentSchema.newBuilder().build()) + .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build()) + .setBaseProcessorVersion("baseProcessorVersion337709271") + .build(); + ApiFuture future = + documentProcessorServiceClient.trainProcessorVersionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersionLRO.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersionLRO.java new file mode 100644 index 000000000000..7442e63b1423 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/AsyncTrainProcessorVersionLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.TrainProcessorVersionMetadata; +import com.google.cloud.documentai.v1.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; + +public class AsyncTrainProcessorVersionLRO { + + public static void main(String[] args) throws Exception { + asyncTrainProcessorVersionLRO(); + } + + public static void asyncTrainProcessorVersionLRO() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + TrainProcessorVersionRequest request = + TrainProcessorVersionRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setProcessorVersion(ProcessorVersion.newBuilder().build()) + .setDocumentSchema(DocumentSchema.newBuilder().build()) + .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build()) + .setBaseProcessorVersion("baseProcessorVersion337709271") + .build(); + OperationFuture future = + documentProcessorServiceClient + .trainProcessorVersionOperationCallable() + .futureCall(request); + // Do something. + TrainProcessorVersionResponse response = future.get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_LRO_async] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersion.java new file mode 100644 index 000000000000..1466c0a0a5ab --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersion.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.DocumentSchema; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.TrainProcessorVersionRequest; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; + +public class SyncTrainProcessorVersion { + + public static void main(String[] args) throws Exception { + syncTrainProcessorVersion(); + } + + public static void syncTrainProcessorVersion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + TrainProcessorVersionRequest request = + TrainProcessorVersionRequest.newBuilder() + .setParent(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString()) + .setProcessorVersion(ProcessorVersion.newBuilder().build()) + .setDocumentSchema(DocumentSchema.newBuilder().build()) + .setInputData(TrainProcessorVersionRequest.InputData.newBuilder().build()) + .setBaseProcessorVersion("baseProcessorVersion337709271") + .build(); + TrainProcessorVersionResponse response = + documentProcessorServiceClient.trainProcessorVersionAsync(request).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionProcessornameProcessorversion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionProcessornameProcessorversion.java new file mode 100644 index 000000000000..6911e25487cc --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionProcessornameProcessorversion.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_ProcessornameProcessorversion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; + +public class SyncTrainProcessorVersionProcessornameProcessorversion { + + public static void main(String[] args) throws Exception { + syncTrainProcessorVersionProcessornameProcessorversion(); + } + + public static void syncTrainProcessorVersionProcessornameProcessorversion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + ProcessorName parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]"); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + TrainProcessorVersionResponse response = + documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_ProcessornameProcessorversion_sync] diff --git a/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionStringProcessorversion.java b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionStringProcessorversion.java new file mode 100644 index 000000000000..103aa650a916 --- /dev/null +++ b/java-document-ai/samples/snippets/generated/com/google/cloud/documentai/v1/documentprocessorservice/trainprocessorversion/SyncTrainProcessorVersionStringProcessorversion.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.documentai.v1.samples; + +// [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_StringProcessorversion_sync] +import com.google.cloud.documentai.v1.DocumentProcessorServiceClient; +import com.google.cloud.documentai.v1.ProcessorName; +import com.google.cloud.documentai.v1.ProcessorVersion; +import com.google.cloud.documentai.v1.TrainProcessorVersionResponse; + +public class SyncTrainProcessorVersionStringProcessorversion { + + public static void main(String[] args) throws Exception { + syncTrainProcessorVersionStringProcessorversion(); + } + + public static void syncTrainProcessorVersionStringProcessorversion() throws Exception { + // 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 + try (DocumentProcessorServiceClient documentProcessorServiceClient = + DocumentProcessorServiceClient.create()) { + String parent = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString(); + ProcessorVersion processorVersion = ProcessorVersion.newBuilder().build(); + TrainProcessorVersionResponse response = + documentProcessorServiceClient.trainProcessorVersionAsync(parent, processorVersion).get(); + } + } +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_StringProcessorversion_sync]