diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg index 1abad6cfa..42f30ad99 100644 --- a/.kokoro/release/drop.cfg +++ b/.kokoro/release/drop.cfg @@ -4,6 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-automl/.kokoro/release/drop.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-automl" \ No newline at end of file diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg index 1c379178a..c2483b7df 100644 --- a/.kokoro/release/promote.cfg +++ b/.kokoro/release/promote.cfg @@ -4,7 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-automl/.kokoro/release/promote.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-automl" - diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java index d6717a1e9..89cead065 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java @@ -1028,6 +1028,98 @@ public final UnaryCallable exportDataCallable() { return stub.exportDataCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
+   * }
+   * 
+ * + * @param name The resource name of the annotation spec to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { + + GetAnnotationSpecRequest request = + GetAnnotationSpecRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAnnotationSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name.toString());
+   * }
+   * 
+ * + * @param name The resource name of the annotation spec to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnnotationSpec getAnnotationSpec(String name) { + + GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder().setName(name).build(); + return getAnnotationSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(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 AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) { + return getAnnotationSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an annotation spec. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request);
+   *   // Do something
+   *   AnnotationSpec response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getAnnotationSpecCallable() { + return stub.getAnnotationSpecCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field @@ -1597,6 +1689,421 @@ public final UnaryCallable deleteModelCallable() return stub.deleteModelCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deployModelAsync(name).get();
+   * }
+   * 
+ * + * @param name Resource name of the model to deploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deployModelAsync(ModelName name) { + + DeployModelRequest request = + DeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deployModelAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Resource name of the model to deploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deployModelAsync(String name) { + + DeployModelRequest request = DeployModelRequest.newBuilder().setName(name).build(); + return deployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deployModelAsync(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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deployModelAsync( + DeployModelRequest request) { + return deployModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deployModelOperationCallable() { + return stub.deployModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deployModelCallable() { + return stub.deployModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.undeployModelAsync(name).get();
+   * }
+   * 
+ * + * @param name Resource name of the model to undeploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync(ModelName name) { + + UndeployModelRequest request = + UndeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.undeployModelAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Resource name of the model to undeploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync(String name) { + + UndeployModelRequest request = UndeployModelRequest.newBuilder().setName(name).build(); + return undeployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.undeployModelAsync(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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync( + UndeployModelRequest request) { + return undeployModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + undeployModelOperationCallable() { + return stub.undeployModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection; all other domains manage + * deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable undeployModelCallable() { + return stub.undeployModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   autoMlClient.exportModelAsync(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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture exportModelAsync( + ExportModelRequest request) { + return exportModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + exportModelOperationCallable() { + return stub.exportModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable exportModelCallable() { + return stub.exportModelCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a model evaluation. diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java index 0cf18a004..4067a6757 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java @@ -136,6 +136,11 @@ public UnaryCallSettings exportDataSettings() { return ((AutoMlStubSettings) getStubSettings()).exportDataOperationSettings(); } + /** Returns the object with the settings used for calls to getAnnotationSpec. */ + public UnaryCallSettings getAnnotationSpecSettings() { + return ((AutoMlStubSettings) getStubSettings()).getAnnotationSpecSettings(); + } + /** Returns the object with the settings used for calls to createModel. */ public UnaryCallSettings createModelSettings() { return ((AutoMlStubSettings) getStubSettings()).createModelSettings(); @@ -178,6 +183,45 @@ public UnaryCallSettings deleteModelSettings() { return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); } + /** Returns the object with the settings used for calls to deployModel. */ + public UnaryCallSettings deployModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).deployModelSettings(); + } + + /** Returns the object with the settings used for calls to deployModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deployModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deployModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).undeployModelSettings(); + } + + /** Returns the object with the settings used for calls to undeployModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + undeployModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).undeployModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to exportModel. */ + public UnaryCallSettings exportModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportModelSettings(); + } + + /** Returns the object with the settings used for calls to exportModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportModelOperationSettings(); + } + /** Returns the object with the settings used for calls to getModelEvaluation. */ public UnaryCallSettings getModelEvaluationSettings() { @@ -358,6 +402,12 @@ public UnaryCallSettings.Builder exportDataSetting return getStubSettingsBuilder().exportDataOperationSettings(); } + /** Returns the builder for the settings used for calls to getAnnotationSpec. */ + public UnaryCallSettings.Builder + getAnnotationSpecSettings() { + return getStubSettingsBuilder().getAnnotationSpecSettings(); + } + /** Returns the builder for the settings used for calls to createModel. */ public UnaryCallSettings.Builder createModelSettings() { return getStubSettingsBuilder().createModelSettings(); @@ -400,6 +450,45 @@ public UnaryCallSettings.Builder deleteModelSetti return getStubSettingsBuilder().deleteModelOperationSettings(); } + /** Returns the builder for the settings used for calls to deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return getStubSettingsBuilder().deployModelSettings(); + } + + /** Returns the builder for the settings used for calls to deployModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deployModelOperationSettings() { + return getStubSettingsBuilder().deployModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return getStubSettingsBuilder().undeployModelSettings(); + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + undeployModelOperationSettings() { + return getStubSettingsBuilder().undeployModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to exportModel. */ + public UnaryCallSettings.Builder exportModelSettings() { + return getStubSettingsBuilder().exportModelSettings(); + } + + /** Returns the builder for the settings used for calls to exportModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportModelOperationSettings() { + return getStubSettingsBuilder().exportModelOperationSettings(); + } + /** Returns the builder for the settings used for calls to getModelEvaluation. */ public UnaryCallSettings.Builder getModelEvaluationSettings() { diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java index 00d84135d..0b3c06e1c 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceClient.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.automl.v1.stub.PredictionServiceStub; import com.google.cloud.automl.v1.stub.PredictionServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; import java.io.IOException; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -102,6 +106,7 @@ public class PredictionServiceClient implements BackgroundResource { private final PredictionServiceSettings settings; private final PredictionServiceStub stub; + private final OperationsClient operationsClient; /** Constructs an instance of PredictionServiceClient with default settings. */ public static final PredictionServiceClient create() throws IOException { @@ -134,12 +139,14 @@ public static final PredictionServiceClient create(PredictionServiceStub stub) { protected PredictionServiceClient(PredictionServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected PredictionServiceClient(PredictionServiceStub stub) { this.settings = null; this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } public final PredictionServiceSettings getSettings() { @@ -151,11 +158,26 @@ public PredictionServiceStub getStub() { return stub; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Perform an online prediction. The prediction result will be directly returned in the response. - * Available for following ML problems, and their expected request payloads: * Translation - - * TextSnippet, content up to 25,000 characters, UTF-8 encoded. + * Available for following ML problems, and their expected request payloads: * Image + * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image + * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text + * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text + * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation + * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Text Sentiment - + * TextSnippet, content up 500 characters, UTF-8 encoded. * *

Sample code: * @@ -173,6 +195,15 @@ public PredictionServiceStub getStub() { * type that the model was trained to solve. * @param params Additional domain-specific parameters, any string must be up to 25000 characters * long. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score. The + * default is 0.5. + *

* For Image Object Detection: `score_threshold` - (float) When Model detects objects + * on the image, it will only produce bounding boxes which have at least this confidence + * score. Value in 0 to 1 range, default is 0.5. `max_bounding_box_count` - (int64) No more + * than this number of bounding boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final PredictResponse predict( @@ -190,8 +221,13 @@ public final PredictResponse predict( // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Perform an online prediction. The prediction result will be directly returned in the response. - * Available for following ML problems, and their expected request payloads: * Translation - - * TextSnippet, content up to 25,000 characters, UTF-8 encoded. + * Available for following ML problems, and their expected request payloads: * Image + * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image + * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text + * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text + * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation + * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Text Sentiment - + * TextSnippet, content up 500 characters, UTF-8 encoded. * *

Sample code: * @@ -209,6 +245,15 @@ public final PredictResponse predict( * type that the model was trained to solve. * @param params Additional domain-specific parameters, any string must be up to 25000 characters * long. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score. The + * default is 0.5. + *

* For Image Object Detection: `score_threshold` - (float) When Model detects objects + * on the image, it will only produce bounding boxes which have at least this confidence + * score. Value in 0 to 1 range, default is 0.5. `max_bounding_box_count` - (int64) No more + * than this number of bounding boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final PredictResponse predict( @@ -222,8 +267,13 @@ public final PredictResponse predict( // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Perform an online prediction. The prediction result will be directly returned in the response. - * Available for following ML problems, and their expected request payloads: * Translation - - * TextSnippet, content up to 25,000 characters, UTF-8 encoded. + * Available for following ML problems, and their expected request payloads: * Image + * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image + * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text + * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text + * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation + * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Text Sentiment - + * TextSnippet, content up 500 characters, UTF-8 encoded. * *

Sample code: * @@ -249,8 +299,13 @@ public final PredictResponse predict(PredictRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Perform an online prediction. The prediction result will be directly returned in the response. - * Available for following ML problems, and their expected request payloads: * Translation - - * TextSnippet, content up to 25,000 characters, UTF-8 encoded. + * Available for following ML problems, and their expected request payloads: * Image + * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image + * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text + * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text + * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation + * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Text Sentiment - + * TextSnippet, content up 500 characters, UTF-8 encoded. * *

Sample code: * @@ -272,6 +327,237 @@ public final UnaryCallable predictCallable() { return stub.predictCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Perform a batch prediction. Unlike the online + * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be + * immediately available in the response. Instead, a long running operation object is returned. + * User can poll the operation result via + * [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, + * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the + * [response][google.longrunning.Operation.response] field. Available for following ML problems: + * * Image Classification * Image Object Detection * Text Extraction + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
+   *   BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
+   *   Map<String, String> params = new HashMap<>();
+   *   BatchPredictResult response = predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get();
+   * }
+   * 
+ * + * @param name Name of the model requested to serve the batch prediction. + * @param inputConfig Required. The input configuration for batch prediction. + * @param outputConfig Required. The Configuration specifying where output predictions should be + * written. + * @param params Additional domain-specific parameters for the predictions, any string must be up + * to 25000 characters long. + *

* For Text Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for a text snippet, it will only produce results that have at least this confidence score. + * The default is 0.5. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score. The + * default is 0.5. + *

* For Image Object Detection: + *

`score_threshold` - (float) When Model detects objects on the image, it will only + * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range, + * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the requested value may be limited by + * server. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture batchPredictAsync( + ModelName name, + BatchPredictInputConfig inputConfig, + BatchPredictOutputConfig outputConfig, + Map params) { + + BatchPredictRequest request = + BatchPredictRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setInputConfig(inputConfig) + .setOutputConfig(outputConfig) + .putAllParams(params) + .build(); + return batchPredictAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Perform a batch prediction. Unlike the online + * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be + * immediately available in the response. Instead, a long running operation object is returned. + * User can poll the operation result via + * [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, + * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the + * [response][google.longrunning.Operation.response] field. Available for following ML problems: + * * Image Classification * Image Object Detection * Text Extraction + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
+   *   BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
+   *   Map<String, String> params = new HashMap<>();
+   *   BatchPredictResult response = predictionServiceClient.batchPredictAsync(name.toString(), inputConfig, outputConfig, params).get();
+   * }
+   * 
+ * + * @param name Name of the model requested to serve the batch prediction. + * @param inputConfig Required. The input configuration for batch prediction. + * @param outputConfig Required. The Configuration specifying where output predictions should be + * written. + * @param params Additional domain-specific parameters for the predictions, any string must be up + * to 25000 characters long. + *

* For Text Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for a text snippet, it will only produce results that have at least this confidence score. + * The default is 0.5. + *

* For Image Classification: + *

`score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions + * for an image, it will only produce results that have at least this confidence score. The + * default is 0.5. + *

* For Image Object Detection: + *

`score_threshold` - (float) When Model detects objects on the image, it will only + * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range, + * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the requested value may be limited by + * server. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture batchPredictAsync( + String name, + BatchPredictInputConfig inputConfig, + BatchPredictOutputConfig outputConfig, + Map params) { + + BatchPredictRequest request = + BatchPredictRequest.newBuilder() + .setName(name) + .setInputConfig(inputConfig) + .setOutputConfig(outputConfig) + .putAllParams(params) + .build(); + return batchPredictAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Perform a batch prediction. Unlike the online + * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be + * immediately available in the response. Instead, a long running operation object is returned. + * User can poll the operation result via + * [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, + * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the + * [response][google.longrunning.Operation.response] field. Available for following ML problems: + * * Image Classification * Image Object Detection * Text Extraction + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
+   *   BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
+   *   BatchPredictRequest request = BatchPredictRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   BatchPredictResult response = predictionServiceClient.batchPredictAsync(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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture batchPredictAsync( + BatchPredictRequest request) { + return batchPredictOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Perform a batch prediction. Unlike the online + * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be + * immediately available in the response. Instead, a long running operation object is returned. + * User can poll the operation result via + * [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, + * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the + * [response][google.longrunning.Operation.response] field. Available for following ML problems: + * * Image Classification * Image Object Detection * Text Extraction + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
+   *   BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
+   *   BatchPredictRequest request = BatchPredictRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   OperationFuture<BatchPredictResult, OperationMetadata> future = predictionServiceClient.batchPredictOperationCallable().futureCall(request);
+   *   // Do something
+   *   BatchPredictResult response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + batchPredictOperationCallable() { + return stub.batchPredictOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Perform a batch prediction. Unlike the online + * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be + * immediately available in the response. Instead, a long running operation object is returned. + * User can poll the operation result via + * [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, + * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the + * [response][google.longrunning.Operation.response] field. Available for following ML problems: + * * Image Classification * Image Object Detection * Text Extraction + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
+   *   BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
+   *   BatchPredictRequest request = BatchPredictRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setInputConfig(inputConfig)
+   *     .setOutputConfig(outputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = predictionServiceClient.batchPredictCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable batchPredictCallable() { + return stub.batchPredictCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java index 674f3f055..c247782f0 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java @@ -23,9 +23,11 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.automl.v1.stub.PredictionServiceStubSettings; +import com.google.longrunning.Operation; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -65,6 +67,19 @@ public UnaryCallSettings predictSettings() { return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); } + /** Returns the object with the settings used for calls to batchPredict. */ + public UnaryCallSettings batchPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).batchPredictSettings(); + } + + /** Returns the object with the settings used for calls to batchPredict. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + batchPredictOperationSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).batchPredictOperationSettings(); + } + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) throws IOException { return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); @@ -167,6 +182,19 @@ public UnaryCallSettings.Builder predictSetting return getStubSettingsBuilder().predictSettings(); } + /** Returns the builder for the settings used for calls to batchPredict. */ + public UnaryCallSettings.Builder batchPredictSettings() { + return getStubSettingsBuilder().batchPredictSettings(); + } + + /** Returns the builder for the settings used for calls to batchPredict. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + batchPredictOperationSettings() { + return getStubSettingsBuilder().batchPredictOperationSettings(); + } + @Override public PredictionServiceSettings build() throws IOException { return new PredictionServiceSettings(this); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java index 4386edbd6..771e7afc0 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java @@ -23,12 +23,16 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.AnnotationSpec; import com.google.cloud.automl.v1.CreateDatasetRequest; import com.google.cloud.automl.v1.CreateModelRequest; import com.google.cloud.automl.v1.Dataset; import com.google.cloud.automl.v1.DeleteDatasetRequest; import com.google.cloud.automl.v1.DeleteModelRequest; +import com.google.cloud.automl.v1.DeployModelRequest; import com.google.cloud.automl.v1.ExportDataRequest; +import com.google.cloud.automl.v1.ExportModelRequest; +import com.google.cloud.automl.v1.GetAnnotationSpecRequest; import com.google.cloud.automl.v1.GetDatasetRequest; import com.google.cloud.automl.v1.GetModelEvaluationRequest; import com.google.cloud.automl.v1.GetModelRequest; @@ -42,6 +46,7 @@ import com.google.cloud.automl.v1.Model; import com.google.cloud.automl.v1.ModelEvaluation; import com.google.cloud.automl.v1.OperationMetadata; +import com.google.cloud.automl.v1.UndeployModelRequest; import com.google.cloud.automl.v1.UpdateDatasetRequest; import com.google.cloud.automl.v1.UpdateModelRequest; import com.google.longrunning.Operation; @@ -120,6 +125,10 @@ public UnaryCallable exportDataCallable() { throw new UnsupportedOperationException("Not implemented: exportDataCallable()"); } + public UnaryCallable getAnnotationSpecCallable() { + throw new UnsupportedOperationException("Not implemented: getAnnotationSpecCallable()"); + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createModelOperationCallable() { @@ -156,6 +165,36 @@ public UnaryCallable deleteModelCallable() { throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deployModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deployModelOperationCallable()"); + } + + public UnaryCallable deployModelCallable() { + throw new UnsupportedOperationException("Not implemented: deployModelCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + undeployModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: undeployModelOperationCallable()"); + } + + public UnaryCallable undeployModelCallable() { + throw new UnsupportedOperationException("Not implemented: undeployModelCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportModelOperationCallable()"); + } + + public UnaryCallable exportModelCallable() { + throw new UnsupportedOperationException("Not implemented: exportModelCallable()"); + } + public UnaryCallable getModelEvaluationCallable() { throw new UnsupportedOperationException("Not implemented: getModelEvaluationCallable()"); } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java index 23add3192..72b05eea6 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java @@ -45,12 +45,16 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.AnnotationSpec; import com.google.cloud.automl.v1.CreateDatasetRequest; import com.google.cloud.automl.v1.CreateModelRequest; import com.google.cloud.automl.v1.Dataset; import com.google.cloud.automl.v1.DeleteDatasetRequest; import com.google.cloud.automl.v1.DeleteModelRequest; +import com.google.cloud.automl.v1.DeployModelRequest; import com.google.cloud.automl.v1.ExportDataRequest; +import com.google.cloud.automl.v1.ExportModelRequest; +import com.google.cloud.automl.v1.GetAnnotationSpecRequest; import com.google.cloud.automl.v1.GetDatasetRequest; import com.google.cloud.automl.v1.GetModelEvaluationRequest; import com.google.cloud.automl.v1.GetModelRequest; @@ -64,6 +68,7 @@ import com.google.cloud.automl.v1.Model; import com.google.cloud.automl.v1.ModelEvaluation; import com.google.cloud.automl.v1.OperationMetadata; +import com.google.cloud.automl.v1.UndeployModelRequest; import com.google.cloud.automl.v1.UpdateDatasetRequest; import com.google.cloud.automl.v1.UpdateModelRequest; import com.google.common.collect.ImmutableList; @@ -128,6 +133,8 @@ public class AutoMlStubSettings extends StubSettings { private final UnaryCallSettings exportDataSettings; private final OperationCallSettings exportDataOperationSettings; + private final UnaryCallSettings + getAnnotationSpecSettings; private final UnaryCallSettings createModelSettings; private final OperationCallSettings createModelOperationSettings; @@ -138,6 +145,15 @@ public class AutoMlStubSettings extends StubSettings { private final UnaryCallSettings deleteModelSettings; private final OperationCallSettings deleteModelOperationSettings; + private final UnaryCallSettings deployModelSettings; + private final OperationCallSettings + deployModelOperationSettings; + private final UnaryCallSettings undeployModelSettings; + private final OperationCallSettings + undeployModelOperationSettings; + private final UnaryCallSettings exportModelSettings; + private final OperationCallSettings + exportModelOperationSettings; private final UnaryCallSettings getModelEvaluationSettings; private final PagedCallSettings< @@ -210,6 +226,11 @@ public UnaryCallSettings exportDataSettings() { return exportDataOperationSettings; } + /** Returns the object with the settings used for calls to getAnnotationSpec. */ + public UnaryCallSettings getAnnotationSpecSettings() { + return getAnnotationSpecSettings; + } + /** Returns the object with the settings used for calls to createModel. */ public UnaryCallSettings createModelSettings() { return createModelSettings; @@ -250,6 +271,42 @@ public UnaryCallSettings deleteModelSettings() { return deleteModelOperationSettings; } + /** Returns the object with the settings used for calls to deployModel. */ + public UnaryCallSettings deployModelSettings() { + return deployModelSettings; + } + + /** Returns the object with the settings used for calls to deployModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deployModelOperationSettings() { + return deployModelOperationSettings; + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the object with the settings used for calls to undeployModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + undeployModelOperationSettings() { + return undeployModelOperationSettings; + } + + /** Returns the object with the settings used for calls to exportModel. */ + public UnaryCallSettings exportModelSettings() { + return exportModelSettings; + } + + /** Returns the object with the settings used for calls to exportModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportModelOperationSettings() { + return exportModelOperationSettings; + } + /** Returns the object with the settings used for calls to getModelEvaluation. */ public UnaryCallSettings getModelEvaluationSettings() { @@ -344,6 +401,7 @@ protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { importDataOperationSettings = settingsBuilder.importDataOperationSettings().build(); exportDataSettings = settingsBuilder.exportDataSettings().build(); exportDataOperationSettings = settingsBuilder.exportDataOperationSettings().build(); + getAnnotationSpecSettings = settingsBuilder.getAnnotationSpecSettings().build(); createModelSettings = settingsBuilder.createModelSettings().build(); createModelOperationSettings = settingsBuilder.createModelOperationSettings().build(); getModelSettings = settingsBuilder.getModelSettings().build(); @@ -351,6 +409,12 @@ protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { listModelsSettings = settingsBuilder.listModelsSettings().build(); deleteModelSettings = settingsBuilder.deleteModelSettings().build(); deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); + deployModelSettings = settingsBuilder.deployModelSettings().build(); + deployModelOperationSettings = settingsBuilder.deployModelOperationSettings().build(); + undeployModelSettings = settingsBuilder.undeployModelSettings().build(); + undeployModelOperationSettings = settingsBuilder.undeployModelOperationSettings().build(); + exportModelSettings = settingsBuilder.exportModelSettings().build(); + exportModelOperationSettings = settingsBuilder.exportModelOperationSettings().build(); getModelEvaluationSettings = settingsBuilder.getModelEvaluationSettings().build(); listModelEvaluationsSettings = settingsBuilder.listModelEvaluationsSettings().build(); } @@ -547,6 +611,8 @@ public static class Builder extends StubSettings.Builder exportDataSettings; private final OperationCallSettings.Builder exportDataOperationSettings; + private final UnaryCallSettings.Builder + getAnnotationSpecSettings; private final UnaryCallSettings.Builder createModelSettings; private final OperationCallSettings.Builder createModelOperationSettings; @@ -558,6 +624,15 @@ public static class Builder extends StubSettings.Builder deleteModelSettings; private final OperationCallSettings.Builder deleteModelOperationSettings; + private final UnaryCallSettings.Builder deployModelSettings; + private final OperationCallSettings.Builder + deployModelOperationSettings; + private final UnaryCallSettings.Builder undeployModelSettings; + private final OperationCallSettings.Builder + undeployModelOperationSettings; + private final UnaryCallSettings.Builder exportModelSettings; + private final OperationCallSettings.Builder + exportModelOperationSettings; private final UnaryCallSettings.Builder getModelEvaluationSettings; private final PagedCallSettings.Builder< @@ -629,6 +704,8 @@ protected Builder(ClientContext clientContext) { exportDataOperationSettings = OperationCallSettings.newBuilder(); + getAnnotationSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createModelOperationSettings = OperationCallSettings.newBuilder(); @@ -643,6 +720,18 @@ protected Builder(ClientContext clientContext) { deleteModelOperationSettings = OperationCallSettings.newBuilder(); + deployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deployModelOperationSettings = OperationCallSettings.newBuilder(); + + undeployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + undeployModelOperationSettings = OperationCallSettings.newBuilder(); + + exportModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportModelOperationSettings = OperationCallSettings.newBuilder(); + getModelEvaluationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listModelEvaluationsSettings = @@ -657,11 +746,15 @@ protected Builder(ClientContext clientContext) { deleteDatasetSettings, importDataSettings, exportDataSettings, + getAnnotationSpecSettings, createModelSettings, getModelSettings, updateModelSettings, listModelsSettings, deleteModelSettings, + deployModelSettings, + undeployModelSettings, + exportModelSettings, getModelEvaluationSettings, listModelEvaluationsSettings); @@ -714,6 +807,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getAnnotationSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .createModelSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -739,6 +837,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .deployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .undeployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .exportModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .getModelEvaluationSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -882,6 +995,73 @@ private static Builder initDefaults(Builder builder) { .setMaxRpcTimeout(Duration.ZERO) // ignored .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .deployModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(3600000L)) + .build())); + builder + .undeployModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(3600000L)) + .build())); + builder + .exportModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); return builder; } @@ -900,6 +1080,7 @@ protected Builder(AutoMlStubSettings settings) { importDataOperationSettings = settings.importDataOperationSettings.toBuilder(); exportDataSettings = settings.exportDataSettings.toBuilder(); exportDataOperationSettings = settings.exportDataOperationSettings.toBuilder(); + getAnnotationSpecSettings = settings.getAnnotationSpecSettings.toBuilder(); createModelSettings = settings.createModelSettings.toBuilder(); createModelOperationSettings = settings.createModelOperationSettings.toBuilder(); getModelSettings = settings.getModelSettings.toBuilder(); @@ -907,6 +1088,12 @@ protected Builder(AutoMlStubSettings settings) { listModelsSettings = settings.listModelsSettings.toBuilder(); deleteModelSettings = settings.deleteModelSettings.toBuilder(); deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); + deployModelSettings = settings.deployModelSettings.toBuilder(); + deployModelOperationSettings = settings.deployModelOperationSettings.toBuilder(); + undeployModelSettings = settings.undeployModelSettings.toBuilder(); + undeployModelOperationSettings = settings.undeployModelOperationSettings.toBuilder(); + exportModelSettings = settings.exportModelSettings.toBuilder(); + exportModelOperationSettings = settings.exportModelOperationSettings.toBuilder(); getModelEvaluationSettings = settings.getModelEvaluationSettings.toBuilder(); listModelEvaluationsSettings = settings.listModelEvaluationsSettings.toBuilder(); @@ -919,11 +1106,15 @@ protected Builder(AutoMlStubSettings settings) { deleteDatasetSettings, importDataSettings, exportDataSettings, + getAnnotationSpecSettings, createModelSettings, getModelSettings, updateModelSettings, listModelsSettings, deleteModelSettings, + deployModelSettings, + undeployModelSettings, + exportModelSettings, getModelEvaluationSettings, listModelEvaluationsSettings); } @@ -1013,6 +1204,12 @@ public UnaryCallSettings.Builder exportDataSetting return exportDataOperationSettings; } + /** Returns the builder for the settings used for calls to getAnnotationSpec. */ + public UnaryCallSettings.Builder + getAnnotationSpecSettings() { + return getAnnotationSpecSettings; + } + /** Returns the builder for the settings used for calls to createModel. */ public UnaryCallSettings.Builder createModelSettings() { return createModelSettings; @@ -1055,6 +1252,45 @@ public UnaryCallSettings.Builder deleteModelSetti return deleteModelOperationSettings; } + /** Returns the builder for the settings used for calls to deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return deployModelSettings; + } + + /** Returns the builder for the settings used for calls to deployModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deployModelOperationSettings() { + return deployModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + undeployModelOperationSettings() { + return undeployModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to exportModel. */ + public UnaryCallSettings.Builder exportModelSettings() { + return exportModelSettings; + } + + /** Returns the builder for the settings used for calls to exportModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportModelOperationSettings() { + return exportModelOperationSettings; + } + /** Returns the builder for the settings used for calls to getModelEvaluation. */ public UnaryCallSettings.Builder getModelEvaluationSettings() { diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java index fca0489f0..b1c54dccc 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java @@ -28,12 +28,16 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.AnnotationSpec; import com.google.cloud.automl.v1.CreateDatasetRequest; import com.google.cloud.automl.v1.CreateModelRequest; import com.google.cloud.automl.v1.Dataset; import com.google.cloud.automl.v1.DeleteDatasetRequest; import com.google.cloud.automl.v1.DeleteModelRequest; +import com.google.cloud.automl.v1.DeployModelRequest; import com.google.cloud.automl.v1.ExportDataRequest; +import com.google.cloud.automl.v1.ExportModelRequest; +import com.google.cloud.automl.v1.GetAnnotationSpecRequest; import com.google.cloud.automl.v1.GetDatasetRequest; import com.google.cloud.automl.v1.GetModelEvaluationRequest; import com.google.cloud.automl.v1.GetModelRequest; @@ -47,6 +51,7 @@ import com.google.cloud.automl.v1.Model; import com.google.cloud.automl.v1.ModelEvaluation; import com.google.cloud.automl.v1.OperationMetadata; +import com.google.cloud.automl.v1.UndeployModelRequest; import com.google.cloud.automl.v1.UpdateDatasetRequest; import com.google.cloud.automl.v1.UpdateModelRequest; import com.google.common.collect.ImmutableMap; @@ -127,6 +132,15 @@ public class GrpcAutoMlStub extends AutoMlStub { .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + getAnnotationSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/GetAnnotationSpec") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAnnotationSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AnnotationSpec.getDefaultInstance())) + .build(); private static final MethodDescriptor createModelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -163,6 +177,29 @@ public class GrpcAutoMlStub extends AutoMlStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor deployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/DeployModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + undeployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/UndeployModel") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor exportModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/ExportModel") + .setRequestMarshaller(ProtoUtils.marshaller(ExportModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor getModelEvaluationMethodDescriptor = MethodDescriptor.newBuilder() @@ -203,6 +240,7 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable exportDataCallable; private final OperationCallable exportDataOperationCallable; + private final UnaryCallable getAnnotationSpecCallable; private final UnaryCallable createModelCallable; private final OperationCallable createModelOperationCallable; @@ -213,6 +251,15 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable deleteModelCallable; private final OperationCallable deleteModelOperationCallable; + private final UnaryCallable deployModelCallable; + private final OperationCallable + deployModelOperationCallable; + private final UnaryCallable undeployModelCallable; + private final OperationCallable + undeployModelOperationCallable; + private final UnaryCallable exportModelCallable; + private final OperationCallable + exportModelOperationCallable; private final UnaryCallable getModelEvaluationCallable; private final UnaryCallable @@ -348,6 +395,19 @@ public Map extract(ExportDataRequest request) { } }) .build(); + GrpcCallSettings getAnnotationSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAnnotationSpecMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetAnnotationSpecRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings createModelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createModelMethodDescriptor) @@ -413,6 +473,45 @@ public Map extract(DeleteModelRequest request) { } }) .build(); + GrpcCallSettings deployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeployModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings undeployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UndeployModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings exportModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings getModelEvaluationTransportSettings = GrpcCallSettings.newBuilder() @@ -490,6 +589,11 @@ public Map extract(ListModelEvaluationsRequest request) { settings.exportDataOperationSettings(), clientContext, this.operationsStub); + this.getAnnotationSpecCallable = + callableFactory.createUnaryCallable( + getAnnotationSpecTransportSettings, + settings.getAnnotationSpecSettings(), + clientContext); this.createModelCallable = callableFactory.createUnaryCallable( createModelTransportSettings, settings.createModelSettings(), clientContext); @@ -520,6 +624,33 @@ public Map extract(ListModelEvaluationsRequest request) { settings.deleteModelOperationSettings(), clientContext, this.operationsStub); + this.deployModelCallable = + callableFactory.createUnaryCallable( + deployModelTransportSettings, settings.deployModelSettings(), clientContext); + this.deployModelOperationCallable = + callableFactory.createOperationCallable( + deployModelTransportSettings, + settings.deployModelOperationSettings(), + clientContext, + this.operationsStub); + this.undeployModelCallable = + callableFactory.createUnaryCallable( + undeployModelTransportSettings, settings.undeployModelSettings(), clientContext); + this.undeployModelOperationCallable = + callableFactory.createOperationCallable( + undeployModelTransportSettings, + settings.undeployModelOperationSettings(), + clientContext, + this.operationsStub); + this.exportModelCallable = + callableFactory.createUnaryCallable( + exportModelTransportSettings, settings.exportModelSettings(), clientContext); + this.exportModelOperationCallable = + callableFactory.createOperationCallable( + exportModelTransportSettings, + settings.exportModelOperationSettings(), + clientContext, + this.operationsStub); this.getModelEvaluationCallable = callableFactory.createUnaryCallable( getModelEvaluationTransportSettings, @@ -600,6 +731,10 @@ public UnaryCallable exportDataCallable() { return exportDataCallable; } + public UnaryCallable getAnnotationSpecCallable() { + return getAnnotationSpecCallable; + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createModelOperationCallable() { @@ -636,6 +771,36 @@ public UnaryCallable deleteModelCallable() { return deleteModelCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deployModelOperationCallable() { + return deployModelOperationCallable; + } + + public UnaryCallable deployModelCallable() { + return deployModelCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + undeployModelOperationCallable() { + return undeployModelOperationCallable; + } + + public UnaryCallable undeployModelCallable() { + return undeployModelCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportModelOperationCallable() { + return exportModelOperationCallable; + } + + public UnaryCallable exportModelCallable() { + return exportModelCallable; + } + public UnaryCallable getModelEvaluationCallable() { return getModelEvaluationCallable; } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java index 8f09ac611..a77208ceb 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java @@ -21,11 +21,17 @@ import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.BatchPredictRequest; +import com.google.cloud.automl.v1.BatchPredictResult; +import com.google.cloud.automl.v1.OperationMetadata; import com.google.cloud.automl.v1.PredictRequest; import com.google.cloud.automl.v1.PredictResponse; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -50,10 +56,22 @@ public class GrpcPredictionServiceStub extends PredictionServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + batchPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.PredictionService/BatchPredict") + .setRequestMarshaller(ProtoUtils.marshaller(BatchPredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final UnaryCallable predictCallable; + private final UnaryCallable batchPredictCallable; + private final OperationCallable + batchPredictOperationCallable; private final GrpcStubCallableFactory callableFactory; @@ -95,6 +113,7 @@ protected GrpcPredictionServiceStub( GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings predictTransportSettings = GrpcCallSettings.newBuilder() @@ -109,18 +128,55 @@ public Map extract(PredictRequest request) { } }) .build(); + GrpcCallSettings batchPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchPredictMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchPredictRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); this.predictCallable = callableFactory.createUnaryCallable( predictTransportSettings, settings.predictSettings(), clientContext); + this.batchPredictCallable = + callableFactory.createUnaryCallable( + batchPredictTransportSettings, settings.batchPredictSettings(), clientContext); + this.batchPredictOperationCallable = + callableFactory.createOperationCallable( + batchPredictTransportSettings, + settings.batchPredictOperationSettings(), + clientContext, + this.operationsStub); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + public UnaryCallable predictCallable() { return predictCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + batchPredictOperationCallable() { + return batchPredictOperationCallable; + } + + public UnaryCallable batchPredictCallable() { + return batchPredictCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java index ffc7897f1..0ef476f54 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStub.java @@ -17,9 +17,15 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.automl.v1.BatchPredictRequest; +import com.google.cloud.automl.v1.BatchPredictResult; +import com.google.cloud.automl.v1.OperationMetadata; import com.google.cloud.automl.v1.PredictRequest; import com.google.cloud.automl.v1.PredictResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -32,10 +38,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class PredictionServiceStub implements BackgroundResource { + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + public UnaryCallable predictCallable() { throw new UnsupportedOperationException("Not implemented: predictCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + batchPredictOperationCallable() { + throw new UnsupportedOperationException("Not implemented: batchPredictOperationCallable()"); + } + + public UnaryCallable batchPredictCallable() { + throw new UnsupportedOperationException("Not implemented: batchPredictCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java index b9e30d001..ed6c0b5f2 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java @@ -23,19 +23,27 @@ import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.automl.v1.BatchPredictRequest; +import com.google.cloud.automl.v1.BatchPredictResult; +import com.google.cloud.automl.v1.OperationMetadata; import com.google.cloud.automl.v1.PredictRequest; import com.google.cloud.automl.v1.PredictResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.longrunning.Operation; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -76,12 +84,27 @@ public class PredictionServiceStubSettings extends StubSettingsbuilder().add("https://www.googleapis.com/auth/cloud-platform").build(); private final UnaryCallSettings predictSettings; + private final UnaryCallSettings batchPredictSettings; + private final OperationCallSettings + batchPredictOperationSettings; /** Returns the object with the settings used for calls to predict. */ public UnaryCallSettings predictSettings() { return predictSettings; } + /** Returns the object with the settings used for calls to batchPredict. */ + public UnaryCallSettings batchPredictSettings() { + return batchPredictSettings; + } + + /** Returns the object with the settings used for calls to batchPredict. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + batchPredictOperationSettings() { + return batchPredictOperationSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public PredictionServiceStub createStub() throws IOException { if (getTransportChannelProvider() @@ -152,6 +175,8 @@ protected PredictionServiceStubSettings(Builder settingsBuilder) throws IOExcept super(settingsBuilder); predictSettings = settingsBuilder.predictSettings().build(); + batchPredictSettings = settingsBuilder.batchPredictSettings().build(); + batchPredictOperationSettings = settingsBuilder.batchPredictOperationSettings().build(); } /** Builder for PredictionServiceStubSettings. */ @@ -159,6 +184,10 @@ public static class Builder extends StubSettings.Builder> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder predictSettings; + private final UnaryCallSettings.Builder batchPredictSettings; + private final OperationCallSettings.Builder< + BatchPredictRequest, BatchPredictResult, OperationMetadata> + batchPredictOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -203,8 +232,12 @@ protected Builder(ClientContext clientContext) { predictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchPredictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchPredictOperationSettings = OperationCallSettings.newBuilder(); + unaryMethodSettingsBuilders = - ImmutableList.>of(predictSettings); + ImmutableList.>of(predictSettings, batchPredictSettings); initDefaults(this); } @@ -225,6 +258,34 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .batchPredictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .batchPredictOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(BatchPredictResult.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + return builder; } @@ -232,9 +293,11 @@ protected Builder(PredictionServiceStubSettings settings) { super(settings); predictSettings = settings.predictSettings.toBuilder(); + batchPredictSettings = settings.batchPredictSettings.toBuilder(); + batchPredictOperationSettings = settings.batchPredictOperationSettings.toBuilder(); unaryMethodSettingsBuilders = - ImmutableList.>of(predictSettings); + ImmutableList.>of(predictSettings, batchPredictSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -258,6 +321,19 @@ public UnaryCallSettings.Builder predictSetting return predictSettings; } + /** Returns the builder for the settings used for calls to batchPredict. */ + public UnaryCallSettings.Builder batchPredictSettings() { + return batchPredictSettings; + } + + /** Returns the builder for the settings used for calls to batchPredict. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + batchPredictOperationSettings() { + return batchPredictOperationSettings; + } + @Override public PredictionServiceStubSettings build() throws IOException { return new PredictionServiceStubSettings(this); diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java index 50b6077ed..c6c926124 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java @@ -442,17 +442,67 @@ public void exportDataExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getAnnotationSpecTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + int exampleCount = 1517063674; + AnnotationSpec expectedResponse = + AnnotationSpec.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setExampleCount(exampleCount) + .build(); + mockAutoMl.addResponse(expectedResponse); + + AnnotationSpecName name = + AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); + + AnnotationSpec actualResponse = client.getAnnotationSpec(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAnnotationSpecRequest actualRequest = (GetAnnotationSpecRequest) actualRequests.get(0); + + Assert.assertEquals(name, AnnotationSpecName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getAnnotationSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + AnnotationSpecName name = + AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); + + client.getAnnotationSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void createModelTest() throws Exception { String name = "name3373707"; String displayName = "displayName1615086568"; String datasetId = "datasetId-2115646910"; + String etag = "etag3123477"; Model expectedResponse = Model.newBuilder() .setName(name) .setDisplayName(displayName) .setDatasetId(datasetId) + .setEtag(etag) .build(); Operation resultOperation = Operation.newBuilder() @@ -505,11 +555,13 @@ public void getModelTest() { String name2 = "name2-1052831874"; String displayName = "displayName1615086568"; String datasetId = "datasetId-2115646910"; + String etag = "etag3123477"; Model expectedResponse = Model.newBuilder() .setName(name2) .setDisplayName(displayName) .setDatasetId(datasetId) + .setEtag(etag) .build(); mockAutoMl.addResponse(expectedResponse); @@ -551,11 +603,13 @@ public void updateModelTest() { String name = "name3373707"; String displayName = "displayName1615086568"; String datasetId = "datasetId-2115646910"; + String etag = "etag3123477"; Model expectedResponse = Model.newBuilder() .setName(name) .setDisplayName(displayName) .setDatasetId(datasetId) + .setEtag(etag) .build(); mockAutoMl.addResponse(expectedResponse); @@ -685,16 +739,110 @@ public void deleteModelExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deployModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Empty actualResponse = client.deployModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployModelRequest actualRequest = (DeployModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.deployModelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void undeployModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Empty actualResponse = client.undeployModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployModelRequest actualRequest = (UndeployModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void undeployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.undeployModelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getModelEvaluationTest() { String name2 = "name2-1052831874"; String annotationSpecId = "annotationSpecId60690191"; + String displayName = "displayName1615086568"; int evaluatedExampleCount = 277565350; ModelEvaluation expectedResponse = ModelEvaluation.newBuilder() .setName(name2) .setAnnotationSpecId(annotationSpecId) + .setDisplayName(displayName) .setEvaluatedExampleCount(evaluatedExampleCount) .build(); mockAutoMl.addResponse(expectedResponse); diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java index 7f1fa627b..f0334bf3a 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockAutoMlImpl.java @@ -159,6 +159,21 @@ public void exportData(ExportDataRequest request, StreamObserver resp } } + @Override + public void getAnnotationSpec( + GetAnnotationSpecRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AnnotationSpec) { + requests.add(request); + responseObserver.onNext((AnnotationSpec) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void createModel(CreateModelRequest request, StreamObserver responseObserver) { Object response = responses.remove(); @@ -230,6 +245,49 @@ public void updateModel(UpdateModelRequest request, StreamObserver respon } } + @Override + public void deployModel(DeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void undeployModel( + UndeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void exportModel(ExportModelRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + @Override public void getModelEvaluation( GetModelEvaluationRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java index 04a5363e6..aab9fe08b 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/MockPredictionServiceImpl.java @@ -17,6 +17,7 @@ import com.google.api.core.BetaApi; import com.google.cloud.automl.v1.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import io.grpc.stub.StreamObserver; import java.util.ArrayList; @@ -69,4 +70,19 @@ public void predict(PredictRequest request, StreamObserver resp responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } } + + @Override + public void batchPredict( + BatchPredictRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } } diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java index dbeb7b8fe..78eea81e8 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/PredictionServiceClientTest.java @@ -22,7 +22,10 @@ import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -30,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ExecutionException; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -120,4 +124,60 @@ public void predictExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void batchPredictTest() throws Exception { + BatchPredictResult expectedResponse = BatchPredictResult.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchPredictTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockPredictionService.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + Map params = new HashMap<>(); + + BatchPredictResult actualResponse = + client.batchPredictAsync(name, inputConfig, outputConfig, params).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchPredictRequest actualRequest = (BatchPredictRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertEquals(params, actualRequest.getParamsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + Map params = new HashMap<>(); + + client.batchPredictAsync(name, inputConfig, outputConfig, params).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()); + } + } } diff --git a/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java index d3882bc2c..3b57cc901 100644 --- a/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java +++ b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AutoMlGrpc.java @@ -403,6 +403,63 @@ private AutoMlGrpc() {} return getExportDataMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetAnnotationSpecMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec> + METHOD_GET_ANNOTATION_SPEC = getGetAnnotationSpecMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec> + getGetAnnotationSpecMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec> + getGetAnnotationSpecMethod() { + return getGetAnnotationSpecMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec> + getGetAnnotationSpecMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec> + getGetAnnotationSpecMethod; + if ((getGetAnnotationSpecMethod = AutoMlGrpc.getGetAnnotationSpecMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getGetAnnotationSpecMethod = AutoMlGrpc.getGetAnnotationSpecMethod) == null) { + AutoMlGrpc.getGetAnnotationSpecMethod = + getGetAnnotationSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.automl.v1.AutoMl", "GetAnnotationSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.GetAnnotationSpecRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.AnnotationSpec.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("GetAnnotationSpec")) + .build(); + } + } + } + return getGetAnnotationSpecMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getCreateModelMethod()} instead. public static final io.grpc.MethodDescriptor< @@ -658,6 +715,156 @@ private AutoMlGrpc() {} return getUpdateModelMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeployModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeployModelRequest, com.google.longrunning.Operation> + METHOD_DEPLOY_MODEL = getDeployModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod() { + return getDeployModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod; + if ((getDeployModelMethod = AutoMlGrpc.getDeployModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getDeployModelMethod = AutoMlGrpc.getDeployModelMethod) == null) { + AutoMlGrpc.getDeployModelMethod = + getDeployModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "DeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.DeployModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("DeployModel")) + .build(); + } + } + } + return getDeployModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUndeployModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UndeployModelRequest, com.google.longrunning.Operation> + METHOD_UNDEPLOY_MODEL = getUndeployModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod() { + return getUndeployModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod; + if ((getUndeployModelMethod = AutoMlGrpc.getUndeployModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getUndeployModelMethod = AutoMlGrpc.getUndeployModelMethod) == null) { + AutoMlGrpc.getUndeployModelMethod = + getUndeployModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "UndeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.UndeployModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("UndeployModel")) + .build(); + } + } + } + return getUndeployModelMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getExportModelMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportModelRequest, com.google.longrunning.Operation> + METHOD_EXPORT_MODEL = getExportModelMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportModelRequest, com.google.longrunning.Operation> + getExportModelMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportModelRequest, com.google.longrunning.Operation> + getExportModelMethod() { + return getExportModelMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportModelRequest, com.google.longrunning.Operation> + getExportModelMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.ExportModelRequest, com.google.longrunning.Operation> + getExportModelMethod; + if ((getExportModelMethod = AutoMlGrpc.getExportModelMethod) == null) { + synchronized (AutoMlGrpc.class) { + if ((getExportModelMethod = AutoMlGrpc.getExportModelMethod) == null) { + AutoMlGrpc.getExportModelMethod = + getExportModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.cloud.automl.v1.AutoMl", "ExportModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.ExportModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AutoMlMethodDescriptorSupplier("ExportModel")) + .build(); + } + } + } + return getExportModelMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getGetModelEvaluationMethod()} instead. public static final io.grpc.MethodDescriptor< @@ -907,6 +1114,19 @@ public void exportData( asyncUnimplementedUnaryCall(getExportDataMethodHelper(), responseObserver); } + /** + * + * + *
+     * Gets an annotation spec.
+     * 
+ */ + public void getAnnotationSpec( + com.google.cloud.automl.v1.GetAnnotationSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetAnnotationSpecMethodHelper(), responseObserver); + } + /** * * @@ -981,6 +1201,62 @@ public void updateModel( asyncUnimplementedUnaryCall(getUpdateModelMethodHelper(), responseObserver); } + /** + * + * + *
+     * Deploys a model. If a model is already deployed, deploying it with the
+     * same parameters has no effect. Deploying with different parametrs
+     * (as e.g. changing
+     * [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number])
+     *  will reset the deployment state without pausing the model's availability.
+     * Only applicable for Text Classification, Image Object Detection; all other
+     * domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void deployModel( + com.google.cloud.automl.v1.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeployModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Undeploys a model. If the model is not deployed this method has no effect.
+     * Only applicable for Text Classification, Image Object Detection;
+     * all other domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void undeployModel( + com.google.cloud.automl.v1.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUndeployModelMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Exports a trained, "export-able", model to a user specified Google Cloud
+     * Storage location. A model is considered export-able if and only if it has
+     * an export format defined for it in
+     * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportModel( + com.google.cloud.automl.v1.ExportModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getExportModelMethodHelper(), responseObserver); + } + /** * * @@ -1054,6 +1330,13 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.automl.v1.ExportDataRequest, com.google.longrunning.Operation>(this, METHODID_EXPORT_DATA))) + .addMethod( + getGetAnnotationSpecMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.GetAnnotationSpecRequest, + com.google.cloud.automl.v1.AnnotationSpec>( + this, METHODID_GET_ANNOTATION_SPEC))) .addMethod( getCreateModelMethodHelper(), asyncUnaryCall( @@ -1084,6 +1367,24 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.automl.v1.UpdateModelRequest, com.google.cloud.automl.v1.Model>(this, METHODID_UPDATE_MODEL))) + .addMethod( + getDeployModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.DeployModelRequest, + com.google.longrunning.Operation>(this, METHODID_DEPLOY_MODEL))) + .addMethod( + getUndeployModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.UndeployModelRequest, + com.google.longrunning.Operation>(this, METHODID_UNDEPLOY_MODEL))) + .addMethod( + getExportModelMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.ExportModelRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_MODEL))) .addMethod( getGetModelEvaluationMethodHelper(), asyncUnaryCall( @@ -1251,6 +1552,22 @@ public void exportData( responseObserver); } + /** + * + * + *
+     * Gets an annotation spec.
+     * 
+ */ + public void getAnnotationSpec( + com.google.cloud.automl.v1.GetAnnotationSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetAnnotationSpecMethodHelper(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1340,6 +1657,71 @@ public void updateModel( responseObserver); } + /** + * + * + *
+     * Deploys a model. If a model is already deployed, deploying it with the
+     * same parameters has no effect. Deploying with different parametrs
+     * (as e.g. changing
+     * [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number])
+     *  will reset the deployment state without pausing the model's availability.
+     * Only applicable for Text Classification, Image Object Detection; all other
+     * domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void deployModel( + com.google.cloud.automl.v1.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeployModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Undeploys a model. If the model is not deployed this method has no effect.
+     * Only applicable for Text Classification, Image Object Detection;
+     * all other domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void undeployModel( + com.google.cloud.automl.v1.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUndeployModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Exports a trained, "export-able", model to a user specified Google Cloud
+     * Storage location. A model is considered export-able if and only if it has
+     * an export format defined for it in
+     * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public void exportModel( + com.google.cloud.automl.v1.ExportModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getExportModelMethodHelper(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1502,6 +1884,19 @@ public com.google.longrunning.Operation exportData( getChannel(), getExportDataMethodHelper(), getCallOptions(), request); } + /** + * + * + *
+     * Gets an annotation spec.
+     * 
+ */ + public com.google.cloud.automl.v1.AnnotationSpec getAnnotationSpec( + com.google.cloud.automl.v1.GetAnnotationSpecRequest request) { + return blockingUnaryCall( + getChannel(), getGetAnnotationSpecMethodHelper(), getCallOptions(), request); + } + /** * * @@ -1574,6 +1969,62 @@ public com.google.cloud.automl.v1.Model updateModel( getChannel(), getUpdateModelMethodHelper(), getCallOptions(), request); } + /** + * + * + *
+     * Deploys a model. If a model is already deployed, deploying it with the
+     * same parameters has no effect. Deploying with different parametrs
+     * (as e.g. changing
+     * [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number])
+     *  will reset the deployment state without pausing the model's availability.
+     * Only applicable for Text Classification, Image Object Detection; all other
+     * domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation deployModel( + com.google.cloud.automl.v1.DeployModelRequest request) { + return blockingUnaryCall( + getChannel(), getDeployModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeploys a model. If the model is not deployed this method has no effect.
+     * Only applicable for Text Classification, Image Object Detection;
+     * all other domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation undeployModel( + com.google.cloud.automl.v1.UndeployModelRequest request) { + return blockingUnaryCall( + getChannel(), getUndeployModelMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports a trained, "export-able", model to a user specified Google Cloud
+     * Storage location. A model is considered export-able if and only if it has
+     * an export format defined for it in
+     * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.longrunning.Operation exportModel( + com.google.cloud.automl.v1.ExportModelRequest request) { + return blockingUnaryCall( + getChannel(), getExportModelMethodHelper(), getCallOptions(), request); + } + /** * * @@ -1729,6 +2180,20 @@ protected AutoMlFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getExportDataMethodHelper(), getCallOptions()), request); } + /** + * + * + *
+     * Gets an annotation spec.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.automl.v1.AnnotationSpec> + getAnnotationSpec(com.google.cloud.automl.v1.GetAnnotationSpecRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetAnnotationSpecMethodHelper(), getCallOptions()), request); + } + /** * * @@ -1803,6 +2268,62 @@ protected AutoMlFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getUpdateModelMethodHelper(), getCallOptions()), request); } + /** + * + * + *
+     * Deploys a model. If a model is already deployed, deploying it with the
+     * same parameters has no effect. Deploying with different parametrs
+     * (as e.g. changing
+     * [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number])
+     *  will reset the deployment state without pausing the model's availability.
+     * Only applicable for Text Classification, Image Object Detection; all other
+     * domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployModel(com.google.cloud.automl.v1.DeployModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeployModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys a model. If the model is not deployed this method has no effect.
+     * Only applicable for Text Classification, Image Object Detection;
+     * all other domains manage deployment automatically.
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployModel(com.google.cloud.automl.v1.UndeployModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getUndeployModelMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports a trained, "export-able", model to a user specified Google Cloud
+     * Storage location. A model is considered export-able if and only if it has
+     * an export format defined for it in
+     * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+     * Returns an empty response in the
+     * [response][google.longrunning.Operation.response] field when it completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportModel(com.google.cloud.automl.v1.ExportModelRequest request) { + return futureUnaryCall( + getChannel().newCall(getExportModelMethodHelper(), getCallOptions()), request); + } + /** * * @@ -1839,13 +2360,17 @@ protected AutoMlFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca private static final int METHODID_DELETE_DATASET = 4; private static final int METHODID_IMPORT_DATA = 5; private static final int METHODID_EXPORT_DATA = 6; - private static final int METHODID_CREATE_MODEL = 7; - private static final int METHODID_GET_MODEL = 8; - private static final int METHODID_LIST_MODELS = 9; - private static final int METHODID_DELETE_MODEL = 10; - private static final int METHODID_UPDATE_MODEL = 11; - private static final int METHODID_GET_MODEL_EVALUATION = 12; - private static final int METHODID_LIST_MODEL_EVALUATIONS = 13; + private static final int METHODID_GET_ANNOTATION_SPEC = 7; + private static final int METHODID_CREATE_MODEL = 8; + private static final int METHODID_GET_MODEL = 9; + private static final int METHODID_LIST_MODELS = 10; + private static final int METHODID_DELETE_MODEL = 11; + private static final int METHODID_UPDATE_MODEL = 12; + private static final int METHODID_DEPLOY_MODEL = 13; + private static final int METHODID_UNDEPLOY_MODEL = 14; + private static final int METHODID_EXPORT_MODEL = 15; + private static final int METHODID_GET_MODEL_EVALUATION = 16; + private static final int METHODID_LIST_MODEL_EVALUATIONS = 17; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1900,6 +2425,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.automl.v1.ExportDataRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_ANNOTATION_SPEC: + serviceImpl.getAnnotationSpec( + (com.google.cloud.automl.v1.GetAnnotationSpecRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_CREATE_MODEL: serviceImpl.createModel( (com.google.cloud.automl.v1.CreateModelRequest) request, @@ -1926,6 +2457,21 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.automl.v1.UpdateModelRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_DEPLOY_MODEL: + serviceImpl.deployModel( + (com.google.cloud.automl.v1.DeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_MODEL: + serviceImpl.undeployModel( + (com.google.cloud.automl.v1.UndeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPORT_MODEL: + serviceImpl.exportModel( + (com.google.cloud.automl.v1.ExportModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_MODEL_EVALUATION: serviceImpl.getModelEvaluation( (com.google.cloud.automl.v1.GetModelEvaluationRequest) request, @@ -2007,11 +2553,15 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getDeleteDatasetMethodHelper()) .addMethod(getImportDataMethodHelper()) .addMethod(getExportDataMethodHelper()) + .addMethod(getGetAnnotationSpecMethodHelper()) .addMethod(getCreateModelMethodHelper()) .addMethod(getGetModelMethodHelper()) .addMethod(getListModelsMethodHelper()) .addMethod(getDeleteModelMethodHelper()) .addMethod(getUpdateModelMethodHelper()) + .addMethod(getDeployModelMethodHelper()) + .addMethod(getUndeployModelMethodHelper()) + .addMethod(getExportModelMethodHelper()) .addMethod(getGetModelEvaluationMethodHelper()) .addMethod(getListModelEvaluationsMethodHelper()) .build(); diff --git a/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java index f3eea9507..c6ab47d77 100644 --- a/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java +++ b/grpc-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceGrpc.java @@ -92,6 +92,58 @@ private PredictionServiceGrpc() {} return getPredictMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBatchPredictMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.BatchPredictRequest, com.google.longrunning.Operation> + METHOD_BATCH_PREDICT = getBatchPredictMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.BatchPredictRequest, com.google.longrunning.Operation> + getBatchPredictMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.BatchPredictRequest, com.google.longrunning.Operation> + getBatchPredictMethod() { + return getBatchPredictMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.BatchPredictRequest, com.google.longrunning.Operation> + getBatchPredictMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.automl.v1.BatchPredictRequest, com.google.longrunning.Operation> + getBatchPredictMethod; + if ((getBatchPredictMethod = PredictionServiceGrpc.getBatchPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getBatchPredictMethod = PredictionServiceGrpc.getBatchPredictMethod) == null) { + PredictionServiceGrpc.getBatchPredictMethod = + getBatchPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.automl.v1.PredictionService", "BatchPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.automl.v1.BatchPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("BatchPredict")) + .build(); + } + } + } + return getBatchPredictMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static PredictionServiceStub newStub(io.grpc.Channel channel) { return new PredictionServiceStub(channel); @@ -127,8 +179,18 @@ public abstract static class PredictionServiceImplBase implements io.grpc.Bindab * Perform an online prediction. The prediction result will be directly * returned in the response. * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 * encoded. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. * */ public void predict( @@ -137,6 +199,30 @@ public void predict( asyncUnimplementedUnaryCall(getPredictMethodHelper(), responseObserver); } + /** + * + * + *
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch
+     * prediction result won't be immediately available in the response. Instead,
+     * a long running operation object is returned. User can poll the operation
+     * result via [GetOperation][google.longrunning.Operations.GetOperation]
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned
+     * in the [response][google.longrunning.Operation.response] field. Available
+     * for following ML problems:
+     * * Image Classification
+     * * Image Object Detection
+     * * Text Extraction
+     * 
+ */ + public void batchPredict( + com.google.cloud.automl.v1.BatchPredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBatchPredictMethodHelper(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -146,6 +232,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.automl.v1.PredictRequest, com.google.cloud.automl.v1.PredictResponse>(this, METHODID_PREDICT))) + .addMethod( + getBatchPredictMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.automl.v1.BatchPredictRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_PREDICT))) .build(); } } @@ -182,8 +274,18 @@ protected PredictionServiceStub build( * Perform an online prediction. The prediction result will be directly * returned in the response. * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 * encoded. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. * */ public void predict( @@ -194,6 +296,33 @@ public void predict( request, responseObserver); } + + /** + * + * + *
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch
+     * prediction result won't be immediately available in the response. Instead,
+     * a long running operation object is returned. User can poll the operation
+     * result via [GetOperation][google.longrunning.Operations.GetOperation]
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned
+     * in the [response][google.longrunning.Operation.response] field. Available
+     * for following ML problems:
+     * * Image Classification
+     * * Image Object Detection
+     * * Text Extraction
+     * 
+ */ + public void batchPredict( + com.google.cloud.automl.v1.BatchPredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchPredictMethodHelper(), getCallOptions()), + request, + responseObserver); + } } /** @@ -229,14 +358,48 @@ protected PredictionServiceBlockingStub build( * Perform an online prediction. The prediction result will be directly * returned in the response. * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 * encoded. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. * */ public com.google.cloud.automl.v1.PredictResponse predict( com.google.cloud.automl.v1.PredictRequest request) { return blockingUnaryCall(getChannel(), getPredictMethodHelper(), getCallOptions(), request); } + + /** + * + * + *
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch
+     * prediction result won't be immediately available in the response. Instead,
+     * a long running operation object is returned. User can poll the operation
+     * result via [GetOperation][google.longrunning.Operations.GetOperation]
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned
+     * in the [response][google.longrunning.Operation.response] field. Available
+     * for following ML problems:
+     * * Image Classification
+     * * Image Object Detection
+     * * Text Extraction
+     * 
+ */ + public com.google.longrunning.Operation batchPredict( + com.google.cloud.automl.v1.BatchPredictRequest request) { + return blockingUnaryCall( + getChannel(), getBatchPredictMethodHelper(), getCallOptions(), request); + } } /** @@ -271,8 +434,18 @@ protected PredictionServiceFutureStub build( * Perform an online prediction. The prediction result will be directly * returned in the response. * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 * encoded. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. * */ public com.google.common.util.concurrent.ListenableFuture< @@ -281,9 +454,34 @@ protected PredictionServiceFutureStub build( return futureUnaryCall( getChannel().newCall(getPredictMethodHelper(), getCallOptions()), request); } + + /** + * + * + *
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1.PredictionService.Predict], batch
+     * prediction result won't be immediately available in the response. Instead,
+     * a long running operation object is returned. User can poll the operation
+     * result via [GetOperation][google.longrunning.Operations.GetOperation]
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned
+     * in the [response][google.longrunning.Operation.response] field. Available
+     * for following ML problems:
+     * * Image Classification
+     * * Image Object Detection
+     * * Text Extraction
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchPredict(com.google.cloud.automl.v1.BatchPredictRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchPredictMethodHelper(), getCallOptions()), request); + } } private static final int METHODID_PREDICT = 0; + private static final int METHODID_BATCH_PREDICT = 1; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -308,6 +506,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_BATCH_PREDICT: + serviceImpl.batchPredict( + (com.google.cloud.automl.v1.BatchPredictRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -373,6 +576,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) .addMethod(getPredictMethodHelper()) + .addMethod(getBatchPredictMethodHelper()) .build(); } } diff --git a/proto-google-cloud-automl-v1/clirr-ignored-differences.xml b/proto-google-cloud-automl-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000..6001c7d30 --- /dev/null +++ b/proto-google-cloud-automl-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/automl/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/automl/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/automl/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java index 68669a251..e7be25e07 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayload.java @@ -37,7 +37,10 @@ private AnnotationPayload(com.google.protobuf.GeneratedMessageV3.Builder buil super(builder); } - private AnnotationPayload() {} + private AnnotationPayload() { + annotationSpecId_ = ""; + displayName_ = ""; + } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { @@ -63,6 +66,13 @@ private AnnotationPayload( case 0: done = true; break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + annotationSpecId_ = s; + break; + } case 18: { com.google.cloud.automl.v1.TranslationAnnotation.Builder subBuilder = null; @@ -80,6 +90,87 @@ private AnnotationPayload( detailCase_ = 2; break; } + case 26: + { + com.google.cloud.automl.v1.ClassificationAnnotation.Builder subBuilder = null; + if (detailCase_ == 3) { + subBuilder = + ((com.google.cloud.automl.v1.ClassificationAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage( + com.google.cloud.automl.v1.ClassificationAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.ClassificationAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 3; + break; + } + case 34: + { + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder subBuilder = null; + if (detailCase_ == 4) { + subBuilder = + ((com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_) + .toBuilder(); + } + detail_ = + input.readMessage( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 4; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 50: + { + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder subBuilder = null; + if (detailCase_ == 6) { + subBuilder = + ((com.google.cloud.automl.v1.TextExtractionAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage( + com.google.cloud.automl.v1.TextExtractionAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.TextExtractionAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 6; + break; + } + case 58: + { + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder subBuilder = null; + if (detailCase_ == 7) { + subBuilder = + ((com.google.cloud.automl.v1.TextSentimentAnnotation) detail_).toBuilder(); + } + detail_ = + input.readMessage( + com.google.cloud.automl.v1.TextSentimentAnnotation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.TextSentimentAnnotation) detail_); + detail_ = subBuilder.buildPartial(); + } + detailCase_ = 7; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -119,6 +210,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public enum DetailCase implements com.google.protobuf.Internal.EnumLite { TRANSLATION(2), + CLASSIFICATION(3), + IMAGE_OBJECT_DETECTION(4), + TEXT_EXTRACTION(6), + TEXT_SENTIMENT(7), DETAIL_NOT_SET(0); private final int value; @@ -135,6 +230,14 @@ public static DetailCase forNumber(int value) { switch (value) { case 2: return TRANSLATION; + case 3: + return CLASSIFICATION; + case 4: + return IMAGE_OBJECT_DETECTION; + case 6: + return TEXT_EXTRACTION; + case 7: + return TEXT_SENTIMENT; case 0: return DETAIL_NOT_SET; default: @@ -195,6 +298,283 @@ public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationO return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance(); } + public static final int CLASSIFICATION_FIELD_NUMBER = 3; + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public boolean hasClassification() { + return detailCase_ == 3; + } + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1.ClassificationAnnotation getClassification() { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder getClassificationOrBuilder() { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + + public static final int IMAGE_OBJECT_DETECTION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + public boolean hasImageObjectDetection() { + return detailCase_ == 4; + } + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getImageObjectDetection() { + if (detailCase_ == 4) { + return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder + getImageObjectDetectionOrBuilder() { + if (detailCase_ == 4) { + return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + + public static final int TEXT_EXTRACTION_FIELD_NUMBER = 6; + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public boolean hasTextExtraction() { + return detailCase_ == 6; + } + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public com.google.cloud.automl.v1.TextExtractionAnnotation getTextExtraction() { + if (detailCase_ == 6) { + return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder getTextExtractionOrBuilder() { + if (detailCase_ == 6) { + return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + + public static final int TEXT_SENTIMENT_FIELD_NUMBER = 7; + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public boolean hasTextSentiment() { + return detailCase_ == 7; + } + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public com.google.cloud.automl.v1.TextSentimentAnnotation getTextSentiment() { + if (detailCase_ == 7) { + return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder getTextSentimentOrBuilder() { + if (detailCase_ == 7) { + return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object annotationSpecId_; + /** + * + * + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId() { + java.lang.Object ref = annotationSpecId_; + 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(); + annotationSpecId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes() { + java.lang.Object ref = annotationSpecId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + annotationSpecId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * when the model was trained. Because this field returns a value at model
+   * training time, for different models trained using the same dataset, the
+   * returned value could be different as model owner could update the
+   * `display_name` between any two model training.
+   * 
+ * + * string display_name = 5; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * when the model was trained. Because this field returns a value at model
+   * training time, for different models trained using the same dataset, the
+   * returned value could be different as model owner could update the
+   * `display_name` between any two model training.
+   * 
+ * + * string display_name = 5; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -209,9 +589,27 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getAnnotationSpecIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_); + } if (detailCase_ == 2) { output.writeMessage(2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_); } + if (detailCase_ == 3) { + output.writeMessage(3, (com.google.cloud.automl.v1.ClassificationAnnotation) detail_); + } + if (detailCase_ == 4) { + output.writeMessage(4, (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + if (detailCase_ == 6) { + output.writeMessage(6, (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_); + } + if (detailCase_ == 7) { + output.writeMessage(7, (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_); + } unknownFields.writeTo(output); } @@ -221,11 +619,37 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (!getAnnotationSpecIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, annotationSpecId_); + } if (detailCase_ == 2) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_); } + if (detailCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.automl.v1.ClassificationAnnotation) detail_); + } + if (detailCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + if (detailCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_); + } + if (detailCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -242,11 +666,25 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.automl.v1.AnnotationPayload other = (com.google.cloud.automl.v1.AnnotationPayload) obj; + if (!getAnnotationSpecId().equals(other.getAnnotationSpecId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; if (!getDetailCase().equals(other.getDetailCase())) return false; switch (detailCase_) { case 2: if (!getTranslation().equals(other.getTranslation())) return false; break; + case 3: + if (!getClassification().equals(other.getClassification())) return false; + break; + case 4: + if (!getImageObjectDetection().equals(other.getImageObjectDetection())) return false; + break; + case 6: + if (!getTextExtraction().equals(other.getTextExtraction())) return false; + break; + case 7: + if (!getTextSentiment().equals(other.getTextSentiment())) return false; + break; case 0: default: } @@ -261,11 +699,31 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); switch (detailCase_) { case 2: hash = (37 * hash) + TRANSLATION_FIELD_NUMBER; hash = (53 * hash) + getTranslation().hashCode(); break; + case 3: + hash = (37 * hash) + CLASSIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getClassification().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_OBJECT_DETECTION_FIELD_NUMBER; + hash = (53 * hash) + getImageObjectDetection().hashCode(); + break; + case 6: + hash = (37 * hash) + TEXT_EXTRACTION_FIELD_NUMBER; + hash = (53 * hash) + getTextExtraction().hashCode(); + break; + case 7: + hash = (37 * hash) + TEXT_SENTIMENT_FIELD_NUMBER; + hash = (53 * hash) + getTextSentiment().hashCode(); + break; case 0: default: } @@ -414,6 +872,10 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + annotationSpecId_ = ""; + + displayName_ = ""; + detailCase_ = 0; detail_ = null; return this; @@ -450,6 +912,36 @@ public com.google.cloud.automl.v1.AnnotationPayload buildPartial() { result.detail_ = translationBuilder_.build(); } } + if (detailCase_ == 3) { + if (classificationBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = classificationBuilder_.build(); + } + } + if (detailCase_ == 4) { + if (imageObjectDetectionBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = imageObjectDetectionBuilder_.build(); + } + } + if (detailCase_ == 6) { + if (textExtractionBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = textExtractionBuilder_.build(); + } + } + if (detailCase_ == 7) { + if (textSentimentBuilder_ == null) { + result.detail_ = detail_; + } else { + result.detail_ = textSentimentBuilder_.build(); + } + } + result.annotationSpecId_ = annotationSpecId_; + result.displayName_ = displayName_; result.detailCase_ = detailCase_; onBuilt(); return result; @@ -500,26 +992,54 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other) { if (other == com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance()) return this; + if (!other.getAnnotationSpecId().isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } switch (other.getDetailCase()) { case TRANSLATION: { mergeTranslation(other.getTranslation()); break; } - case DETAIL_NOT_SET: + case CLASSIFICATION: { + mergeClassification(other.getClassification()); break; } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } + case IMAGE_OBJECT_DETECTION: + { + mergeImageObjectDetection(other.getImageObjectDetection()); + break; + } + case TEXT_EXTRACTION: + { + mergeTextExtraction(other.getTextExtraction()); + break; + } + case TEXT_SENTIMENT: + { + mergeTextSentiment(other.getTextSentiment()); + break; + } + case DETAIL_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } @java.lang.Override public Builder mergeFrom( @@ -756,6 +1276,1055 @@ public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationO return translationBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationAnnotation, + com.google.cloud.automl.v1.ClassificationAnnotation.Builder, + com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder> + classificationBuilder_; + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public boolean hasClassification() { + return detailCase_ == 3; + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1.ClassificationAnnotation getClassification() { + if (classificationBuilder_ == null) { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 3) { + return classificationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public Builder setClassification(com.google.cloud.automl.v1.ClassificationAnnotation value) { + if (classificationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + classificationBuilder_.setMessage(value); + } + detailCase_ = 3; + return this; + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public Builder setClassification( + com.google.cloud.automl.v1.ClassificationAnnotation.Builder builderForValue) { + if (classificationBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + classificationBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 3; + return this; + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public Builder mergeClassification(com.google.cloud.automl.v1.ClassificationAnnotation value) { + if (classificationBuilder_ == null) { + if (detailCase_ == 3 + && detail_ + != com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance()) { + detail_ = + com.google.cloud.automl.v1.ClassificationAnnotation.newBuilder( + (com.google.cloud.automl.v1.ClassificationAnnotation) detail_) + .mergeFrom(value) + .buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 3) { + classificationBuilder_.mergeFrom(value); + } + classificationBuilder_.setMessage(value); + } + detailCase_ = 3; + return this; + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public Builder clearClassification() { + if (classificationBuilder_ == null) { + if (detailCase_ == 3) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 3) { + detailCase_ = 0; + detail_ = null; + } + classificationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1.ClassificationAnnotation.Builder getClassificationBuilder() { + return getClassificationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + public com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder + getClassificationOrBuilder() { + if ((detailCase_ == 3) && (classificationBuilder_ != null)) { + return classificationBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 3) { + return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_; + } + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for content or image classification.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationAnnotation, + com.google.cloud.automl.v1.ClassificationAnnotation.Builder, + com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder> + getClassificationFieldBuilder() { + if (classificationBuilder_ == null) { + if (!(detailCase_ == 3)) { + detail_ = com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + classificationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationAnnotation, + com.google.cloud.automl.v1.ClassificationAnnotation.Builder, + com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder>( + (com.google.cloud.automl.v1.ClassificationAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 3; + onChanged(); + ; + return classificationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder> + imageObjectDetectionBuilder_; + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public boolean hasImageObjectDetection() { + return detailCase_ == 4; + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getImageObjectDetection() { + if (imageObjectDetectionBuilder_ == null) { + if (detailCase_ == 4) { + return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 4) { + return imageObjectDetectionBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public Builder setImageObjectDetection( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value) { + if (imageObjectDetectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + imageObjectDetectionBuilder_.setMessage(value); + } + detailCase_ = 4; + return this; + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public Builder setImageObjectDetection( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder builderForValue) { + if (imageObjectDetectionBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + imageObjectDetectionBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 4; + return this; + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public Builder mergeImageObjectDetection( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value) { + if (imageObjectDetectionBuilder_ == null) { + if (detailCase_ == 4 + && detail_ + != com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance()) { + detail_ = + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.newBuilder( + (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_) + .mergeFrom(value) + .buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 4) { + imageObjectDetectionBuilder_.mergeFrom(value); + } + imageObjectDetectionBuilder_.setMessage(value); + } + detailCase_ = 4; + return this; + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public Builder clearImageObjectDetection() { + if (imageObjectDetectionBuilder_ == null) { + if (detailCase_ == 4) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 4) { + detailCase_ = 0; + detail_ = null; + } + imageObjectDetectionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder + getImageObjectDetectionBuilder() { + return getImageObjectDetectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder + getImageObjectDetectionOrBuilder() { + if ((detailCase_ == 4) && (imageObjectDetectionBuilder_ != null)) { + return imageObjectDetectionBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 4) { + return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for image object detection.
+     * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder> + getImageObjectDetectionFieldBuilder() { + if (imageObjectDetectionBuilder_ == null) { + if (!(detailCase_ == 4)) { + detail_ = com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + imageObjectDetectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder>( + (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 4; + onChanged(); + ; + return imageObjectDetectionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionAnnotation, + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder, + com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder> + textExtractionBuilder_; + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public boolean hasTextExtraction() { + return detailCase_ == 6; + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public com.google.cloud.automl.v1.TextExtractionAnnotation getTextExtraction() { + if (textExtractionBuilder_ == null) { + if (detailCase_ == 6) { + return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 6) { + return textExtractionBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public Builder setTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value) { + if (textExtractionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + textExtractionBuilder_.setMessage(value); + } + detailCase_ = 6; + return this; + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public Builder setTextExtraction( + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder builderForValue) { + if (textExtractionBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + textExtractionBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 6; + return this; + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public Builder mergeTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value) { + if (textExtractionBuilder_ == null) { + if (detailCase_ == 6 + && detail_ + != com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance()) { + detail_ = + com.google.cloud.automl.v1.TextExtractionAnnotation.newBuilder( + (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_) + .mergeFrom(value) + .buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 6) { + textExtractionBuilder_.mergeFrom(value); + } + textExtractionBuilder_.setMessage(value); + } + detailCase_ = 6; + return this; + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public Builder clearTextExtraction() { + if (textExtractionBuilder_ == null) { + if (detailCase_ == 6) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 6) { + detailCase_ = 0; + detail_ = null; + } + textExtractionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public com.google.cloud.automl.v1.TextExtractionAnnotation.Builder getTextExtractionBuilder() { + return getTextExtractionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + public com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder + getTextExtractionOrBuilder() { + if ((detailCase_ == 6) && (textExtractionBuilder_ != null)) { + return textExtractionBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 6) { + return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for text extraction.
+     * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionAnnotation, + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder, + com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder> + getTextExtractionFieldBuilder() { + if (textExtractionBuilder_ == null) { + if (!(detailCase_ == 6)) { + detail_ = com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + textExtractionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionAnnotation, + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder, + com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder>( + (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 6; + onChanged(); + ; + return textExtractionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentAnnotation, + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder, + com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder> + textSentimentBuilder_; + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public boolean hasTextSentiment() { + return detailCase_ == 7; + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public com.google.cloud.automl.v1.TextSentimentAnnotation getTextSentiment() { + if (textSentimentBuilder_ == null) { + if (detailCase_ == 7) { + return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } else { + if (detailCase_ == 7) { + return textSentimentBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public Builder setTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value) { + if (textSentimentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + onChanged(); + } else { + textSentimentBuilder_.setMessage(value); + } + detailCase_ = 7; + return this; + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public Builder setTextSentiment( + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder builderForValue) { + if (textSentimentBuilder_ == null) { + detail_ = builderForValue.build(); + onChanged(); + } else { + textSentimentBuilder_.setMessage(builderForValue.build()); + } + detailCase_ = 7; + return this; + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public Builder mergeTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value) { + if (textSentimentBuilder_ == null) { + if (detailCase_ == 7 + && detail_ != com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance()) { + detail_ = + com.google.cloud.automl.v1.TextSentimentAnnotation.newBuilder( + (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_) + .mergeFrom(value) + .buildPartial(); + } else { + detail_ = value; + } + onChanged(); + } else { + if (detailCase_ == 7) { + textSentimentBuilder_.mergeFrom(value); + } + textSentimentBuilder_.setMessage(value); + } + detailCase_ = 7; + return this; + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public Builder clearTextSentiment() { + if (textSentimentBuilder_ == null) { + if (detailCase_ == 7) { + detailCase_ = 0; + detail_ = null; + onChanged(); + } + } else { + if (detailCase_ == 7) { + detailCase_ = 0; + detail_ = null; + } + textSentimentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public com.google.cloud.automl.v1.TextSentimentAnnotation.Builder getTextSentimentBuilder() { + return getTextSentimentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + public com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder getTextSentimentOrBuilder() { + if ((detailCase_ == 7) && (textSentimentBuilder_ != null)) { + return textSentimentBuilder_.getMessageOrBuilder(); + } else { + if (detailCase_ == 7) { + return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_; + } + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + } + /** + * + * + *
+     * Annotation details for text sentiment.
+     * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentAnnotation, + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder, + com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder> + getTextSentimentFieldBuilder() { + if (textSentimentBuilder_ == null) { + if (!(detailCase_ == 7)) { + detail_ = com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + textSentimentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentAnnotation, + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder, + com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder>( + (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_, + getParentForChildren(), + isClean()); + detail_ = null; + } + detailCase_ = 7; + onChanged(); + ; + return textSentimentBuilder_; + } + + private java.lang.Object annotationSpecId_ = ""; + /** + * + * + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId() { + java.lang.Object ref = annotationSpecId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + annotationSpecId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes() { + java.lang.Object ref = annotationSpecId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + annotationSpecId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + annotationSpecId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder clearAnnotationSpecId() { + + annotationSpecId_ = getDefaultInstance().getAnnotationSpecId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only . The resource ID of the annotation spec that
+     * this annotation pertains to. The annotation spec comes from either an
+     * ancestor dataset, or the dataset that was used to train the model in use.
+     * 
+ * + * string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + annotationSpecId_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * when the model was trained. Because this field returns a value at model
+     * training time, for different models trained using the same dataset, the
+     * returned value could be different as model owner could update the
+     * `display_name` between any two model training.
+     * 
+ * + * string display_name = 5; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * when the model was trained. Because this field returns a value at model
+     * training time, for different models trained using the same dataset, the
+     * returned value could be different as model owner could update the
+     * `display_name` between any two model training.
+     * 
+ * + * string display_name = 5; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * when the model was trained. Because this field returns a value at model
+     * training time, for different models trained using the same dataset, the
+     * returned value could be different as model owner could update the
+     * `display_name` between any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * when the model was trained. Because this field returns a value at model
+     * training time, for different models trained using the same dataset, the
+     * returned value could be different as model owner could update the
+     * `display_name` between any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * when the model was trained. Because this field returns a value at model
+     * training time, for different models trained using the same dataset, the
+     * returned value could be different as model owner could update the
+     * `display_name` between any two model training.
+     * 
+ * + * string display_name = 5; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java index a5ee4c261..768ff5dd4 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOrBuilder.java @@ -54,5 +54,186 @@ public interface AnnotationPayloadOrBuilder */ com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder(); + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + boolean hasClassification(); + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + com.google.cloud.automl.v1.ClassificationAnnotation getClassification(); + /** + * + * + *
+   * Annotation details for content or image classification.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + */ + com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder getClassificationOrBuilder(); + + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + boolean hasImageObjectDetection(); + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getImageObjectDetection(); + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + */ + com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder + getImageObjectDetectionOrBuilder(); + + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + boolean hasTextExtraction(); + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + com.google.cloud.automl.v1.TextExtractionAnnotation getTextExtraction(); + /** + * + * + *
+   * Annotation details for text extraction.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + */ + com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder getTextExtractionOrBuilder(); + + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + boolean hasTextSentiment(); + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + com.google.cloud.automl.v1.TextSentimentAnnotation getTextSentiment(); + /** + * + * + *
+   * Annotation details for text sentiment.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + */ + com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder getTextSentimentOrBuilder(); + + /** + * + * + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + java.lang.String getAnnotationSpecId(); + /** + * + * + *
+   * Output only . The resource ID of the annotation spec that
+   * this annotation pertains to. The annotation spec comes from either an
+   * ancestor dataset, or the dataset that was used to train the model in use.
+   * 
+ * + * string annotation_spec_id = 1; + */ + com.google.protobuf.ByteString getAnnotationSpecIdBytes(); + + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * when the model was trained. Because this field returns a value at model
+   * training time, for different models trained using the same dataset, the
+   * returned value could be different as model owner could update the
+   * `display_name` between any two model training.
+   * 
+ * + * string display_name = 5; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * when the model was trained. Because this field returns a value at model
+   * training time, for different models trained using the same dataset, the
+   * returned value could be different as model owner could update the
+   * `display_name` between any two model training.
+   * 
+ * + * string display_name = 5; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + public com.google.cloud.automl.v1.AnnotationPayload.DetailCase getDetailCase(); } diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java index fe32f4437..6dd6d2765 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationPayloadOuterClass.java @@ -41,17 +41,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n/google/cloud/automl/v1/annotation_payl" - + "oad.proto\022\026google.cloud.automl.v1\032(googl" - + "e/cloud/automl/v1/translation.proto\032\031goo" - + "gle/protobuf/any.proto\032\034google/api/annot" - + "ations.proto\"c\n\021AnnotationPayload\022D\n\013tra" - + "nslation\030\002 \001(\0132-.google.cloud.automl.v1." - + "TranslationAnnotationH\000B\010\n\006detailB\252\001\n\032co" - + "m.google.cloud.automl.v1P\001Z + * A definition of an annotation spec. + * + * + * Protobuf type {@code google.cloud.automl.v1.AnnotationSpec} + */ +public final class AnnotationSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.AnnotationSpec) + AnnotationSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnnotationSpec.newBuilder() to construct. + private AnnotationSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnnotationSpec() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AnnotationSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 72: + { + exampleCount_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AnnotationSpecOuterClass + .internal_static_google_cloud_automl_v1_AnnotationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AnnotationSpecOuterClass + .internal_static_google_cloud_automl_v1_AnnotationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.AnnotationSpec.class, + com.google.cloud.automl.v1.AnnotationSpec.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Resource name of the annotation spec.
+   * Form:
+   * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Resource name of the annotation spec.
+   * Form:
+   * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required.
+   * The name of the annotation spec to show in the interface. The name can be
+   * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+   * (_), and ASCII digits 0-9.
+   * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required.
+   * The name of the annotation spec to show in the interface. The name can be
+   * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+   * (_), and ASCII digits 0-9.
+   * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXAMPLE_COUNT_FIELD_NUMBER = 9; + private int exampleCount_; + /** + * + * + *
+   * Output only. The number of examples in the parent dataset
+   * labeled by the annotation spec.
+   * 
+ * + * int32 example_count = 9; + */ + public int getExampleCount() { + return exampleCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (exampleCount_ != 0) { + output.writeInt32(9, exampleCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (exampleCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, exampleCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.AnnotationSpec)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.AnnotationSpec other = + (com.google.cloud.automl.v1.AnnotationSpec) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (getExampleCount() != other.getExampleCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getExampleCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.AnnotationSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationSpec 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.automl.v1.AnnotationSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationSpec 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.automl.v1.AnnotationSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.AnnotationSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.AnnotationSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.AnnotationSpec 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.automl.v1.AnnotationSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.AnnotationSpec 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.automl.v1.AnnotationSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.AnnotationSpec 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.automl.v1.AnnotationSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A definition of an annotation spec.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.AnnotationSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.AnnotationSpec) + com.google.cloud.automl.v1.AnnotationSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AnnotationSpecOuterClass + .internal_static_google_cloud_automl_v1_AnnotationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AnnotationSpecOuterClass + .internal_static_google_cloud_automl_v1_AnnotationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.AnnotationSpec.class, + com.google.cloud.automl.v1.AnnotationSpec.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.AnnotationSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + exampleCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AnnotationSpecOuterClass + .internal_static_google_cloud_automl_v1_AnnotationSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationSpec getDefaultInstanceForType() { + return com.google.cloud.automl.v1.AnnotationSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationSpec build() { + com.google.cloud.automl.v1.AnnotationSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationSpec buildPartial() { + com.google.cloud.automl.v1.AnnotationSpec result = + new com.google.cloud.automl.v1.AnnotationSpec(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.exampleCount_ = exampleCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.AnnotationSpec) { + return mergeFrom((com.google.cloud.automl.v1.AnnotationSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationSpec other) { + if (other == com.google.cloud.automl.v1.AnnotationSpec.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getExampleCount() != 0) { + setExampleCount(other.getExampleCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.AnnotationSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.AnnotationSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Resource name of the annotation spec.
+     * Form:
+     * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Resource name of the annotation spec.
+     * Form:
+     * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Resource name of the annotation spec.
+     * Form:
+     * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the annotation spec.
+     * Form:
+     * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the annotation spec.
+     * Form:
+     * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required.
+     * The name of the annotation spec to show in the interface. The name can be
+     * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+     * (_), and ASCII digits 0-9.
+     * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required.
+     * The name of the annotation spec to show in the interface. The name can be
+     * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+     * (_), and ASCII digits 0-9.
+     * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required.
+     * The name of the annotation spec to show in the interface. The name can be
+     * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+     * (_), and ASCII digits 0-9.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required.
+     * The name of the annotation spec to show in the interface. The name can be
+     * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+     * (_), and ASCII digits 0-9.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required.
+     * The name of the annotation spec to show in the interface. The name can be
+     * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+     * (_), and ASCII digits 0-9.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int exampleCount_; + /** + * + * + *
+     * Output only. The number of examples in the parent dataset
+     * labeled by the annotation spec.
+     * 
+ * + * int32 example_count = 9; + */ + public int getExampleCount() { + return exampleCount_; + } + /** + * + * + *
+     * Output only. The number of examples in the parent dataset
+     * labeled by the annotation spec.
+     * 
+ * + * int32 example_count = 9; + */ + public Builder setExampleCount(int value) { + + exampleCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of examples in the parent dataset
+     * labeled by the annotation spec.
+     * 
+ * + * int32 example_count = 9; + */ + public Builder clearExampleCount() { + + exampleCount_ = 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.automl.v1.AnnotationSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.AnnotationSpec) + private static final com.google.cloud.automl.v1.AnnotationSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.AnnotationSpec(); + } + + public static com.google.cloud.automl.v1.AnnotationSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotationSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotationSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.AnnotationSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecName.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecName.java new file mode 100644 index 000000000..7534f7551 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecName.java @@ -0,0 +1,251 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.automl.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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AnnotationSpecName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String dataset; + private final String annotationSpec; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataset() { + return dataset; + } + + public String getAnnotationSpec() { + return annotationSpec; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AnnotationSpecName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataset = Preconditions.checkNotNull(builder.getDataset()); + annotationSpec = Preconditions.checkNotNull(builder.getAnnotationSpec()); + } + + public static AnnotationSpecName of( + String project, String location, String dataset, String annotationSpec) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataset(dataset) + .setAnnotationSpec(annotationSpec) + .build(); + } + + public static String format( + String project, String location, String dataset, String annotationSpec) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataset(dataset) + .setAnnotationSpec(annotationSpec) + .build() + .toString(); + } + + public static AnnotationSpecName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AnnotationSpecName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("dataset"), + matchMap.get("annotation_spec")); + } + + 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 (AnnotationSpecName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("dataset", dataset); + fieldMapBuilder.put("annotationSpec", annotationSpec); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "dataset", + dataset, + "annotation_spec", + annotationSpec); + } + + /** Builder for AnnotationSpecName. */ + public static class Builder { + + private String project; + private String location; + private String dataset; + private String annotationSpec; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataset() { + return dataset; + } + + public String getAnnotationSpec() { + return annotationSpec; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + public Builder setAnnotationSpec(String annotationSpec) { + this.annotationSpec = annotationSpec; + return this; + } + + private Builder() {} + + private Builder(AnnotationSpecName annotationSpecName) { + project = annotationSpecName.project; + location = annotationSpecName.location; + dataset = annotationSpecName.dataset; + annotationSpec = annotationSpecName.annotationSpec; + } + + public AnnotationSpecName build() { + return new AnnotationSpecName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AnnotationSpecName) { + AnnotationSpecName that = (AnnotationSpecName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.dataset.equals(that.dataset)) + && (this.annotationSpec.equals(that.annotationSpec)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= dataset.hashCode(); + h *= 1000003; + h ^= annotationSpec.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOrBuilder.java new file mode 100644 index 000000000..ab63de18e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/annotation_spec.proto + +package com.google.cloud.automl.v1; + +public interface AnnotationSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.AnnotationSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Resource name of the annotation spec.
+   * Form:
+   * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Resource name of the annotation spec.
+   * Form:
+   * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required.
+   * The name of the annotation spec to show in the interface. The name can be
+   * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+   * (_), and ASCII digits 0-9.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required.
+   * The name of the annotation spec to show in the interface. The name can be
+   * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
+   * (_), and ASCII digits 0-9.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The number of examples in the parent dataset
+   * labeled by the annotation spec.
+   * 
+ * + * int32 example_count = 9; + */ + int getExampleCount(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOuterClass.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOuterClass.java new file mode 100644 index 000000000..7cd131f16 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/AnnotationSpecOuterClass.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/annotation_spec.proto + +package com.google.cloud.automl.v1; + +public final class AnnotationSpecOuterClass { + private AnnotationSpecOuterClass() {} + + 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_automl_v1_AnnotationSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_AnnotationSpec_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/automl/v1/annotation_spec" + + ".proto\022\026google.cloud.automl.v1\032\034google/a" + + "pi/annotations.proto\"K\n\016AnnotationSpec\022\014" + + "\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\025\n\rex" + + "ample_count\030\t \001(\005B\252\001\n\032com.google.cloud.a" + + "utoml.v1P\001Z/v1/{nam" + + "e=projects/*/locations/*/datasets/*/anno" + + "tationSpecs/*}\022\223\001\n\013CreateModel\022*.google." + + "cloud.automl.v1.CreateModelRequest\032\035.goo" + + "gle.longrunning.Operation\"9\202\323\344\223\0023\"*/v1/{" + + "parent=projects/*/locations/*}/models:\005m" + + "odel\022\206\001\n\010GetModel\022\'.google.cloud.automl." + + "v1.GetModelRequest\032\035.google.cloud.automl" + + ".v1.Model\"2\202\323\344\223\002,\022*/v1/{name=projects/*/" + + "locations/*/models/*}\022\227\001\n\nListModels\022).g" + + "oogle.cloud.automl.v1.ListModelsRequest\032" + + "*.google.cloud.automl.v1.ListModelsRespo" + + "nse\"2\202\323\344\223\002,\022*/v1/{parent=projects/*/loca" + + "tions/*}/models\022\214\001\n\013DeleteModel\022*.google" + + ".cloud.automl.v1.DeleteModelRequest\032\035.go" + + "ogle.longrunning.Operation\"2\202\323\344\223\002,**/v1/" + + "{name=projects/*/locations/*/models/*}\022\231" + + "\001\n\013UpdateModel\022*.google.cloud.automl.v1." + + "UpdateModelRequest\032\035.google.cloud.automl" + + ".v1.Model\"?\202\323\344\223\002920/v1/{model.name=proje" + + "cts/*/locations/*/models/*}:\005model\022\226\001\n\013D" + + "eployModel\022*.google.cloud.automl.v1.Depl" + + "oyModelRequest\032\035.google.longrunning.Oper" + + "ation\"<\202\323\344\223\0026\"1/v1/{name=projects/*/loca" + + "tions/*/models/*}:deploy:\001*\022\234\001\n\rUndeploy" + + "Model\022,.google.cloud.automl.v1.UndeployM" + + "odelRequest\032\035.google.longrunning.Operati" + + "on\">\202\323\344\223\0028\"3/v1/{name=projects/*/locatio" + + "ns/*/models/*}:undeploy:\001*\022\226\001\n\013ExportMod" + + "el\022*.google.cloud.automl.v1.ExportModelR" + + "equest\032\035.google.longrunning.Operation\"<\202" + + "\323\344\223\0026\"1/v1/{name=projects/*/locations/*/" + + "models/*}:export:\001*\022\267\001\n\022GetModelEvaluati" + + "on\0221.google.cloud.automl.v1.GetModelEval" + + "uationRequest\032\'.google.cloud.automl.v1.M" + + "odelEvaluation\"E\202\323\344\223\002?\022=/v1/{name=projec" + + "ts/*/locations/*/models/*/modelEvaluatio" + + "ns/*}\022\310\001\n\024ListModelEvaluations\0223.google." + + "cloud.automl.v1.ListModelEvaluationsRequ" + + "est\0324.google.cloud.automl.v1.ListModelEv" + + "aluationsResponse\"E\202\323\344\223\002?\022=/v1/{parent=p" + + "rojects/*/locations/*/models/*}/modelEva" + + "luations\032I\312A\025automl.googleapis.com\322A.htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "ormB\267\001\n\032com.google.cloud.automl.v1B\013Auto" + + "MlProtoP\001Z + * Input configuration for BatchPredict Action. + * The format of input depends on the ML problem of the model used for + * prediction. As input source the + * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] + * is expected, unless specified otherwise. + * The formats are represented in EBNF with commas being literal and with + * non-terminal symbols defined near the end of this comment. The formats + * are: + * <h4>AutoML Natural Language</h4> + * <div class="ds-selector-tabs"><section><h5>Classification</h5> + * One or more CSV files where each line is a single column: + * GCS_FILE_PATH + * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. + * Supported file extensions: .TXT, .PDF + * Text files can be no larger than 10MB in size. + * Sample rows: + * gs://folder/text1.txt + * gs://folder/text2.pdf + * </section><section><h5>Sentiment Analysis</h5> + * One or more CSV files where each line is a single column: + * GCS_FILE_PATH + * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. + * Supported file extensions: .TXT, .PDF + * Text files can be no larger than 128kB in size. + * Sample rows: + * gs://folder/text1.txt + * gs://folder/text2.pdf + * </section><section><h5>Entity Extraction</h5> + * One or more JSONL (JSON Lines) files that either provide inline text or + * documents. You can only use one format, either inline text or documents, + * for a single call to [AutoMl.BatchPredict]. + * Each JSONL file contains a per line a proto that + * wraps a temporary user-assigned TextSnippet ID (string up to 2000 + * characters long) called "id", a TextSnippet proto (in + * JSON representation) and zero or more TextFeature protos. Any given + * text snippet content must have 30,000 characters or less, and also + * be UTF-8 NFC encoded (ASCII already is). The IDs provided should be + * unique. + * Each document JSONL file contains, per line, a proto that wraps a + * Document proto with `input_config` set. Only PDF documents are + * currently supported, and each PDF document cannot exceed 2MB in size. + * Each JSONL file must not exceed 100MB in size, and no more than 20 + * JSONL files may be passed. + * Sample inline JSONL file (Shown with artificial line + * breaks. Actual line breaks are denoted by "\n".): + * { + * "id": "my_first_id", + * "text_snippet": { "content": "dog car cat"}, + * "text_features": [ + * { + * "text_segment": {"start_offset": 4, "end_offset": 6}, + * "structural_type": PARAGRAPH, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ] + * }, + * } + * ], + * }\n + * { + * "id": "2", + * "text_snippet": { + * "content": "Extended sample content", + * "mime_type": "text/plain" + * } + * } + * Sample document JSONL file (Shown with artificial line + * breaks. Actual line breaks are denoted by "\n".): + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] + * } + * } + * } + * }\n + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] + * } + * } + * } + * } + * </section> + * </div> + * **Input field definitions:** + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/video.avi". + * **Errors:** + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * prediction does not happen. Regardless of overall success or failure the + * per-row failures, up to a certain count cap, will be listed in + * Operation.metadata.partial_failures. + * + * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictInputConfig} + */ +public final class BatchPredictInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictInputConfig) + BatchPredictInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictInputConfig.newBuilder() to construct. + private BatchPredictInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictInputConfig() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictInputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.automl.v1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictInputConfig.class, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase implements com.google.protobuf.Internal.EnumLite { + GCS_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return GCS_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1.GcsSource) source_; + } + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1.GcsSource) source_; + } + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1.GcsSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.automl.v1.GcsSource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictInputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictInputConfig other = + (com.google.cloud.automl.v1.BatchPredictInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig 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.automl.v1.BatchPredictInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig 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.automl.v1.BatchPredictInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig 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.automl.v1.BatchPredictInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig 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.automl.v1.BatchPredictInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig 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.automl.v1.BatchPredictInputConfig 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; + } + /** + * + * + *
+   * Input configuration for BatchPredict Action.
+   * The format of input depends on the ML problem of the model used for
+   * prediction. As input source the
+   * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source]
+   * is expected, unless specified otherwise.
+   * The formats are represented in EBNF with commas being literal and with
+   * non-terminal symbols defined near the end of this comment. The formats
+   * are:
+   * <h4>AutoML Natural Language</h4>
+   * <div class="ds-selector-tabs"><section><h5>Classification</h5>
+   * One or more CSV files where each line is a single column:
+   *     GCS_FILE_PATH
+   * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file.
+   * Supported file extensions: .TXT, .PDF
+   * Text files can be no larger than 10MB in size.
+   * Sample rows:
+   *     gs://folder/text1.txt
+   *     gs://folder/text2.pdf
+   * </section><section><h5>Sentiment Analysis</h5>
+   * One or more CSV files where each line is a single column:
+   *     GCS_FILE_PATH
+   * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file.
+   * Supported file extensions: .TXT, .PDF
+   * Text files can be no larger than 128kB in size.
+   * Sample rows:
+   *     gs://folder/text1.txt
+   *     gs://folder/text2.pdf
+   * </section><section><h5>Entity Extraction</h5>
+   * One or more JSONL (JSON Lines) files that either provide inline text or
+   * documents. You can only use one format, either inline text or documents,
+   * for a single call to [AutoMl.BatchPredict].
+   * Each JSONL file contains a per line a proto that
+   * wraps a temporary user-assigned TextSnippet ID (string up to 2000
+   * characters long) called "id", a TextSnippet proto (in
+   * JSON representation) and zero or more TextFeature protos. Any given
+   * text snippet content must have 30,000 characters or less, and also
+   * be UTF-8 NFC encoded (ASCII already is). The IDs provided should be
+   * unique.
+   * Each document JSONL file contains, per line, a proto that wraps a
+   * Document proto with `input_config` set. Only PDF documents are
+   * currently supported, and each PDF document cannot exceed 2MB in size.
+   * Each JSONL file must not exceed 100MB in size, and no more than 20
+   * JSONL files may be passed.
+   * Sample inline JSONL file (Shown with artificial line
+   * breaks. Actual line breaks are denoted by "\n".):
+   *     {
+   *        "id": "my_first_id",
+   *        "text_snippet": { "content": "dog car cat"},
+   *        "text_features": [
+   *          {
+   *            "text_segment": {"start_offset": 4, "end_offset": 6},
+   *            "structural_type": PARAGRAPH,
+   *            "bounding_poly": {
+   *              "normalized_vertices": [
+   *                {"x": 0.1, "y": 0.1},
+   *                {"x": 0.1, "y": 0.3},
+   *                {"x": 0.3, "y": 0.3},
+   *                {"x": 0.3, "y": 0.1},
+   *              ]
+   *            },
+   *          }
+   *        ],
+   *      }\n
+   *      {
+   *        "id": "2",
+   *        "text_snippet": {
+   *          "content": "Extended sample content",
+   *          "mime_type": "text/plain"
+   *        }
+   *      }
+   * Sample document JSONL file (Shown with artificial line
+   * breaks. Actual line breaks are denoted by "\n".):
+   *      {
+   *        "document": {
+   *          "input_config": {
+   *            "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ]
+   *            }
+   *          }
+   *        }
+   *      }\n
+   *      {
+   *        "document": {
+   *          "input_config": {
+   *            "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ]
+   *            }
+   *          }
+   *        }
+   *      }
+   *   </section>
+   * </div>
+   * **Input field definitions:**
+   * `GCS_FILE_PATH`
+   * : The path to a file on Google Cloud Storage. For example,
+   *   "gs://folder/video.avi".
+   *  **Errors:**
+   *  If any of the provided CSV files can't be parsed or if more than certain
+   *  percent of CSV rows cannot be processed then the operation fails and
+   *  prediction does not happen. Regardless of overall success or failure the
+   *  per-row failures, up to a certain count cap, will be listed in
+   *  Operation.metadata.partial_failures.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictInputConfig) + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictInputConfig.class, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BatchPredictInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictInputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictInputConfig build() { + com.google.cloud.automl.v1.BatchPredictInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictInputConfig buildPartial() { + com.google.cloud.automl.v1.BatchPredictInputConfig result = + new com.google.cloud.automl.v1.BatchPredictInputConfig(this); + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BatchPredictInputConfig) { + return mergeFrom((com.google.cloud.automl.v1.BatchPredictInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictInputConfig other) { + if (other == com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BatchPredictInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1.GcsSource) source_; + } + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsSource(com.google.cloud.automl.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.automl.v1.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.automl.v1.GcsSource.newBuilder( + (com.google.cloud.automl.v1.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + gcsSourceBuilder_.mergeFrom(value); + } + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.automl.v1.GcsSource) source_; + } + return com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.automl.v1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder>( + (com.google.cloud.automl.v1.GcsSource) source_, getParentForChildren(), isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return gcsSourceBuilder_; + } + + @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.automl.v1.BatchPredictInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictInputConfig) + private static final com.google.cloud.automl.v1.BatchPredictInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictInputConfig(); + } + + public static com.google.cloud.automl.v1.BatchPredictInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictInputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictInputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictInputConfigOrBuilder.java new file mode 100644 index 000000000..f22e7c5ea --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictInputConfigOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +public interface BatchPredictInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsSource getGcsSource(); + /** + * + * + *
+   * Required. The Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.automl.v1.BatchPredictInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadata.java new file mode 100644 index 000000000..23acb8cb2 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadata.java @@ -0,0 +1,1815 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Details of BatchPredict operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictOperationMetadata} + */ +public final class BatchPredictOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictOperationMetadata) + BatchPredictOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictOperationMetadata.newBuilder() to construct. + private BatchPredictOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.BatchPredictInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .Builder + subBuilder = null; + if (outputInfo_ != null) { + subBuilder = outputInfo_.toBuilder(); + } + outputInfo_ = + input.readMessage( + com.google.cloud.automl.v1.BatchPredictOperationMetadata + .BatchPredictOutputInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputInfo_); + outputInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.class, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder.class); + } + + public interface BatchPredictOutputInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the prediction output is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + java.lang.String getGcsOutputDirectory(); + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the prediction output is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + com.google.protobuf.ByteString getGcsOutputDirectoryBytes(); + + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .OutputLocationCase + getOutputLocationCase(); + } + /** + * + * + *
+   * Further describes this batch predict's output.
+   * Supplements
+   * [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig].
+   * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} + */ + public static final class BatchPredictOutputInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + BatchPredictOutputInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictOutputInfo.newBuilder() to construct. + private BatchPredictOutputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictOutputInfo() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictOutputInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + outputLocationCase_ = 1; + outputLocation_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.class, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .Builder.class); + } + + private int outputLocationCase_ = 0; + private java.lang.Object outputLocation_; + + public enum OutputLocationCase implements com.google.protobuf.Internal.EnumLite { + GCS_OUTPUT_DIRECTORY(1), + OUTPUTLOCATION_NOT_SET(0); + private final int value; + + private OutputLocationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static OutputLocationCase valueOf(int value) { + return forNumber(value); + } + + public static OutputLocationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_OUTPUT_DIRECTORY; + case 0: + return OUTPUTLOCATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OutputLocationCase getOutputLocationCase() { + return OutputLocationCase.forNumber(outputLocationCase_); + } + + public static final int GCS_OUTPUT_DIRECTORY_FIELD_NUMBER = 1; + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the prediction output is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + 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(); + if (outputLocationCase_ == 1) { + outputLocation_ = s; + } + return s; + } + } + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the prediction output is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (outputLocationCase_ == 1) { + outputLocation_ = 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 (outputLocationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputLocation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputLocationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputLocation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo other = + (com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) obj; + + if (!getOutputLocationCase().equals(other.getOutputLocationCase())) return false; + switch (outputLocationCase_) { + case 1: + if (!getGcsOutputDirectory().equals(other.getGcsOutputDirectory())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (outputLocationCase_) { + case 1: + hash = (37 * hash) + GCS_OUTPUT_DIRECTORY_FIELD_NUMBER; + hash = (53 * hash) + getGcsOutputDirectory().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo 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; + } + /** + * + * + *
+     * Further describes this batch predict's output.
+     * Supplements
+     * [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig].
+     * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .class, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + outputLocationCase_ = 0; + outputLocation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + build() { + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + buildPartial() { + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo result = + new com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo( + this); + if (outputLocationCase_ == 1) { + result.outputLocation_ = outputLocation_; + } + result.outputLocationCase_ = outputLocationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) { + return mergeFrom( + (com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo other) { + if (other + == com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .getDefaultInstance()) return this; + switch (other.getOutputLocationCase()) { + case GCS_OUTPUT_DIRECTORY: + { + outputLocationCase_ = 1; + outputLocation_ = other.outputLocation_; + onChanged(); + break; + } + case OUTPUTLOCATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int outputLocationCase_ = 0; + private java.lang.Object outputLocation_; + + public OutputLocationCase getOutputLocationCase() { + return OutputLocationCase.forNumber(outputLocationCase_); + } + + public Builder clearOutputLocation() { + outputLocationCase_ = 0; + outputLocation_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the prediction output is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputLocationCase_ == 1) { + outputLocation_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the prediction output is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (outputLocationCase_ == 1) { + outputLocation_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the prediction output is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputLocationCase_ = 1; + outputLocation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the prediction output is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder clearGcsOutputDirectory() { + if (outputLocationCase_ == 1) { + outputLocationCase_ = 0; + outputLocation_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the prediction output is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputLocationCase_ = 1; + outputLocation_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + private static final com.google.cloud.automl.v1.BatchPredictOperationMetadata + .BatchPredictOutputInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictOutputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictOutputInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.BatchPredictInputConfig inputConfig_; + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int OUTPUT_INFO_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + outputInfo_; + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public boolean hasOutputInfo() { + return outputInfo_ != null; + } + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + getOutputInfo() { + return outputInfo_ == null + ? com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .getDefaultInstance() + : outputInfo_; + } + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfoOrBuilder + getOutputInfoOrBuilder() { + return getOutputInfo(); + } + + 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 (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + if (outputInfo_ != null) { + output.writeMessage(2, getOutputInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + if (outputInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictOperationMetadata other = + (com.google.cloud.automl.v1.BatchPredictOperationMetadata) obj; + + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasOutputInfo() != other.hasOutputInfo()) return false; + if (hasOutputInfo()) { + if (!getOutputInfo().equals(other.getOutputInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasOutputInfo()) { + hash = (37 * hash) + OUTPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOutputInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata 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.automl.v1.BatchPredictOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata 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.automl.v1.BatchPredictOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata 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.automl.v1.BatchPredictOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata 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.automl.v1.BatchPredictOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata 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.automl.v1.BatchPredictOperationMetadata 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; + } + /** + * + * + *
+   * Details of BatchPredict operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictOperationMetadata) + com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.class, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BatchPredictOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata build() { + com.google.cloud.automl.v1.BatchPredictOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata buildPartial() { + com.google.cloud.automl.v1.BatchPredictOperationMetadata result = + new com.google.cloud.automl.v1.BatchPredictOperationMetadata(this); + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (outputInfoBuilder_ == null) { + result.outputInfo_ = outputInfo_; + } else { + result.outputInfo_ = outputInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BatchPredictOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.BatchPredictOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictOperationMetadata other) { + if (other == com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance()) + return this; + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasOutputInfo()) { + mergeOutputInfo(other.getOutputInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BatchPredictOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.BatchPredictInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.automl.v1.BatchPredictInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1.BatchPredictInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1.BatchPredictInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config that was given upon starting this
+     * batch predict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + outputInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadata + .BatchPredictOutputInfoOrBuilder> + outputInfoBuilder_; + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public boolean hasOutputInfo() { + return outputInfoBuilder_ != null || outputInfo_ != null; + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + getOutputInfo() { + if (outputInfoBuilder_ == null) { + return outputInfo_ == null + ? com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .getDefaultInstance() + : outputInfo_; + } else { + return outputInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputInfo_ = value; + onChanged(); + } else { + outputInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.Builder + builderForValue) { + if (outputInfoBuilder_ == null) { + outputInfo_ = builderForValue.build(); + onChanged(); + } else { + outputInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public Builder mergeOutputInfo( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (outputInfo_ != null) { + outputInfo_ = + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .newBuilder(outputInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + outputInfo_ = value; + } + onChanged(); + } else { + outputInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public Builder clearOutputInfo() { + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + onChanged(); + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.Builder + getOutputInfoBuilder() { + + onChanged(); + return getOutputInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfoOrBuilder + getOutputInfoOrBuilder() { + if (outputInfoBuilder_ != null) { + return outputInfoBuilder_.getMessageOrBuilder(); + } else { + return outputInfo_ == null + ? com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .getDefaultInstance() + : outputInfo_; + } + } + /** + * + * + *
+     * Output only. Information further describing this batch predict's output.
+     * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadata + .BatchPredictOutputInfoOrBuilder> + getOutputInfoFieldBuilder() { + if (outputInfoBuilder_ == null) { + outputInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + .Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadata + .BatchPredictOutputInfoOrBuilder>( + getOutputInfo(), getParentForChildren(), isClean()); + outputInfo_ = null; + } + return outputInfoBuilder_; + } + + @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.automl.v1.BatchPredictOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictOperationMetadata) + private static final com.google.cloud.automl.v1.BatchPredictOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictOperationMetadata(); + } + + public static com.google.cloud.automl.v1.BatchPredictOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadataOrBuilder.java new file mode 100644 index 000000000..f00e0c179 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOperationMetadataOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface BatchPredictOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig(); + /** + * + * + *
+   * Output only. The input config that was given upon starting this
+   * batch predict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + boolean hasOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo getOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing this batch predict's output.
+   * 
+ * + * + * .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * + */ + com.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfoOrBuilder + getOutputInfoOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfig.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfig.java new file mode 100644 index 000000000..9a47e961c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfig.java @@ -0,0 +1,1007 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Output configuration for BatchPredict Action.
+ * As destination the
+ * [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination]
+ * must be set unless specified otherwise for a domain. If gcs_destination is
+ * set then in the given directory a new directory is created. Its name
+ * will be
+ * "prediction-<model-display-name>-<timestamp-of-prediction-call>",
+ * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents
+ * of it depends on the ML problem the predictions are made for.
+ *  *  For Text Classification:
+ *         In the created directory files `text_classification_1.jsonl`,
+ *         `text_classification_2.jsonl`,...,`text_classification_N.jsonl`
+ *         will be created, where N may be 1, and depends on the
+ *         total number of inputs and annotations found.
+ *         Each .JSONL file will contain, per line, a JSON representation of a
+ *         proto that wraps input text (or pdf) file in
+ *         the text snippet (or document) proto and a list of
+ *         zero or more AnnotationPayload protos (called annotations), which
+ *         have classification detail populated. A single text (or pdf) file
+ *         will be listed only once with all its annotations, and its
+ *         annotations will never be split across files.
+ *         If prediction for any text (or pdf) file failed (partially or
+ *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+ *         `errors_N.jsonl` files will be created (N depends on total number of
+ *         failed predictions). These files will have a JSON representation of a
+ *         proto that wraps input text (or pdf) file followed by exactly one
+ * [`google.rpc.Status`](https:
+ * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+ *         containing only `code` and `message`.
+ *  *  For Text Sentiment:
+ *         In the created directory files `text_sentiment_1.jsonl`,
+ *         `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl`
+ *         will be created, where N may be 1, and depends on the
+ *         total number of inputs and annotations found.
+ *         Each .JSONL file will contain, per line, a JSON representation of a
+ *         proto that wraps input text (or pdf) file in
+ *         the text snippet (or document) proto and a list of
+ *         zero or more AnnotationPayload protos (called annotations), which
+ *         have text_sentiment detail populated. A single text (or pdf) file
+ *         will be listed only once with all its annotations, and its
+ *         annotations will never be split across files.
+ *         If prediction for any text (or pdf) file failed (partially or
+ *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+ *         `errors_N.jsonl` files will be created (N depends on total number of
+ *         failed predictions). These files will have a JSON representation of a
+ *         proto that wraps input text (or pdf) file followed by exactly one
+ * [`google.rpc.Status`](https:
+ * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+ *         containing only `code` and `message`.
+ *   *  For Text Extraction:
+ *         In the created directory files `text_extraction_1.jsonl`,
+ *         `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl`
+ *         will be created, where N may be 1, and depends on the
+ *         total number of inputs and annotations found.
+ *         The contents of these .JSONL file(s) depend on whether the input
+ *         used inline text, or documents.
+ *         If input was inline, then each .JSONL file will contain, per line,
+ *           a JSON representation of a proto that wraps given in request text
+ *           snippet's "id" (if specified), followed by input text snippet,
+ *           and a list of zero or more
+ *           AnnotationPayload protos (called annotations), which have
+ *           text_extraction detail populated. A single text snippet will be
+ *           listed only once with all its annotations, and its annotations will
+ *           never be split across files.
+ *         If input used documents, then each .JSONL file will contain, per
+ *           line, a JSON representation of a proto that wraps given in request
+ *           document proto, followed by its OCR-ed representation in the form
+ *           of a text snippet, finally followed by a list of zero or more
+ *           AnnotationPayload protos (called annotations), which have
+ *           text_extraction detail populated and refer, via their indices, to
+ *           the OCR-ed text snippet. A single document (and its text snippet)
+ *           will be listed only once with all its annotations, and its
+ *           annotations will never be split across files.
+ *         If prediction for any text snippet failed (partially or completely),
+ *         then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+ *         `errors_N.jsonl` files will be created (N depends on total number of
+ *         failed predictions). These files will have a JSON representation of a
+ *         proto that wraps either the "id" : "<id_value>" (in case of inline)
+ *         or the document proto (in case of document) but here followed by
+ *         exactly one [`google.rpc.Status`](https:
+ * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+ *         containing only `code` and `message`.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictOutputConfig} + */ +public final class BatchPredictOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictOutputConfig) + BatchPredictOutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictOutputConfig.newBuilder() to construct. + private BatchPredictOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictOutputConfig() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.automl.v1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOutputConfig.class, + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase implements com.google.protobuf.Internal.EnumLite { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1.GcsDestination) destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.automl.v1.GcsDestination) destination_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictOutputConfig other = + (com.google.cloud.automl.v1.BatchPredictOutputConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig 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.automl.v1.BatchPredictOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig 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.automl.v1.BatchPredictOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig 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.automl.v1.BatchPredictOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig 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.automl.v1.BatchPredictOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig 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.automl.v1.BatchPredictOutputConfig 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; + } + /** + * + * + *
+   * Output configuration for BatchPredict Action.
+   * As destination the
+   * [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination]
+   * must be set unless specified otherwise for a domain. If gcs_destination is
+   * set then in the given directory a new directory is created. Its name
+   * will be
+   * "prediction-<model-display-name>-<timestamp-of-prediction-call>",
+   * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents
+   * of it depends on the ML problem the predictions are made for.
+   *  *  For Text Classification:
+   *         In the created directory files `text_classification_1.jsonl`,
+   *         `text_classification_2.jsonl`,...,`text_classification_N.jsonl`
+   *         will be created, where N may be 1, and depends on the
+   *         total number of inputs and annotations found.
+   *         Each .JSONL file will contain, per line, a JSON representation of a
+   *         proto that wraps input text (or pdf) file in
+   *         the text snippet (or document) proto and a list of
+   *         zero or more AnnotationPayload protos (called annotations), which
+   *         have classification detail populated. A single text (or pdf) file
+   *         will be listed only once with all its annotations, and its
+   *         annotations will never be split across files.
+   *         If prediction for any text (or pdf) file failed (partially or
+   *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+   *         `errors_N.jsonl` files will be created (N depends on total number of
+   *         failed predictions). These files will have a JSON representation of a
+   *         proto that wraps input text (or pdf) file followed by exactly one
+   * [`google.rpc.Status`](https:
+   * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+   *         containing only `code` and `message`.
+   *  *  For Text Sentiment:
+   *         In the created directory files `text_sentiment_1.jsonl`,
+   *         `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl`
+   *         will be created, where N may be 1, and depends on the
+   *         total number of inputs and annotations found.
+   *         Each .JSONL file will contain, per line, a JSON representation of a
+   *         proto that wraps input text (or pdf) file in
+   *         the text snippet (or document) proto and a list of
+   *         zero or more AnnotationPayload protos (called annotations), which
+   *         have text_sentiment detail populated. A single text (or pdf) file
+   *         will be listed only once with all its annotations, and its
+   *         annotations will never be split across files.
+   *         If prediction for any text (or pdf) file failed (partially or
+   *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+   *         `errors_N.jsonl` files will be created (N depends on total number of
+   *         failed predictions). These files will have a JSON representation of a
+   *         proto that wraps input text (or pdf) file followed by exactly one
+   * [`google.rpc.Status`](https:
+   * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+   *         containing only `code` and `message`.
+   *   *  For Text Extraction:
+   *         In the created directory files `text_extraction_1.jsonl`,
+   *         `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl`
+   *         will be created, where N may be 1, and depends on the
+   *         total number of inputs and annotations found.
+   *         The contents of these .JSONL file(s) depend on whether the input
+   *         used inline text, or documents.
+   *         If input was inline, then each .JSONL file will contain, per line,
+   *           a JSON representation of a proto that wraps given in request text
+   *           snippet's "id" (if specified), followed by input text snippet,
+   *           and a list of zero or more
+   *           AnnotationPayload protos (called annotations), which have
+   *           text_extraction detail populated. A single text snippet will be
+   *           listed only once with all its annotations, and its annotations will
+   *           never be split across files.
+   *         If input used documents, then each .JSONL file will contain, per
+   *           line, a JSON representation of a proto that wraps given in request
+   *           document proto, followed by its OCR-ed representation in the form
+   *           of a text snippet, finally followed by a list of zero or more
+   *           AnnotationPayload protos (called annotations), which have
+   *           text_extraction detail populated and refer, via their indices, to
+   *           the OCR-ed text snippet. A single document (and its text snippet)
+   *           will be listed only once with all its annotations, and its
+   *           annotations will never be split across files.
+   *         If prediction for any text snippet failed (partially or completely),
+   *         then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
+   *         `errors_N.jsonl` files will be created (N depends on total number of
+   *         failed predictions). These files will have a JSON representation of a
+   *         proto that wraps either the "id" : "<id_value>" (in case of inline)
+   *         or the document proto (in case of document) but here followed by
+   *         exactly one [`google.rpc.Status`](https:
+   * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
+   *         containing only `code` and `message`.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictOutputConfig) + com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictOutputConfig.class, + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BatchPredictOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOutputConfig build() { + com.google.cloud.automl.v1.BatchPredictOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOutputConfig buildPartial() { + com.google.cloud.automl.v1.BatchPredictOutputConfig result = + new com.google.cloud.automl.v1.BatchPredictOutputConfig(this); + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BatchPredictOutputConfig) { + return mergeFrom((com.google.cloud.automl.v1.BatchPredictOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictOutputConfig other) { + if (other == com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BatchPredictOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination( + com.google.cloud.automl.v1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ != com.google.cloud.automl.v1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.automl.v1.GcsDestination.newBuilder( + (com.google.cloud.automl.v1.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location of the directory where the
+     * output is to be written to.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder>( + (com.google.cloud.automl.v1.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + ; + return gcsDestinationBuilder_; + } + + @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.automl.v1.BatchPredictOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictOutputConfig) + private static final com.google.cloud.automl.v1.BatchPredictOutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictOutputConfig(); + } + + public static com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictOutputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfigOrBuilder.java new file mode 100644 index 000000000..d33a92eb4 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictOutputConfigOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +public interface BatchPredictOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Required. The Google Cloud Storage location of the directory where the
+   * output is to be written to.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + public com.google.cloud.automl.v1.BatchPredictOutputConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequest.java new file mode 100644 index 000000000..c16e8f194 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequest.java @@ -0,0 +1,1653 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/prediction_service.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictRequest} + */ +public final class BatchPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictRequest) + BatchPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictRequest.newBuilder() to construct. + private BatchPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: + { + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.BatchPredictInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.BatchPredictOutputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + params_.getMutableMap().put(params__.getKey(), params__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictRequest.class, + com.google.cloud.automl.v1.BatchPredictRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the model requested to serve the batch prediction.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the model requested to serve the batch prediction.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1.BatchPredictInputConfig inputConfig_; + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1.BatchPredictOutputConfig outputConfig_; + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public com.google.cloud.automl.v1.BatchPredictOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int PARAMS_FIELD_NUMBER = 5; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + public java.lang.String getParamsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + public java.lang.String getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (inputConfig_ != null) { + output.writeMessage(3, getInputConfig()); + } + if (outputConfig_ != null) { + output.writeMessage(4, getOutputConfig()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInputConfig()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOutputConfig()); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, params__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictRequest other = + (com.google.cloud.automl.v1.BatchPredictRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest 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.automl.v1.BatchPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest 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.automl.v1.BatchPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest 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.automl.v1.BatchPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest 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.automl.v1.BatchPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest 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.automl.v1.BatchPredictRequest 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
+   * [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictRequest) + com.google.cloud.automl.v1.BatchPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictRequest.class, + com.google.cloud.automl.v1.BatchPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BatchPredictRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + internalGetMutableParams().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictRequest build() { + com.google.cloud.automl.v1.BatchPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictRequest buildPartial() { + com.google.cloud.automl.v1.BatchPredictRequest result = + new com.google.cloud.automl.v1.BatchPredictRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BatchPredictRequest) { + return mergeFrom((com.google.cloud.automl.v1.BatchPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictRequest other) { + if (other == com.google.cloud.automl.v1.BatchPredictRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.BatchPredictRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the model requested to serve the batch prediction.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the model requested to serve the batch prediction.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the model requested to serve the batch prediction.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the model requested to serve the batch prediction.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the model requested to serve the batch prediction.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.BatchPredictInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public Builder setInputConfig(com.google.cloud.automl.v1.BatchPredictInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1.BatchPredictInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1.BatchPredictInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + public com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The input configuration for batch prediction.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictInputConfig, + com.google.cloud.automl.v1.BatchPredictInputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.automl.v1.BatchPredictOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOutputConfig, + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public com.google.cloud.automl.v1.BatchPredictOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public Builder setOutputConfig(com.google.cloud.automl.v1.BatchPredictOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public Builder setOutputConfig( + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public Builder mergeOutputConfig(com.google.cloud.automl.v1.BatchPredictOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.automl.v1.BatchPredictOutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + public com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The Configuration specifying where output predictions should
+     * be written.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOutputConfig, + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOutputConfig, + com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder, + com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + private com.google.protobuf.MapField + internalGetMutableParams() { + onChanged(); + ; + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public java.lang.String getParamsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public java.lang.String getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParams() { + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public Builder putParams(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional domain-specific parameters for the predictions, any string must
+     * be up to 25000 characters long.
+     * *  For Text Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for a text snippet, it will only produce results
+     *         that have at least this confidence score. The default is 0.5.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *         makes predictions for an image, it will only produce results that
+     *         have at least this confidence score. The default is 0.5.
+     * *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be produced per image. Default is 100, the
+     *        requested value may be limited by server.
+     * 
+ * + * map<string, string> params = 5; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + 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.automl.v1.BatchPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictRequest) + private static final com.google.cloud.automl.v1.BatchPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictRequest(); + } + + public static com.google.cloud.automl.v1.BatchPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequestOrBuilder.java new file mode 100644 index 000000000..677c0ba50 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictRequestOrBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/prediction_service.proto + +package com.google.cloud.automl.v1; + +public interface BatchPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the model requested to serve the batch prediction.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the model requested to serve the batch prediction.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + com.google.cloud.automl.v1.BatchPredictInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The input configuration for batch prediction.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3; + */ + com.google.cloud.automl.v1.BatchPredictInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + com.google.cloud.automl.v1.BatchPredictOutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The Configuration specifying where output predictions should
+   * be written.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4; + */ + com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + java.lang.String getParamsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Additional domain-specific parameters for the predictions, any string must
+   * be up to 25000 characters long.
+   * *  For Text Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for a text snippet, it will only produce results
+   *         that have at least this confidence score. The default is 0.5.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *         makes predictions for an image, it will only produce results that
+   *         have at least this confidence score. The default is 0.5.
+   * *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be produced per image. Default is 100, the
+   *        requested value may be limited by server.
+   * 
+ * + * map<string, string> params = 5; + */ + java.lang.String getParamsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResult.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResult.java new file mode 100644 index 000000000..23ec2dc08 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResult.java @@ -0,0 +1,805 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/prediction_service.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Result of the Batch Predict. This message is returned in
+ * [response][google.longrunning.Operation.response] of the operation returned
+ * by the
+ * [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictResult} + */ +public final class BatchPredictResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictResult) + BatchPredictResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchPredictResult.newBuilder() to construct. + private BatchPredictResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchPredictResult() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchPredictResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictResult.class, + com.google.cloud.automl.v1.BatchPredictResult.Builder.class); + } + + public static final int METADATA_FIELD_NUMBER = 1; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictResult)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BatchPredictResult other = + (com.google.cloud.automl.v1.BatchPredictResult) obj; + + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BatchPredictResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictResult 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.automl.v1.BatchPredictResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictResult 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.automl.v1.BatchPredictResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BatchPredictResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BatchPredictResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictResult 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.automl.v1.BatchPredictResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictResult 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.automl.v1.BatchPredictResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BatchPredictResult 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.automl.v1.BatchPredictResult 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; + } + /** + * + * + *
+   * Result of the Batch Predict. This message is returned in
+   * [response][google.longrunning.Operation.response] of the operation returned
+   * by the
+   * [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BatchPredictResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictResult) + com.google.cloud.automl.v1.BatchPredictResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BatchPredictResult.class, + com.google.cloud.automl.v1.BatchPredictResult.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BatchPredictResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.PredictionServiceProto + .internal_static_google_cloud_automl_v1_BatchPredictResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictResult getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BatchPredictResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictResult build() { + com.google.cloud.automl.v1.BatchPredictResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictResult buildPartial() { + com.google.cloud.automl.v1.BatchPredictResult result = + new com.google.cloud.automl.v1.BatchPredictResult(this); + int from_bitField0_ = bitField0_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BatchPredictResult) { + return mergeFrom((com.google.cloud.automl.v1.BatchPredictResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictResult other) { + if (other == com.google.cloud.automl.v1.BatchPredictResult.getDefaultInstance()) return this; + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BatchPredictResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.BatchPredictResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public Builder putMetadata(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional domain-specific prediction response metadata.
+     * *  For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * 
+ * + * map<string, string> metadata = 1; + */ + public Builder putAllMetadata(java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + 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.automl.v1.BatchPredictResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictResult) + private static final com.google.cloud.automl.v1.BatchPredictResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictResult(); + } + + public static com.google.cloud.automl.v1.BatchPredictResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchPredictResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchPredictResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BatchPredictResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResultOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResultOrBuilder.java new file mode 100644 index 000000000..2b9954e2e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BatchPredictResultOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/prediction_service.proto + +package com.google.cloud.automl.v1; + +public interface BatchPredictResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BatchPredictResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + int getMetadataCount(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Additional domain-specific prediction response metadata.
+   * *  For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * 
+ * + * map<string, string> metadata = 1; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntry.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntry.java new file mode 100644 index 000000000..9450e603d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntry.java @@ -0,0 +1,2080 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Bounding box matching model metrics for a single intersection-over-union
+ * threshold and multiple label match confidence thresholds.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingBoxMetricsEntry} + */ +public final class BoundingBoxMetricsEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BoundingBoxMetricsEntry) + BoundingBoxMetricsEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoundingBoxMetricsEntry.newBuilder() to construct. + private BoundingBoxMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoundingBoxMetricsEntry() { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoundingBoxMetricsEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + iouThreshold_ = input.readFloat(); + break; + } + case 21: + { + meanAveragePrecision_ = input.readFloat(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + confidenceMetricsEntries_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry + .ConfidenceMetricsEntry>(); + mutable_bitField0_ |= 0x00000004; + } + confidenceMetricsEntries_.add( + input.readMessage( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + .parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + confidenceMetricsEntries_ = + java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.class, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder.class); + } + + public interface ConfidenceMetricsEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The confidence threshold value used to compute the metrics.
+     * 
+ * + * float confidence_threshold = 1; + */ + float getConfidenceThreshold(); + + /** + * + * + *
+     * Output only. Recall under the given confidence threshold.
+     * 
+ * + * float recall = 2; + */ + float getRecall(); + + /** + * + * + *
+     * Output only. Precision under the given confidence threshold.
+     * 
+ * + * float precision = 3; + */ + float getPrecision(); + + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 4; + */ + float getF1Score(); + } + /** + * + * + *
+   * Metrics for a single confidence threshold.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} + */ + public static final class ConfidenceMetricsEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + ConfidenceMetricsEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidenceMetricsEntry.newBuilder() to construct. + private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfidenceMetricsEntry() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConfidenceMetricsEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + confidenceThreshold_ = input.readFloat(); + break; + } + case 21: + { + recall_ = input.readFloat(); + break; + } + case 29: + { + precision_ = input.readFloat(); + break; + } + case 37: + { + f1Score_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.class, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + .class); + } + + public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1; + private float confidenceThreshold_; + /** + * + * + *
+     * Output only. The confidence threshold value used to compute the metrics.
+     * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + + public static final int RECALL_FIELD_NUMBER = 2; + private float recall_; + /** + * + * + *
+     * Output only. Recall under the given confidence threshold.
+     * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + + public static final int PRECISION_FIELD_NUMBER = 3; + private float precision_; + /** + * + * + *
+     * Output only. Precision under the given confidence threshold.
+     * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 4; + private float f1Score_; + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + + 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 (confidenceThreshold_ != 0F) { + output.writeFloat(1, confidenceThreshold_); + } + if (recall_ != 0F) { + output.writeFloat(2, recall_); + } + if (precision_ != 0F) { + output.writeFloat(3, precision_); + } + if (f1Score_ != 0F) { + output.writeFloat(4, f1Score_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (confidenceThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceThreshold_); + } + if (recall_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_); + } + if (precision_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, precision_); + } + if (f1Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, f1Score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry other = + (com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) obj; + + if (java.lang.Float.floatToIntBits(getConfidenceThreshold()) + != java.lang.Float.floatToIntBits(other.getConfidenceThreshold())) return false; + if (java.lang.Float.floatToIntBits(getRecall()) + != java.lang.Float.floatToIntBits(other.getRecall())) return false; + if (java.lang.Float.floatToIntBits(getPrecision()) + != java.lang.Float.floatToIntBits(other.getPrecision())) return false; + if (java.lang.Float.floatToIntBits(getF1Score()) + != java.lang.Float.floatToIntBits(other.getF1Score())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceThreshold()); + hash = (37 * hash) + RECALL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall()); + hash = (37 * hash) + PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision()); + hash = (37 * hash) + F1_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry 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 for a single confidence threshold.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.class, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + .class); + } + + // Construct using + // com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + confidenceThreshold_ = 0F; + + recall_ = 0F; + + precision_ = 0F; + + f1Score_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry build() { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + buildPartial() { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry result = + new com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(this); + result.confidenceThreshold_ = confidenceThreshold_; + result.recall_ = recall_; + result.precision_ = precision_; + result.f1Score_ = f1Score_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) { + return mergeFrom( + (com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry other) { + if (other + == com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + .getDefaultInstance()) return this; + if (other.getConfidenceThreshold() != 0F) { + setConfidenceThreshold(other.getConfidenceThreshold()); + } + if (other.getRecall() != 0F) { + setRecall(other.getRecall()); + } + if (other.getPrecision() != 0F) { + setPrecision(other.getPrecision()); + } + if (other.getF1Score() != 0F) { + setF1Score(other.getF1Score()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float confidenceThreshold_; + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder setConfidenceThreshold(float value) { + + confidenceThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder clearConfidenceThreshold() { + + confidenceThreshold_ = 0F; + onChanged(); + return this; + } + + private float recall_; + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 2; + */ + public Builder setRecall(float value) { + + recall_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 2; + */ + public Builder clearRecall() { + + recall_ = 0F; + onChanged(); + return this; + } + + private float precision_; + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public Builder setPrecision(float value) { + + precision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public Builder clearPrecision() { + + precision_ = 0F; + onChanged(); + return this; + } + + private float f1Score_; + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public Builder clearF1Score() { + + f1Score_ = 0F; + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + private static final com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfidenceMetricsEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfidenceMetricsEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int IOU_THRESHOLD_FIELD_NUMBER = 1; + private float iouThreshold_; + /** + * + * + *
+   * Output only. The intersection-over-union threshold value used to compute
+   * this metrics entry.
+   * 
+ * + * float iou_threshold = 1; + */ + public float getIouThreshold() { + return iouThreshold_; + } + + public static final int MEAN_AVERAGE_PRECISION_FIELD_NUMBER = 2; + private float meanAveragePrecision_; + /** + * + * + *
+   * Output only. The mean average precision, most often close to au_prc.
+   * 
+ * + * float mean_average_precision = 2; + */ + public float getMeanAveragePrecision() { + return meanAveragePrecision_; + } + + public static final int CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER = 3; + private java.util.List + confidenceMetricsEntries_; + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public java.util.List + getConfidenceMetricsEntriesList() { + return confidenceMetricsEntries_; + } + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList() { + return confidenceMetricsEntries_; + } + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public int getConfidenceMetricsEntriesCount() { + return confidenceMetricsEntries_.size(); + } + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index) { + return confidenceMetricsEntries_.get(index); + } + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index) { + return confidenceMetricsEntries_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (iouThreshold_ != 0F) { + output.writeFloat(1, iouThreshold_); + } + if (meanAveragePrecision_ != 0F) { + output.writeFloat(2, meanAveragePrecision_); + } + for (int i = 0; i < confidenceMetricsEntries_.size(); i++) { + output.writeMessage(3, confidenceMetricsEntries_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (iouThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, iouThreshold_); + } + if (meanAveragePrecision_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, meanAveragePrecision_); + } + for (int i = 0; i < confidenceMetricsEntries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, confidenceMetricsEntries_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BoundingBoxMetricsEntry)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BoundingBoxMetricsEntry other = + (com.google.cloud.automl.v1.BoundingBoxMetricsEntry) obj; + + if (java.lang.Float.floatToIntBits(getIouThreshold()) + != java.lang.Float.floatToIntBits(other.getIouThreshold())) return false; + if (java.lang.Float.floatToIntBits(getMeanAveragePrecision()) + != java.lang.Float.floatToIntBits(other.getMeanAveragePrecision())) return false; + if (!getConfidenceMetricsEntriesList().equals(other.getConfidenceMetricsEntriesList())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IOU_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getIouThreshold()); + hash = (37 * hash) + MEAN_AVERAGE_PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMeanAveragePrecision()); + if (getConfidenceMetricsEntriesCount() > 0) { + hash = (37 * hash) + CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceMetricsEntriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry 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.automl.v1.BoundingBoxMetricsEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry 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.automl.v1.BoundingBoxMetricsEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry 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.automl.v1.BoundingBoxMetricsEntry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry 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.automl.v1.BoundingBoxMetricsEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry 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.automl.v1.BoundingBoxMetricsEntry 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; + } + /** + * + * + *
+   * Bounding box matching model metrics for a single intersection-over-union
+   * threshold and multiple label match confidence thresholds.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingBoxMetricsEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BoundingBoxMetricsEntry) + com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.class, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BoundingBoxMetricsEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConfidenceMetricsEntriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + iouThreshold_ = 0F; + + meanAveragePrecision_ = 0F; + + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + confidenceMetricsEntriesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BoundingBoxMetricsEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry build() { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry buildPartial() { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry result = + new com.google.cloud.automl.v1.BoundingBoxMetricsEntry(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.iouThreshold_ = iouThreshold_; + result.meanAveragePrecision_ = meanAveragePrecision_; + if (confidenceMetricsEntriesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + confidenceMetricsEntries_ = + java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.confidenceMetricsEntries_ = confidenceMetricsEntries_; + } else { + result.confidenceMetricsEntries_ = confidenceMetricsEntriesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BoundingBoxMetricsEntry) { + return mergeFrom((com.google.cloud.automl.v1.BoundingBoxMetricsEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BoundingBoxMetricsEntry other) { + if (other == com.google.cloud.automl.v1.BoundingBoxMetricsEntry.getDefaultInstance()) + return this; + if (other.getIouThreshold() != 0F) { + setIouThreshold(other.getIouThreshold()); + } + if (other.getMeanAveragePrecision() != 0F) { + setMeanAveragePrecision(other.getMeanAveragePrecision()); + } + if (confidenceMetricsEntriesBuilder_ == null) { + if (!other.confidenceMetricsEntries_.isEmpty()) { + if (confidenceMetricsEntries_.isEmpty()) { + confidenceMetricsEntries_ = other.confidenceMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.addAll(other.confidenceMetricsEntries_); + } + onChanged(); + } + } else { + if (!other.confidenceMetricsEntries_.isEmpty()) { + if (confidenceMetricsEntriesBuilder_.isEmpty()) { + confidenceMetricsEntriesBuilder_.dispose(); + confidenceMetricsEntriesBuilder_ = null; + confidenceMetricsEntries_ = other.confidenceMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000004); + confidenceMetricsEntriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConfidenceMetricsEntriesFieldBuilder() + : null; + } else { + confidenceMetricsEntriesBuilder_.addAllMessages(other.confidenceMetricsEntries_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BoundingBoxMetricsEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.BoundingBoxMetricsEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private float iouThreshold_; + /** + * + * + *
+     * Output only. The intersection-over-union threshold value used to compute
+     * this metrics entry.
+     * 
+ * + * float iou_threshold = 1; + */ + public float getIouThreshold() { + return iouThreshold_; + } + /** + * + * + *
+     * Output only. The intersection-over-union threshold value used to compute
+     * this metrics entry.
+     * 
+ * + * float iou_threshold = 1; + */ + public Builder setIouThreshold(float value) { + + iouThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The intersection-over-union threshold value used to compute
+     * this metrics entry.
+     * 
+ * + * float iou_threshold = 1; + */ + public Builder clearIouThreshold() { + + iouThreshold_ = 0F; + onChanged(); + return this; + } + + private float meanAveragePrecision_; + /** + * + * + *
+     * Output only. The mean average precision, most often close to au_prc.
+     * 
+ * + * float mean_average_precision = 2; + */ + public float getMeanAveragePrecision() { + return meanAveragePrecision_; + } + /** + * + * + *
+     * Output only. The mean average precision, most often close to au_prc.
+     * 
+ * + * float mean_average_precision = 2; + */ + public Builder setMeanAveragePrecision(float value) { + + meanAveragePrecision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The mean average precision, most often close to au_prc.
+     * 
+ * + * float mean_average_precision = 2; + */ + public Builder clearMeanAveragePrecision() { + + meanAveragePrecision_ = 0F; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry> + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + + private void ensureConfidenceMetricsEntriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + confidenceMetricsEntries_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>( + confidenceMetricsEntries_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder> + confidenceMetricsEntriesBuilder_; + + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public java.util.List + getConfidenceMetricsEntriesList() { + if (confidenceMetricsEntriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } else { + return confidenceMetricsEntriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public int getConfidenceMetricsEntriesCount() { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.size(); + } else { + return confidenceMetricsEntriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.get(index); + } else { + return confidenceMetricsEntriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder setConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.set(index, value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder setConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder addConfidenceMetricsEntries( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder addConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(index, value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder addConfidenceMetricsEntries( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder addConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder addAllConfidenceMetricsEntries( + java.lang.Iterable< + ? extends com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry> + values) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceMetricsEntries_); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder clearConfidenceMetricsEntries() { + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public Builder removeConfidenceMetricsEntries(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.remove(index); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + getConfidenceMetricsEntriesBuilder(int index) { + return getConfidenceMetricsEntriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.get(index); + } else { + return confidenceMetricsEntriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList() { + if (confidenceMetricsEntriesBuilder_ != null) { + return confidenceMetricsEntriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntriesBuilder() { + return getConfidenceMetricsEntriesFieldBuilder() + .addBuilder( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntriesBuilder(int index) { + return getConfidenceMetricsEntriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics for each label-match confidence_threshold from
+     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+     * derived from them.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + public java.util.List< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder> + getConfidenceMetricsEntriesBuilderList() { + return getConfidenceMetricsEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesFieldBuilder() { + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder>( + confidenceMetricsEntries_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + confidenceMetricsEntries_ = null; + } + return confidenceMetricsEntriesBuilder_; + } + + @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.automl.v1.BoundingBoxMetricsEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BoundingBoxMetricsEntry) + private static final com.google.cloud.automl.v1.BoundingBoxMetricsEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + } + + public static com.google.cloud.automl.v1.BoundingBoxMetricsEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundingBoxMetricsEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoundingBoxMetricsEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntryOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntryOrBuilder.java new file mode 100644 index 000000000..8d9fa4905 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingBoxMetricsEntryOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +public interface BoundingBoxMetricsEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BoundingBoxMetricsEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The intersection-over-union threshold value used to compute
+   * this metrics entry.
+   * 
+ * + * float iou_threshold = 1; + */ + float getIouThreshold(); + + /** + * + * + *
+   * Output only. The mean average precision, most often close to au_prc.
+   * 
+ * + * float mean_average_precision = 2; + */ + float getMeanAveragePrecision(); + + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + java.util.List + getConfidenceMetricsEntriesList(); + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index); + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + int getConfidenceMetricsEntriesCount(); + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + java.util.List< + ? extends + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList(); + /** + * + * + *
+   * Output only. Metrics for each label-match confidence_threshold from
+   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
+   * derived from them.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * + */ + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPoly.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPoly.java new file mode 100644 index 000000000..1978ec51a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPoly.java @@ -0,0 +1,953 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/geometry.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * A bounding polygon of a detected object on a plane.
+ * On output both vertices and normalized_vertices are provided.
+ * The polygon is formed by connecting vertices in the order they are listed.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingPoly} + */ +public final class BoundingPoly extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BoundingPoly) + BoundingPolyOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoundingPoly.newBuilder() to construct. + private BoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoundingPoly() { + normalizedVertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoundingPoly( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + normalizedVertices_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + normalizedVertices_.add( + input.readMessage( + com.google.cloud.automl.v1.NormalizedVertex.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingPoly.class, + com.google.cloud.automl.v1.BoundingPoly.Builder.class); + } + + public static final int NORMALIZED_VERTICES_FIELD_NUMBER = 2; + private java.util.List normalizedVertices_; + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List getNormalizedVerticesList() { + return normalizedVertices_; + } + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + return normalizedVertices_; + } + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + return normalizedVertices_.size(); + } + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertex getNormalizedVertices(int index) { + return normalizedVertices_.get(index); + } + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + return normalizedVertices_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < normalizedVertices_.size(); i++) { + output.writeMessage(2, normalizedVertices_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < normalizedVertices_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, normalizedVertices_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.BoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.BoundingPoly other = (com.google.cloud.automl.v1.BoundingPoly) obj; + + if (!getNormalizedVerticesList().equals(other.getNormalizedVerticesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNormalizedVerticesCount() > 0) { + hash = (37 * hash) + NORMALIZED_VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedVerticesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.automl.v1.BoundingPoly prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A bounding polygon of a detected object on a plane.
+   * On output both vertices and normalized_vertices are provided.
+   * The polygon is formed by connecting vertices in the order they are listed.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.BoundingPoly} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BoundingPoly) + com.google.cloud.automl.v1.BoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.BoundingPoly.class, + com.google.cloud.automl.v1.BoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.BoundingPoly.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNormalizedVerticesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_BoundingPoly_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingPoly getDefaultInstanceForType() { + return com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingPoly build() { + com.google.cloud.automl.v1.BoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingPoly buildPartial() { + com.google.cloud.automl.v1.BoundingPoly result = + new com.google.cloud.automl.v1.BoundingPoly(this); + int from_bitField0_ = bitField0_; + if (normalizedVerticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.normalizedVertices_ = normalizedVertices_; + } else { + result.normalizedVertices_ = normalizedVerticesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.BoundingPoly) { + return mergeFrom((com.google.cloud.automl.v1.BoundingPoly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.BoundingPoly other) { + if (other == com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance()) return this; + if (normalizedVerticesBuilder_ == null) { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVertices_.isEmpty()) { + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.addAll(other.normalizedVertices_); + } + onChanged(); + } + } else { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVerticesBuilder_.isEmpty()) { + normalizedVerticesBuilder_.dispose(); + normalizedVerticesBuilder_ = null; + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000001); + normalizedVerticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNormalizedVerticesFieldBuilder() + : null; + } else { + normalizedVerticesBuilder_.addAllMessages(other.normalizedVertices_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.BoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.BoundingPoly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List normalizedVertices_ = + java.util.Collections.emptyList(); + + private void ensureNormalizedVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + normalizedVertices_ = + new java.util.ArrayList( + normalizedVertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.NormalizedVertex, + com.google.cloud.automl.v1.NormalizedVertex.Builder, + com.google.cloud.automl.v1.NormalizedVertexOrBuilder> + normalizedVerticesBuilder_; + + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List getNormalizedVerticesList() { + if (normalizedVerticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } else { + return normalizedVerticesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public int getNormalizedVerticesCount() { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.size(); + } else { + return normalizedVerticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertex getNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.automl.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.automl.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices(com.google.cloud.automl.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.automl.v1.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + com.google.cloud.automl.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.automl.v1.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder addAllNormalizedVertices( + java.lang.Iterable values) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, normalizedVertices_); + onChanged(); + } else { + normalizedVerticesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder clearNormalizedVertices() { + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public Builder removeNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.remove(index); + onChanged(); + } else { + normalizedVerticesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertex.Builder getNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + if (normalizedVerticesBuilder_ != null) { + return normalizedVerticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertex.Builder addNormalizedVerticesBuilder() { + return getNormalizedVerticesFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public com.google.cloud.automl.v1.NormalizedVertex.Builder addNormalizedVerticesBuilder( + int index) { + return getNormalizedVerticesFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * Output only . The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + public java.util.List + getNormalizedVerticesBuilderList() { + return getNormalizedVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.NormalizedVertex, + com.google.cloud.automl.v1.NormalizedVertex.Builder, + com.google.cloud.automl.v1.NormalizedVertexOrBuilder> + getNormalizedVerticesFieldBuilder() { + if (normalizedVerticesBuilder_ == null) { + normalizedVerticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.NormalizedVertex, + com.google.cloud.automl.v1.NormalizedVertex.Builder, + com.google.cloud.automl.v1.NormalizedVertexOrBuilder>( + normalizedVertices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + normalizedVertices_ = null; + } + return normalizedVerticesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.BoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BoundingPoly) + private static final com.google.cloud.automl.v1.BoundingPoly DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BoundingPoly(); + } + + public static com.google.cloud.automl.v1.BoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoundingPoly(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.BoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPolyOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPolyOrBuilder.java new file mode 100644 index 000000000..690164000 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/BoundingPolyOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/geometry.proto + +package com.google.cloud.automl.v1; + +public interface BoundingPolyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.BoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List getNormalizedVerticesList(); + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.automl.v1.NormalizedVertex getNormalizedVertices(int index); + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + int getNormalizedVerticesCount(); + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + java.util.List + getNormalizedVerticesOrBuilderList(); + /** + * + * + *
+   * Output only . The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + com.google.cloud.automl.v1.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder(int index); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotation.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotation.java new file mode 100644 index 000000000..3fe3e57ef --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotation.java @@ -0,0 +1,547 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/classification.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Contains annotation details specific to classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationAnnotation} + */ +public final class ClassificationAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationAnnotation) + ClassificationAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationAnnotation.newBuilder() to construct. + private ClassificationAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationAnnotation() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationAnnotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + score_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationAnnotation.class, + com.google.cloud.automl.v1.ClassificationAnnotation.Builder.class); + } + + public static final int SCORE_FIELD_NUMBER = 1; + private float score_; + /** + * + * + *
+   * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+   * means greater confidence that the annotation is positive. If a user
+   * approves an annotation as negative or positive, the score value remains
+   * unchanged. If a user creates an annotation, the score is 0 for negative or
+   * 1 for positive.
+   * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + + 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 (score_ != 0F) { + output.writeFloat(1, score_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ClassificationAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ClassificationAnnotation other = + (com.google.cloud.automl.v1.ClassificationAnnotation) obj; + + if (java.lang.Float.floatToIntBits(getScore()) + != java.lang.Float.floatToIntBits(other.getScore())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation 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.automl.v1.ClassificationAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation 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.automl.v1.ClassificationAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation 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.automl.v1.ClassificationAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation 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.automl.v1.ClassificationAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation 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.automl.v1.ClassificationAnnotation 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; + } + /** + * + * + *
+   * Contains annotation details specific to classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationAnnotation) + com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationAnnotation.class, + com.google.cloud.automl.v1.ClassificationAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ClassificationAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + score_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationAnnotation build() { + com.google.cloud.automl.v1.ClassificationAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationAnnotation buildPartial() { + com.google.cloud.automl.v1.ClassificationAnnotation result = + new com.google.cloud.automl.v1.ClassificationAnnotation(this); + result.score_ = score_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ClassificationAnnotation) { + return mergeFrom((com.google.cloud.automl.v1.ClassificationAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ClassificationAnnotation other) { + if (other == com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance()) + return this; + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ClassificationAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ClassificationAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float score_; + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence that the annotation is positive. If a user
+     * approves an annotation as negative or positive, the score value remains
+     * unchanged. If a user creates an annotation, the score is 0 for negative or
+     * 1 for positive.
+     * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence that the annotation is positive. If a user
+     * approves an annotation as negative or positive, the score value remains
+     * unchanged. If a user creates an annotation, the score is 0 for negative or
+     * 1 for positive.
+     * 
+ * + * float score = 1; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence that the annotation is positive. If a user
+     * approves an annotation as negative or positive, the score value remains
+     * unchanged. If a user creates an annotation, the score is 0 for negative or
+     * 1 for positive.
+     * 
+ * + * float score = 1; + */ + public Builder clearScore() { + + score_ = 0F; + 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.automl.v1.ClassificationAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationAnnotation) + private static final com.google.cloud.automl.v1.ClassificationAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ClassificationAnnotation(); + } + + public static com.google.cloud.automl.v1.ClassificationAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotationOrBuilder.java new file mode 100644 index 000000000..a357065e7 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationAnnotationOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/classification.proto + +package com.google.cloud.automl.v1; + +public interface ClassificationAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+   * means greater confidence that the annotation is positive. If a user
+   * approves an annotation as negative or positive, the score value remains
+   * unchanged. If a user creates an annotation, the score is 0 for negative or
+   * 1 for positive.
+   * 
+ * + * float score = 1; + */ + float getScore(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetrics.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetrics.java new file mode 100644 index 000000000..e7d70ee9d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetrics.java @@ -0,0 +1,6473 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/classification.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model evaluation metrics for classification problems.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics} + */ +public final class ClassificationEvaluationMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics) + ClassificationEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationEvaluationMetrics.newBuilder() to construct. + private ClassificationEvaluationMetrics( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationEvaluationMetrics() { + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationEvaluationMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + auPrc_ = input.readFloat(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + confidenceMetricsEntry_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntry>(); + mutable_bitField0_ |= 0x00000008; + } + confidenceMetricsEntry_.add( + input.readMessage( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntry.parser(), + extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + subBuilder = null; + if (confusionMatrix_ != null) { + subBuilder = confusionMatrix_.toBuilder(); + } + confusionMatrix_ = + input.readMessage( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(confusionMatrix_); + confusionMatrix_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + annotationSpecId_.add(s); + break; + } + case 53: + { + auRoc_ = input.readFloat(); + break; + } + case 61: + { + logLoss_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) != 0)) { + confidenceMetricsEntry_ = java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder.class); + } + + public interface ConfidenceMetricsEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Metrics are computed with an assumption that the model
+     * never returns predictions with score lower than this value.
+     * 
+ * + * float confidence_threshold = 1; + */ + float getConfidenceThreshold(); + + /** + * + * + *
+     * Output only. Metrics are computed with an assumption that the model
+     * always returns at most this many predictions (ordered by their score,
+     * descendingly), but they all still need to meet the confidence_threshold.
+     * 
+ * + * int32 position_threshold = 14; + */ + int getPositionThreshold(); + + /** + * + * + *
+     * Output only. Recall (True Positive Rate) for the given confidence
+     * threshold.
+     * 
+ * + * float recall = 2; + */ + float getRecall(); + + /** + * + * + *
+     * Output only. Precision for the given confidence threshold.
+     * 
+ * + * float precision = 3; + */ + float getPrecision(); + + /** + * + * + *
+     * Output only. False Positive Rate for the given confidence threshold.
+     * 
+ * + * float false_positive_rate = 8; + */ + float getFalsePositiveRate(); + + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 4; + */ + float getF1Score(); + + /** + * + * + *
+     * Output only. The Recall (True Positive Rate) when only considering the
+     * label that has the highest prediction score and not below the confidence
+     * threshold for each example.
+     * 
+ * + * float recall_at1 = 5; + */ + float getRecallAt1(); + + /** + * + * + *
+     * Output only. The precision when only considering the label that has the
+     * highest prediction score and not below the confidence threshold for each
+     * example.
+     * 
+ * + * float precision_at1 = 6; + */ + float getPrecisionAt1(); + + /** + * + * + *
+     * Output only. The False Positive Rate when only considering the label that
+     * has the highest prediction score and not below the confidence threshold
+     * for each example.
+     * 
+ * + * float false_positive_rate_at1 = 9; + */ + float getFalsePositiveRateAt1(); + + /** + * + * + *
+     * Output only. The harmonic mean of
+     * [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+     * and
+     * [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+     * 
+ * + * float f1_score_at1 = 7; + */ + float getF1ScoreAt1(); + + /** + * + * + *
+     * Output only. The number of model created labels that match a ground truth
+     * label.
+     * 
+ * + * int64 true_positive_count = 10; + */ + long getTruePositiveCount(); + + /** + * + * + *
+     * Output only. The number of model created labels that do not match a
+     * ground truth label.
+     * 
+ * + * int64 false_positive_count = 11; + */ + long getFalsePositiveCount(); + + /** + * + * + *
+     * Output only. The number of ground truth labels that are not matched
+     * by a model created label.
+     * 
+ * + * int64 false_negative_count = 12; + */ + long getFalseNegativeCount(); + + /** + * + * + *
+     * Output only. The number of labels that were not created by the model,
+     * but if they would, they would not match a ground truth label.
+     * 
+ * + * int64 true_negative_count = 13; + */ + long getTrueNegativeCount(); + } + /** + * + * + *
+   * Metrics for a single confidence threshold.
+   * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class ConfidenceMetricsEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + ConfidenceMetricsEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidenceMetricsEntry.newBuilder() to construct. + private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfidenceMetricsEntry() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConfidenceMetricsEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + confidenceThreshold_ = input.readFloat(); + break; + } + case 21: + { + recall_ = input.readFloat(); + break; + } + case 29: + { + precision_ = input.readFloat(); + break; + } + case 37: + { + f1Score_ = input.readFloat(); + break; + } + case 45: + { + recallAt1_ = input.readFloat(); + break; + } + case 53: + { + precisionAt1_ = input.readFloat(); + break; + } + case 61: + { + f1ScoreAt1_ = input.readFloat(); + break; + } + case 69: + { + falsePositiveRate_ = input.readFloat(); + break; + } + case 77: + { + falsePositiveRateAt1_ = input.readFloat(); + break; + } + case 80: + { + truePositiveCount_ = input.readInt64(); + break; + } + case 88: + { + falsePositiveCount_ = input.readInt64(); + break; + } + case 96: + { + falseNegativeCount_ = input.readInt64(); + break; + } + case 104: + { + trueNegativeCount_ = input.readInt64(); + break; + } + case 112: + { + positionThreshold_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder.class); + } + + public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1; + private float confidenceThreshold_; + /** + * + * + *
+     * Output only. Metrics are computed with an assumption that the model
+     * never returns predictions with score lower than this value.
+     * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + + public static final int POSITION_THRESHOLD_FIELD_NUMBER = 14; + private int positionThreshold_; + /** + * + * + *
+     * Output only. Metrics are computed with an assumption that the model
+     * always returns at most this many predictions (ordered by their score,
+     * descendingly), but they all still need to meet the confidence_threshold.
+     * 
+ * + * int32 position_threshold = 14; + */ + public int getPositionThreshold() { + return positionThreshold_; + } + + public static final int RECALL_FIELD_NUMBER = 2; + private float recall_; + /** + * + * + *
+     * Output only. Recall (True Positive Rate) for the given confidence
+     * threshold.
+     * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + + public static final int PRECISION_FIELD_NUMBER = 3; + private float precision_; + /** + * + * + *
+     * Output only. Precision for the given confidence threshold.
+     * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + + public static final int FALSE_POSITIVE_RATE_FIELD_NUMBER = 8; + private float falsePositiveRate_; + /** + * + * + *
+     * Output only. False Positive Rate for the given confidence threshold.
+     * 
+ * + * float false_positive_rate = 8; + */ + public float getFalsePositiveRate() { + return falsePositiveRate_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 4; + private float f1Score_; + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + + public static final int RECALL_AT1_FIELD_NUMBER = 5; + private float recallAt1_; + /** + * + * + *
+     * Output only. The Recall (True Positive Rate) when only considering the
+     * label that has the highest prediction score and not below the confidence
+     * threshold for each example.
+     * 
+ * + * float recall_at1 = 5; + */ + public float getRecallAt1() { + return recallAt1_; + } + + public static final int PRECISION_AT1_FIELD_NUMBER = 6; + private float precisionAt1_; + /** + * + * + *
+     * Output only. The precision when only considering the label that has the
+     * highest prediction score and not below the confidence threshold for each
+     * example.
+     * 
+ * + * float precision_at1 = 6; + */ + public float getPrecisionAt1() { + return precisionAt1_; + } + + public static final int FALSE_POSITIVE_RATE_AT1_FIELD_NUMBER = 9; + private float falsePositiveRateAt1_; + /** + * + * + *
+     * Output only. The False Positive Rate when only considering the label that
+     * has the highest prediction score and not below the confidence threshold
+     * for each example.
+     * 
+ * + * float false_positive_rate_at1 = 9; + */ + public float getFalsePositiveRateAt1() { + return falsePositiveRateAt1_; + } + + public static final int F1_SCORE_AT1_FIELD_NUMBER = 7; + private float f1ScoreAt1_; + /** + * + * + *
+     * Output only. The harmonic mean of
+     * [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+     * and
+     * [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+     * 
+ * + * float f1_score_at1 = 7; + */ + public float getF1ScoreAt1() { + return f1ScoreAt1_; + } + + public static final int TRUE_POSITIVE_COUNT_FIELD_NUMBER = 10; + private long truePositiveCount_; + /** + * + * + *
+     * Output only. The number of model created labels that match a ground truth
+     * label.
+     * 
+ * + * int64 true_positive_count = 10; + */ + public long getTruePositiveCount() { + return truePositiveCount_; + } + + public static final int FALSE_POSITIVE_COUNT_FIELD_NUMBER = 11; + private long falsePositiveCount_; + /** + * + * + *
+     * Output only. The number of model created labels that do not match a
+     * ground truth label.
+     * 
+ * + * int64 false_positive_count = 11; + */ + public long getFalsePositiveCount() { + return falsePositiveCount_; + } + + public static final int FALSE_NEGATIVE_COUNT_FIELD_NUMBER = 12; + private long falseNegativeCount_; + /** + * + * + *
+     * Output only. The number of ground truth labels that are not matched
+     * by a model created label.
+     * 
+ * + * int64 false_negative_count = 12; + */ + public long getFalseNegativeCount() { + return falseNegativeCount_; + } + + public static final int TRUE_NEGATIVE_COUNT_FIELD_NUMBER = 13; + private long trueNegativeCount_; + /** + * + * + *
+     * Output only. The number of labels that were not created by the model,
+     * but if they would, they would not match a ground truth label.
+     * 
+ * + * int64 true_negative_count = 13; + */ + public long getTrueNegativeCount() { + return trueNegativeCount_; + } + + 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 (confidenceThreshold_ != 0F) { + output.writeFloat(1, confidenceThreshold_); + } + if (recall_ != 0F) { + output.writeFloat(2, recall_); + } + if (precision_ != 0F) { + output.writeFloat(3, precision_); + } + if (f1Score_ != 0F) { + output.writeFloat(4, f1Score_); + } + if (recallAt1_ != 0F) { + output.writeFloat(5, recallAt1_); + } + if (precisionAt1_ != 0F) { + output.writeFloat(6, precisionAt1_); + } + if (f1ScoreAt1_ != 0F) { + output.writeFloat(7, f1ScoreAt1_); + } + if (falsePositiveRate_ != 0F) { + output.writeFloat(8, falsePositiveRate_); + } + if (falsePositiveRateAt1_ != 0F) { + output.writeFloat(9, falsePositiveRateAt1_); + } + if (truePositiveCount_ != 0L) { + output.writeInt64(10, truePositiveCount_); + } + if (falsePositiveCount_ != 0L) { + output.writeInt64(11, falsePositiveCount_); + } + if (falseNegativeCount_ != 0L) { + output.writeInt64(12, falseNegativeCount_); + } + if (trueNegativeCount_ != 0L) { + output.writeInt64(13, trueNegativeCount_); + } + if (positionThreshold_ != 0) { + output.writeInt32(14, positionThreshold_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (confidenceThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceThreshold_); + } + if (recall_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_); + } + if (precision_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, precision_); + } + if (f1Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, f1Score_); + } + if (recallAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, recallAt1_); + } + if (precisionAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, precisionAt1_); + } + if (f1ScoreAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, f1ScoreAt1_); + } + if (falsePositiveRate_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(8, falsePositiveRate_); + } + if (falsePositiveRateAt1_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, falsePositiveRateAt1_); + } + if (truePositiveCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, truePositiveCount_); + } + if (falsePositiveCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(11, falsePositiveCount_); + } + if (falseNegativeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(12, falseNegativeCount_); + } + if (trueNegativeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(13, trueNegativeCount_); + } + if (positionThreshold_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(14, positionThreshold_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) obj; + + if (java.lang.Float.floatToIntBits(getConfidenceThreshold()) + != java.lang.Float.floatToIntBits(other.getConfidenceThreshold())) return false; + if (getPositionThreshold() != other.getPositionThreshold()) return false; + if (java.lang.Float.floatToIntBits(getRecall()) + != java.lang.Float.floatToIntBits(other.getRecall())) return false; + if (java.lang.Float.floatToIntBits(getPrecision()) + != java.lang.Float.floatToIntBits(other.getPrecision())) return false; + if (java.lang.Float.floatToIntBits(getFalsePositiveRate()) + != java.lang.Float.floatToIntBits(other.getFalsePositiveRate())) return false; + if (java.lang.Float.floatToIntBits(getF1Score()) + != java.lang.Float.floatToIntBits(other.getF1Score())) return false; + if (java.lang.Float.floatToIntBits(getRecallAt1()) + != java.lang.Float.floatToIntBits(other.getRecallAt1())) return false; + if (java.lang.Float.floatToIntBits(getPrecisionAt1()) + != java.lang.Float.floatToIntBits(other.getPrecisionAt1())) return false; + if (java.lang.Float.floatToIntBits(getFalsePositiveRateAt1()) + != java.lang.Float.floatToIntBits(other.getFalsePositiveRateAt1())) return false; + if (java.lang.Float.floatToIntBits(getF1ScoreAt1()) + != java.lang.Float.floatToIntBits(other.getF1ScoreAt1())) return false; + if (getTruePositiveCount() != other.getTruePositiveCount()) return false; + if (getFalsePositiveCount() != other.getFalsePositiveCount()) return false; + if (getFalseNegativeCount() != other.getFalseNegativeCount()) return false; + if (getTrueNegativeCount() != other.getTrueNegativeCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceThreshold()); + hash = (37 * hash) + POSITION_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getPositionThreshold(); + hash = (37 * hash) + RECALL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall()); + hash = (37 * hash) + PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision()); + hash = (37 * hash) + FALSE_POSITIVE_RATE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFalsePositiveRate()); + hash = (37 * hash) + F1_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score()); + hash = (37 * hash) + RECALL_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecallAt1()); + hash = (37 * hash) + PRECISION_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecisionAt1()); + hash = (37 * hash) + FALSE_POSITIVE_RATE_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFalsePositiveRateAt1()); + hash = (37 * hash) + F1_SCORE_AT1_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1ScoreAt1()); + hash = (37 * hash) + TRUE_POSITIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTruePositiveCount()); + hash = (37 * hash) + FALSE_POSITIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFalsePositiveCount()); + hash = (37 * hash) + FALSE_NEGATIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFalseNegativeCount()); + hash = (37 * hash) + TRUE_NEGATIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrueNegativeCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + 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 for a single confidence threshold.
+     * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + confidenceThreshold_ = 0F; + + positionThreshold_ = 0; + + recall_ = 0F; + + precision_ = 0F; + + falsePositiveRate_ = 0F; + + f1Score_ = 0F; + + recallAt1_ = 0F; + + precisionAt1_ = 0F; + + falsePositiveRateAt1_ = 0F; + + f1ScoreAt1_ = 0F; + + truePositiveCount_ = 0L; + + falsePositiveCount_ = 0L; + + falseNegativeCount_ = 0L; + + trueNegativeCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + build() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + buildPartial() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry( + this); + result.confidenceThreshold_ = confidenceThreshold_; + result.positionThreshold_ = positionThreshold_; + result.recall_ = recall_; + result.precision_ = precision_; + result.falsePositiveRate_ = falsePositiveRate_; + result.f1Score_ = f1Score_; + result.recallAt1_ = recallAt1_; + result.precisionAt1_ = precisionAt1_; + result.falsePositiveRateAt1_ = falsePositiveRateAt1_; + result.f1ScoreAt1_ = f1ScoreAt1_; + result.truePositiveCount_ = truePositiveCount_; + result.falsePositiveCount_ = falsePositiveCount_; + result.falseNegativeCount_ = falseNegativeCount_; + result.trueNegativeCount_ = trueNegativeCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) { + return mergeFrom( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other) { + if (other + == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()) return this; + if (other.getConfidenceThreshold() != 0F) { + setConfidenceThreshold(other.getConfidenceThreshold()); + } + if (other.getPositionThreshold() != 0) { + setPositionThreshold(other.getPositionThreshold()); + } + if (other.getRecall() != 0F) { + setRecall(other.getRecall()); + } + if (other.getPrecision() != 0F) { + setPrecision(other.getPrecision()); + } + if (other.getFalsePositiveRate() != 0F) { + setFalsePositiveRate(other.getFalsePositiveRate()); + } + if (other.getF1Score() != 0F) { + setF1Score(other.getF1Score()); + } + if (other.getRecallAt1() != 0F) { + setRecallAt1(other.getRecallAt1()); + } + if (other.getPrecisionAt1() != 0F) { + setPrecisionAt1(other.getPrecisionAt1()); + } + if (other.getFalsePositiveRateAt1() != 0F) { + setFalsePositiveRateAt1(other.getFalsePositiveRateAt1()); + } + if (other.getF1ScoreAt1() != 0F) { + setF1ScoreAt1(other.getF1ScoreAt1()); + } + if (other.getTruePositiveCount() != 0L) { + setTruePositiveCount(other.getTruePositiveCount()); + } + if (other.getFalsePositiveCount() != 0L) { + setFalsePositiveCount(other.getFalsePositiveCount()); + } + if (other.getFalseNegativeCount() != 0L) { + setFalseNegativeCount(other.getFalseNegativeCount()); + } + if (other.getTrueNegativeCount() != 0L) { + setTrueNegativeCount(other.getTrueNegativeCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float confidenceThreshold_; + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * never returns predictions with score lower than this value.
+       * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * never returns predictions with score lower than this value.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder setConfidenceThreshold(float value) { + + confidenceThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * never returns predictions with score lower than this value.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder clearConfidenceThreshold() { + + confidenceThreshold_ = 0F; + onChanged(); + return this; + } + + private int positionThreshold_; + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * always returns at most this many predictions (ordered by their score,
+       * descendingly), but they all still need to meet the confidence_threshold.
+       * 
+ * + * int32 position_threshold = 14; + */ + public int getPositionThreshold() { + return positionThreshold_; + } + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * always returns at most this many predictions (ordered by their score,
+       * descendingly), but they all still need to meet the confidence_threshold.
+       * 
+ * + * int32 position_threshold = 14; + */ + public Builder setPositionThreshold(int value) { + + positionThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Metrics are computed with an assumption that the model
+       * always returns at most this many predictions (ordered by their score,
+       * descendingly), but they all still need to meet the confidence_threshold.
+       * 
+ * + * int32 position_threshold = 14; + */ + public Builder clearPositionThreshold() { + + positionThreshold_ = 0; + onChanged(); + return this; + } + + private float recall_; + /** + * + * + *
+       * Output only. Recall (True Positive Rate) for the given confidence
+       * threshold.
+       * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + /** + * + * + *
+       * Output only. Recall (True Positive Rate) for the given confidence
+       * threshold.
+       * 
+ * + * float recall = 2; + */ + public Builder setRecall(float value) { + + recall_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Recall (True Positive Rate) for the given confidence
+       * threshold.
+       * 
+ * + * float recall = 2; + */ + public Builder clearRecall() { + + recall_ = 0F; + onChanged(); + return this; + } + + private float precision_; + /** + * + * + *
+       * Output only. Precision for the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public float getPrecision() { + return precision_; + } + /** + * + * + *
+       * Output only. Precision for the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public Builder setPrecision(float value) { + + precision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Precision for the given confidence threshold.
+       * 
+ * + * float precision = 3; + */ + public Builder clearPrecision() { + + precision_ = 0F; + onChanged(); + return this; + } + + private float falsePositiveRate_; + /** + * + * + *
+       * Output only. False Positive Rate for the given confidence threshold.
+       * 
+ * + * float false_positive_rate = 8; + */ + public float getFalsePositiveRate() { + return falsePositiveRate_; + } + /** + * + * + *
+       * Output only. False Positive Rate for the given confidence threshold.
+       * 
+ * + * float false_positive_rate = 8; + */ + public Builder setFalsePositiveRate(float value) { + + falsePositiveRate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. False Positive Rate for the given confidence threshold.
+       * 
+ * + * float false_positive_rate = 8; + */ + public Builder clearFalsePositiveRate() { + + falsePositiveRate_ = 0F; + onChanged(); + return this; + } + + private float f1Score_; + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public float getF1Score() { + return f1Score_; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 4; + */ + public Builder clearF1Score() { + + f1Score_ = 0F; + onChanged(); + return this; + } + + private float recallAt1_; + /** + * + * + *
+       * Output only. The Recall (True Positive Rate) when only considering the
+       * label that has the highest prediction score and not below the confidence
+       * threshold for each example.
+       * 
+ * + * float recall_at1 = 5; + */ + public float getRecallAt1() { + return recallAt1_; + } + /** + * + * + *
+       * Output only. The Recall (True Positive Rate) when only considering the
+       * label that has the highest prediction score and not below the confidence
+       * threshold for each example.
+       * 
+ * + * float recall_at1 = 5; + */ + public Builder setRecallAt1(float value) { + + recallAt1_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The Recall (True Positive Rate) when only considering the
+       * label that has the highest prediction score and not below the confidence
+       * threshold for each example.
+       * 
+ * + * float recall_at1 = 5; + */ + public Builder clearRecallAt1() { + + recallAt1_ = 0F; + onChanged(); + return this; + } + + private float precisionAt1_; + /** + * + * + *
+       * Output only. The precision when only considering the label that has the
+       * highest prediction score and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float precision_at1 = 6; + */ + public float getPrecisionAt1() { + return precisionAt1_; + } + /** + * + * + *
+       * Output only. The precision when only considering the label that has the
+       * highest prediction score and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float precision_at1 = 6; + */ + public Builder setPrecisionAt1(float value) { + + precisionAt1_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The precision when only considering the label that has the
+       * highest prediction score and not below the confidence threshold for each
+       * example.
+       * 
+ * + * float precision_at1 = 6; + */ + public Builder clearPrecisionAt1() { + + precisionAt1_ = 0F; + onChanged(); + return this; + } + + private float falsePositiveRateAt1_; + /** + * + * + *
+       * Output only. The False Positive Rate when only considering the label that
+       * has the highest prediction score and not below the confidence threshold
+       * for each example.
+       * 
+ * + * float false_positive_rate_at1 = 9; + */ + public float getFalsePositiveRateAt1() { + return falsePositiveRateAt1_; + } + /** + * + * + *
+       * Output only. The False Positive Rate when only considering the label that
+       * has the highest prediction score and not below the confidence threshold
+       * for each example.
+       * 
+ * + * float false_positive_rate_at1 = 9; + */ + public Builder setFalsePositiveRateAt1(float value) { + + falsePositiveRateAt1_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The False Positive Rate when only considering the label that
+       * has the highest prediction score and not below the confidence threshold
+       * for each example.
+       * 
+ * + * float false_positive_rate_at1 = 9; + */ + public Builder clearFalsePositiveRateAt1() { + + falsePositiveRateAt1_ = 0F; + onChanged(); + return this; + } + + private float f1ScoreAt1_; + /** + * + * + *
+       * Output only. The harmonic mean of
+       * [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+       * and
+       * [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * 
+ * + * float f1_score_at1 = 7; + */ + public float getF1ScoreAt1() { + return f1ScoreAt1_; + } + /** + * + * + *
+       * Output only. The harmonic mean of
+       * [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+       * and
+       * [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * 
+ * + * float f1_score_at1 = 7; + */ + public Builder setF1ScoreAt1(float value) { + + f1ScoreAt1_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The harmonic mean of
+       * [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+       * and
+       * [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * 
+ * + * float f1_score_at1 = 7; + */ + public Builder clearF1ScoreAt1() { + + f1ScoreAt1_ = 0F; + onChanged(); + return this; + } + + private long truePositiveCount_; + /** + * + * + *
+       * Output only. The number of model created labels that match a ground truth
+       * label.
+       * 
+ * + * int64 true_positive_count = 10; + */ + public long getTruePositiveCount() { + return truePositiveCount_; + } + /** + * + * + *
+       * Output only. The number of model created labels that match a ground truth
+       * label.
+       * 
+ * + * int64 true_positive_count = 10; + */ + public Builder setTruePositiveCount(long value) { + + truePositiveCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The number of model created labels that match a ground truth
+       * label.
+       * 
+ * + * int64 true_positive_count = 10; + */ + public Builder clearTruePositiveCount() { + + truePositiveCount_ = 0L; + onChanged(); + return this; + } + + private long falsePositiveCount_; + /** + * + * + *
+       * Output only. The number of model created labels that do not match a
+       * ground truth label.
+       * 
+ * + * int64 false_positive_count = 11; + */ + public long getFalsePositiveCount() { + return falsePositiveCount_; + } + /** + * + * + *
+       * Output only. The number of model created labels that do not match a
+       * ground truth label.
+       * 
+ * + * int64 false_positive_count = 11; + */ + public Builder setFalsePositiveCount(long value) { + + falsePositiveCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The number of model created labels that do not match a
+       * ground truth label.
+       * 
+ * + * int64 false_positive_count = 11; + */ + public Builder clearFalsePositiveCount() { + + falsePositiveCount_ = 0L; + onChanged(); + return this; + } + + private long falseNegativeCount_; + /** + * + * + *
+       * Output only. The number of ground truth labels that are not matched
+       * by a model created label.
+       * 
+ * + * int64 false_negative_count = 12; + */ + public long getFalseNegativeCount() { + return falseNegativeCount_; + } + /** + * + * + *
+       * Output only. The number of ground truth labels that are not matched
+       * by a model created label.
+       * 
+ * + * int64 false_negative_count = 12; + */ + public Builder setFalseNegativeCount(long value) { + + falseNegativeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The number of ground truth labels that are not matched
+       * by a model created label.
+       * 
+ * + * int64 false_negative_count = 12; + */ + public Builder clearFalseNegativeCount() { + + falseNegativeCount_ = 0L; + onChanged(); + return this; + } + + private long trueNegativeCount_; + /** + * + * + *
+       * Output only. The number of labels that were not created by the model,
+       * but if they would, they would not match a ground truth label.
+       * 
+ * + * int64 true_negative_count = 13; + */ + public long getTrueNegativeCount() { + return trueNegativeCount_; + } + /** + * + * + *
+       * Output only. The number of labels that were not created by the model,
+       * but if they would, they would not match a ground truth label.
+       * 
+ * + * int64 true_negative_count = 13; + */ + public Builder setTrueNegativeCount(long value) { + + trueNegativeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The number of labels that were not created by the model,
+       * but if they would, they would not match a ground truth label.
+       * 
+ * + * int64 true_negative_count = 13; + */ + public Builder clearTrueNegativeCount() { + + trueNegativeCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntry + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfidenceMetricsEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfidenceMetricsEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConfusionMatrixOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + java.util.List getAnnotationSpecIdList(); + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + int getAnnotationSpecIdCount(); + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + java.lang.String getAnnotationSpecId(int index); + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index); + + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + java.util.List getDisplayNameList(); + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + int getDisplayNameCount(); + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + java.lang.String getDisplayName(int index); + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + com.google.protobuf.ByteString getDisplayNameBytes(int index); + + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + java.util.List + getRowList(); + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow( + int index); + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + int getRowCount(); + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder> + getRowOrBuilderList(); + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder + getRowOrBuilder(int index); + } + /** + * + * + *
+   * Confusion matrix of the model running the classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} + */ + public static final class ConfusionMatrix extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + ConfusionMatrixOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfusionMatrix.newBuilder() to construct. + private ConfusionMatrix(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfusionMatrix() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY; + row_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConfusionMatrix( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + annotationSpecId_.add(s); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + row_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .Row>(); + mutable_bitField0_ |= 0x00000004; + } + row_.add( + input.readMessage( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .Row.parser(), + extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + displayName_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + displayName_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + row_ = java.util.Collections.unmodifiableList(row_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + displayName_ = displayName_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + .class); + } + + public interface RowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + java.util.List getExampleCountList(); + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + int getExampleCountCount(); + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + int getExampleCount(int index); + } + /** + * + * + *
+     * Output only. A row in the confusion matrix.
+     * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} + */ + public static final class Row extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Row() { + exampleCount_ = emptyIntList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Row( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + exampleCount_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + exampleCount_.addInt(input.readInt32()); + break; + } + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + exampleCount_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + exampleCount_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + exampleCount_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder.class); + } + + public static final int EXAMPLE_COUNT_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.IntList exampleCount_; + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + public java.util.List getExampleCountList() { + return exampleCount_; + } + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCountCount() { + return exampleCount_.size(); + } + /** + * + * + *
+       * Output only. Value of the specific cell in the confusion matrix.
+       * The number of values each row has (i.e. the length of the row) is equal
+       * to the length of the `annotation_spec_id` field or, if that one is not
+       * populated, length of the
+       * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+       * field.
+       * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCount(int index) { + return exampleCount_.getInt(index); + } + + private int exampleCountMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getExampleCountList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(exampleCountMemoizedSerializedSize); + } + for (int i = 0; i < exampleCount_.size(); i++) { + output.writeInt32NoTag(exampleCount_.getInt(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < exampleCount_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + exampleCount_.getInt(i)); + } + size += dataSize; + if (!getExampleCountList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + exampleCountMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row other = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) obj; + + if (!getExampleCountList().equals(other.getExampleCountList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExampleCountCount() > 0) { + hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getExampleCountList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + 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; + } + /** + * + * + *
+       * Output only. A row in the confusion matrix.
+       * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + exampleCount_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + build() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + buildPartial() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row( + this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + exampleCount_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exampleCount_ = exampleCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) { + return mergeFrom( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row other) { + if (other + == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .getDefaultInstance()) return this; + if (!other.exampleCount_.isEmpty()) { + if (exampleCount_.isEmpty()) { + exampleCount_ = other.exampleCount_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExampleCountIsMutable(); + exampleCount_.addAll(other.exampleCount_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.IntList exampleCount_ = emptyIntList(); + + private void ensureExampleCountIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + exampleCount_ = mutableCopy(exampleCount_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public java.util.List getExampleCountList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(exampleCount_) + : exampleCount_; + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCountCount() { + return exampleCount_.size(); + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public int getExampleCount(int index) { + return exampleCount_.getInt(index); + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public Builder setExampleCount(int index, int value) { + ensureExampleCountIsMutable(); + exampleCount_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public Builder addExampleCount(int value) { + ensureExampleCountIsMutable(); + exampleCount_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public Builder addAllExampleCount(java.lang.Iterable values) { + ensureExampleCountIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exampleCount_); + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Value of the specific cell in the confusion matrix.
+         * The number of values each row has (i.e. the length of the row) is equal
+         * to the length of the `annotation_spec_id` field or, if that one is not
+         * populated, length of the
+         * [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
+         * field.
+         * 
+ * + * repeated int32 example_count = 1; + */ + public Builder clearExampleCount() { + exampleCount_ = emptyIntList(); + bitField0_ = (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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfusionMatrix.Row + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Row(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList annotationSpecId_; + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() { + return annotationSpecId_; + } + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + * + * + *
+     * Output only. IDs of the annotation specs used in the confusion matrix.
+     * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList displayName_; + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + public com.google.protobuf.ProtocolStringList getDisplayNameList() { + return displayName_; + } + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + public int getDisplayNameCount() { + return displayName_.size(); + } + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + public java.lang.String getDisplayName(int index) { + return displayName_.get(index); + } + /** + * + * + *
+     * Output only. Display name of the annotation specs used in the confusion
+     * matrix, as they were at the moment of the evaluation.
+     * 
+ * + * repeated string display_name = 3; + */ + public com.google.protobuf.ByteString getDisplayNameBytes(int index) { + return displayName_.getByteString(index); + } + + public static final int ROW_FIELD_NUMBER = 2; + private java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row> + row_; + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row> + getRowList() { + return row_; + } + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder> + getRowOrBuilderList() { + return row_; + } + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public int getRowCount() { + return row_.size(); + } + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow( + int index) { + return row_.get(index); + } + /** + * + * + *
+     * Output only. Rows in the confusion matrix. The number of rows is equal to
+     * the size of `annotation_spec_id`.
+     * `row[i].example_count[j]` is the number of examples that have ground
+     * truth of the `annotation_spec_id[i]` and are predicted as
+     * `annotation_spec_id[j]` by the model being evaluated.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder + getRowOrBuilder(int index) { + return row_.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 < annotationSpecId_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_.getRaw(i)); + } + for (int i = 0; i < row_.size(); i++) { + output.writeMessage(2, row_.get(i)); + } + for (int i = 0; i < displayName_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < annotationSpecId_.size(); i++) { + dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i)); + } + size += dataSize; + size += 1 * getAnnotationSpecIdList().size(); + } + for (int i = 0; i < row_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, row_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < displayName_.size(); i++) { + dataSize += computeStringSizeNoTag(displayName_.getRaw(i)); + } + size += dataSize; + size += 1 * getDisplayNameList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix other = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) obj; + + if (!getAnnotationSpecIdList().equals(other.getAnnotationSpecIdList())) return false; + if (!getDisplayNameList().equals(other.getDisplayNameList())) return false; + if (!getRowList().equals(other.getRowList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAnnotationSpecIdCount() > 0) { + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecIdList().hashCode(); + } + if (getDisplayNameCount() > 0) { + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayNameList().hashCode(); + } + if (getRowCount() > 0) { + hash = (37 * hash) + ROW_FIELD_NUMBER; + hash = (53 * hash) + getRowList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix 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; + } + /** + * + * + *
+     * Confusion matrix of the model running the classification.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + .class); + } + + // Construct using + // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRowFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (rowBuilder_ == null) { + row_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + rowBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix build() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + buildPartial() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.annotationSpecId_ = annotationSpecId_; + if (((bitField0_ & 0x00000002) != 0)) { + displayName_ = displayName_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.displayName_ = displayName_; + if (rowBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + row_ = java.util.Collections.unmodifiableList(row_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.row_ = row_; + } else { + result.row_ = rowBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) { + return mergeFrom( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix other) { + if (other + == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance()) return this; + if (!other.annotationSpecId_.isEmpty()) { + if (annotationSpecId_.isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.addAll(other.annotationSpecId_); + } + onChanged(); + } + if (!other.displayName_.isEmpty()) { + if (displayName_.isEmpty()) { + displayName_ = other.displayName_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDisplayNameIsMutable(); + displayName_.addAll(other.displayName_); + } + onChanged(); + } + if (rowBuilder_ == null) { + if (!other.row_.isEmpty()) { + if (row_.isEmpty()) { + row_ = other.row_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRowIsMutable(); + row_.addAll(other.row_); + } + onChanged(); + } + } else { + if (!other.row_.isEmpty()) { + if (rowBuilder_.isEmpty()) { + rowBuilder_.dispose(); + rowBuilder_ = null; + row_ = other.row_; + bitField0_ = (bitField0_ & ~0x00000004); + rowBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRowFieldBuilder() + : null; + } else { + rowBuilder_.addAllMessages(other.row_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList annotationSpecId_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAnnotationSpecIdIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() { + return annotationSpecId_.getUnmodifiableView(); + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder setAnnotationSpecId(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAnnotationSpecId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAllAnnotationSpecId(java.lang.Iterable values) { + ensureAnnotationSpecIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationSpecId_); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder clearAnnotationSpecId() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. IDs of the annotation specs used in the confusion matrix.
+       * 
+ * + * repeated string annotation_spec_id = 1; + */ + public Builder addAnnotationSpecIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList displayName_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDisplayNameIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + displayName_ = new com.google.protobuf.LazyStringArrayList(displayName_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public com.google.protobuf.ProtocolStringList getDisplayNameList() { + return displayName_.getUnmodifiableView(); + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public int getDisplayNameCount() { + return displayName_.size(); + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public java.lang.String getDisplayName(int index) { + return displayName_.get(index); + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public com.google.protobuf.ByteString getDisplayNameBytes(int index) { + return displayName_.getByteString(index); + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public Builder setDisplayName(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisplayNameIsMutable(); + displayName_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public Builder addDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisplayNameIsMutable(); + displayName_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public Builder addAllDisplayName(java.lang.Iterable values) { + ensureDisplayNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, displayName_); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public Builder clearDisplayName() { + displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Display name of the annotation specs used in the confusion
+       * matrix, as they were at the moment of the evaluation.
+       * 
+ * + * repeated string display_name = 3; + */ + public Builder addDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDisplayNameIsMutable(); + displayName_.add(value); + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row> + row_ = java.util.Collections.emptyList(); + + private void ensureRowIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + row_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>( + row_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder> + rowBuilder_; + + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row> + getRowList() { + if (rowBuilder_ == null) { + return java.util.Collections.unmodifiableList(row_); + } else { + return rowBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public int getRowCount() { + if (rowBuilder_ == null) { + return row_.size(); + } else { + return rowBuilder_.getCount(); + } + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow( + int index) { + if (rowBuilder_ == null) { + return row_.get(index); + } else { + return rowBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder setRow( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.set(index, value); + onChanged(); + } else { + rowBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder setRow( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.set(index, builderForValue.build()); + onChanged(); + } else { + rowBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder addRow( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.add(value); + onChanged(); + } else { + rowBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder addRow( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowIsMutable(); + row_.add(index, value); + onChanged(); + } else { + rowBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder addRow( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.add(builderForValue.build()); + onChanged(); + } else { + rowBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder addRow( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + builderForValue) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.add(index, builderForValue.build()); + onChanged(); + } else { + rowBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder addAllRow( + java.lang.Iterable< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .Row> + values) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, row_); + onChanged(); + } else { + rowBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder clearRow() { + if (rowBuilder_ == null) { + row_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + rowBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public Builder removeRow(int index) { + if (rowBuilder_ == null) { + ensureRowIsMutable(); + row_.remove(index); + onChanged(); + } else { + rowBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + getRowBuilder(int index) { + return getRowFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder + getRowOrBuilder(int index) { + if (rowBuilder_ == null) { + return row_.get(index); + } else { + return rowBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder> + getRowOrBuilderList() { + if (rowBuilder_ != null) { + return rowBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(row_); + } + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + addRowBuilder() { + return getRowFieldBuilder() + .addBuilder( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .getDefaultInstance()); + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder + addRowBuilder(int index) { + return getRowFieldBuilder() + .addBuilder( + index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .getDefaultInstance()); + } + /** + * + * + *
+       * Output only. Rows in the confusion matrix. The number of rows is equal to
+       * the size of `annotation_spec_id`.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
+       * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder> + getRowBuilderList() { + return getRowFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder> + getRowFieldBuilder() { + if (rowBuilder_ == null) { + rowBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .RowOrBuilder>( + row_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + row_ = null; + } + return rowBuilder_; + } + + @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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfusionMatrix parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfusionMatrix(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int AU_PRC_FIELD_NUMBER = 1; + private float auPrc_; + /** + * + * + *
+   * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
+   * for the overall evaluation.
+   * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + + public static final int AU_ROC_FIELD_NUMBER = 6; + private float auRoc_; + /** + * + * + *
+   * Output only. The Area Under Receiver Operating Characteristic curve metric.
+   * Micro-averaged for the overall evaluation.
+   * 
+ * + * float au_roc = 6; + */ + public float getAuRoc() { + return auRoc_; + } + + public static final int LOG_LOSS_FIELD_NUMBER = 7; + private float logLoss_; + /** + * + * + *
+   * Output only. The Log Loss metric.
+   * 
+ * + * float log_loss = 7; + */ + public float getLogLoss() { + return logLoss_; + } + + public static final int CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER = 3; + private java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry> + confidenceMetricsEntry_; + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry> + getConfidenceMetricsEntryList() { + return confidenceMetricsEntry_; + } + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntryOrBuilderList() { + return confidenceMetricsEntry_; + } + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public int getConfidenceMetricsEntryCount() { + return confidenceMetricsEntry_.size(); + } + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntry(int index) { + return confidenceMetricsEntry_.get(index); + } + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntryOrBuilder(int index) { + return confidenceMetricsEntry_.get(index); + } + + public static final int CONFUSION_MATRIX_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + confusionMatrix_; + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public boolean hasConfusionMatrix() { + return confusionMatrix_ != null; + } + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getConfusionMatrix() { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder() { + return getConfusionMatrix(); + } + + public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList annotationSpecId_; + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() { + return annotationSpecId_; + } + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (auPrc_ != 0F) { + output.writeFloat(1, auPrc_); + } + for (int i = 0; i < confidenceMetricsEntry_.size(); i++) { + output.writeMessage(3, confidenceMetricsEntry_.get(i)); + } + if (confusionMatrix_ != null) { + output.writeMessage(4, getConfusionMatrix()); + } + for (int i = 0; i < annotationSpecId_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, annotationSpecId_.getRaw(i)); + } + if (auRoc_ != 0F) { + output.writeFloat(6, auRoc_); + } + if (logLoss_ != 0F) { + output.writeFloat(7, logLoss_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (auPrc_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, auPrc_); + } + for (int i = 0; i < confidenceMetricsEntry_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, confidenceMetricsEntry_.get(i)); + } + if (confusionMatrix_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConfusionMatrix()); + } + { + int dataSize = 0; + for (int i = 0; i < annotationSpecId_.size(); i++) { + dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i)); + } + size += dataSize; + size += 1 * getAnnotationSpecIdList().size(); + } + if (auRoc_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, auRoc_); + } + if (logLoss_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, logLoss_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ClassificationEvaluationMetrics other = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) obj; + + if (java.lang.Float.floatToIntBits(getAuPrc()) + != java.lang.Float.floatToIntBits(other.getAuPrc())) return false; + if (java.lang.Float.floatToIntBits(getAuRoc()) + != java.lang.Float.floatToIntBits(other.getAuRoc())) return false; + if (java.lang.Float.floatToIntBits(getLogLoss()) + != java.lang.Float.floatToIntBits(other.getLogLoss())) return false; + if (!getConfidenceMetricsEntryList().equals(other.getConfidenceMetricsEntryList())) + return false; + if (hasConfusionMatrix() != other.hasConfusionMatrix()) return false; + if (hasConfusionMatrix()) { + if (!getConfusionMatrix().equals(other.getConfusionMatrix())) return false; + } + if (!getAnnotationSpecIdList().equals(other.getAnnotationSpecIdList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AU_PRC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuPrc()); + hash = (37 * hash) + AU_ROC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuRoc()); + hash = (37 * hash) + LOG_LOSS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getLogLoss()); + if (getConfidenceMetricsEntryCount() > 0) { + hash = (37 * hash) + CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceMetricsEntryList().hashCode(); + } + if (hasConfusionMatrix()) { + hash = (37 * hash) + CONFUSION_MATRIX_FIELD_NUMBER; + hash = (53 * hash) + getConfusionMatrix().hashCode(); + } + if (getAnnotationSpecIdCount() > 0) { + hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationSpecIdList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics 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.automl.v1.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics 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.automl.v1.ClassificationEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics 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.automl.v1.ClassificationEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics 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.automl.v1.ClassificationEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics 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.automl.v1.ClassificationEvaluationMetrics 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; + } + /** + * + * + *
+   * Model evaluation metrics for classification problems.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics) + com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.class, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ClassificationEvaluationMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConfidenceMetricsEntryFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + auPrc_ = 0F; + + auRoc_ = 0F; + + logLoss_ = 0F; + + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + confidenceMetricsEntryBuilder_.clear(); + } + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ClassificationProto + .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics build() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics result = + new com.google.cloud.automl.v1.ClassificationEvaluationMetrics(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.auPrc_ = auPrc_; + result.auRoc_ = auRoc_; + result.logLoss_ = logLoss_; + if (confidenceMetricsEntryBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + confidenceMetricsEntry_ = java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.confidenceMetricsEntry_ = confidenceMetricsEntry_; + } else { + result.confidenceMetricsEntry_ = confidenceMetricsEntryBuilder_.build(); + } + if (confusionMatrixBuilder_ == null) { + result.confusionMatrix_ = confusionMatrix_; + } else { + result.confusionMatrix_ = confusionMatrixBuilder_.build(); + } + if (((bitField0_ & 0x00000020) != 0)) { + annotationSpecId_ = annotationSpecId_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.annotationSpecId_ = annotationSpecId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1.ClassificationEvaluationMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ClassificationEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance()) + return this; + if (other.getAuPrc() != 0F) { + setAuPrc(other.getAuPrc()); + } + if (other.getAuRoc() != 0F) { + setAuRoc(other.getAuRoc()); + } + if (other.getLogLoss() != 0F) { + setLogLoss(other.getLogLoss()); + } + if (confidenceMetricsEntryBuilder_ == null) { + if (!other.confidenceMetricsEntry_.isEmpty()) { + if (confidenceMetricsEntry_.isEmpty()) { + confidenceMetricsEntry_ = other.confidenceMetricsEntry_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.addAll(other.confidenceMetricsEntry_); + } + onChanged(); + } + } else { + if (!other.confidenceMetricsEntry_.isEmpty()) { + if (confidenceMetricsEntryBuilder_.isEmpty()) { + confidenceMetricsEntryBuilder_.dispose(); + confidenceMetricsEntryBuilder_ = null; + confidenceMetricsEntry_ = other.confidenceMetricsEntry_; + bitField0_ = (bitField0_ & ~0x00000008); + confidenceMetricsEntryBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConfidenceMetricsEntryFieldBuilder() + : null; + } else { + confidenceMetricsEntryBuilder_.addAllMessages(other.confidenceMetricsEntry_); + } + } + } + if (other.hasConfusionMatrix()) { + mergeConfusionMatrix(other.getConfusionMatrix()); + } + if (!other.annotationSpecId_.isEmpty()) { + if (annotationSpecId_.isEmpty()) { + annotationSpecId_ = other.annotationSpecId_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.addAll(other.annotationSpecId_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private float auPrc_; + /** + * + * + *
+     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
+     * for the overall evaluation.
+     * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + /** + * + * + *
+     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
+     * for the overall evaluation.
+     * 
+ * + * float au_prc = 1; + */ + public Builder setAuPrc(float value) { + + auPrc_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
+     * for the overall evaluation.
+     * 
+ * + * float au_prc = 1; + */ + public Builder clearAuPrc() { + + auPrc_ = 0F; + onChanged(); + return this; + } + + private float auRoc_; + /** + * + * + *
+     * Output only. The Area Under Receiver Operating Characteristic curve metric.
+     * Micro-averaged for the overall evaluation.
+     * 
+ * + * float au_roc = 6; + */ + public float getAuRoc() { + return auRoc_; + } + /** + * + * + *
+     * Output only. The Area Under Receiver Operating Characteristic curve metric.
+     * Micro-averaged for the overall evaluation.
+     * 
+ * + * float au_roc = 6; + */ + public Builder setAuRoc(float value) { + + auRoc_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Area Under Receiver Operating Characteristic curve metric.
+     * Micro-averaged for the overall evaluation.
+     * 
+ * + * float au_roc = 6; + */ + public Builder clearAuRoc() { + + auRoc_ = 0F; + onChanged(); + return this; + } + + private float logLoss_; + /** + * + * + *
+     * Output only. The Log Loss metric.
+     * 
+ * + * float log_loss = 7; + */ + public float getLogLoss() { + return logLoss_; + } + /** + * + * + *
+     * Output only. The Log Loss metric.
+     * 
+ * + * float log_loss = 7; + */ + public Builder setLogLoss(float value) { + + logLoss_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Log Loss metric.
+     * 
+ * + * float log_loss = 7; + */ + public Builder clearLogLoss() { + + logLoss_ = 0F; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry> + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + + private void ensureConfidenceMetricsEntryIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + confidenceMetricsEntry_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>( + confidenceMetricsEntry_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + confidenceMetricsEntryBuilder_; + + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry> + getConfidenceMetricsEntryList() { + if (confidenceMetricsEntryBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } else { + return confidenceMetricsEntryBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public int getConfidenceMetricsEntryCount() { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.size(); + } else { + return confidenceMetricsEntryBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntry(int index) { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.get(index); + } else { + return confidenceMetricsEntryBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder setConfidenceMetricsEntry( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.set(index, value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder setConfidenceMetricsEntry( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder addConfidenceMetricsEntry( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder addConfidenceMetricsEntry( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(index, value); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder addConfidenceMetricsEntry( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder addConfidenceMetricsEntry( + int index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder addAllConfidenceMetricsEntry( + java.lang.Iterable< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntry> + values) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceMetricsEntry_); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder clearConfidenceMetricsEntry() { + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public Builder removeConfidenceMetricsEntry(int index) { + if (confidenceMetricsEntryBuilder_ == null) { + ensureConfidenceMetricsEntryIsMutable(); + confidenceMetricsEntry_.remove(index); + onChanged(); + } else { + confidenceMetricsEntryBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + getConfidenceMetricsEntryBuilder(int index) { + return getConfidenceMetricsEntryFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntryOrBuilder(int index) { + if (confidenceMetricsEntryBuilder_ == null) { + return confidenceMetricsEntry_.get(index); + } else { + return confidenceMetricsEntryBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntryOrBuilderList() { + if (confidenceMetricsEntryBuilder_ != null) { + return confidenceMetricsEntryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceMetricsEntry_); + } + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntryBuilder() { + return getConfidenceMetricsEntryFieldBuilder() + .addBuilder( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntryBuilder(int index) { + return getConfidenceMetricsEntryFieldBuilder() + .addBuilder( + index, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics for each confidence_threshold in
+     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+     * position_threshold = INT32_MAX_VALUE.
+     * ROC and precision-recall curves, and other aggregated metrics are derived
+     * from them. The confidence metrics entries may also be supplied for
+     * additional values of position_threshold, but from these no aggregated
+     * metrics are computed.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + public java.util.List< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder> + getConfidenceMetricsEntryBuilderList() { + return getConfidenceMetricsEntryFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntryFieldBuilder() { + if (confidenceMetricsEntryBuilder_ == null) { + confidenceMetricsEntryBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder>( + confidenceMetricsEntry_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + confidenceMetricsEntry_ = null; + } + return confidenceMetricsEntryBuilder_; + } + + private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + confusionMatrix_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> + confusionMatrixBuilder_; + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public boolean hasConfusionMatrix() { + return confusionMatrixBuilder_ != null || confusionMatrix_ != null; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } else { + return confusionMatrixBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public Builder setConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + confusionMatrix_ = value; + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public Builder setConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + builderForValue) { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = builderForValue.build(); + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public Builder mergeConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (confusionMatrix_ != null) { + confusionMatrix_ = + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder( + confusionMatrix_) + .mergeFrom(value) + .buildPartial(); + } else { + confusionMatrix_ = value; + } + onChanged(); + } else { + confusionMatrixBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public Builder clearConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + onChanged(); + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + getConfusionMatrixBuilder() { + + onChanged(); + return getConfusionMatrixFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder() { + if (confusionMatrixBuilder_ != null) { + return confusionMatrixBuilder_.getMessageOrBuilder(); + } else { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for MULTICLASS classification problems where number
+     * of labels is no more than 10.
+     * Only set for model level evaluation, not for evaluation per label.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> + getConfusionMatrixFieldBuilder() { + if (confusionMatrixBuilder_ == null) { + confusionMatrixBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfusionMatrixOrBuilder>( + getConfusionMatrix(), getParentForChildren(), isClean()); + confusionMatrix_ = null; + } + return confusionMatrixBuilder_; + } + + private com.google.protobuf.LazyStringList annotationSpecId_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAnnotationSpecIdIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() { + return annotationSpecId_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public int getAnnotationSpecIdCount() { + return annotationSpecId_.size(); + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public java.lang.String getAnnotationSpecId(int index) { + return annotationSpecId_.get(index); + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) { + return annotationSpecId_.getByteString(index); + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder setAnnotationSpecId(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAnnotationSpecId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAllAnnotationSpecId(java.lang.Iterable values) { + ensureAnnotationSpecIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationSpecId_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder clearAnnotationSpecId() { + annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The annotation spec ids used for this evaluation.
+     * 
+ * + * repeated string annotation_spec_id = 5; + */ + public Builder addAnnotationSpecIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAnnotationSpecIdIsMutable(); + annotationSpecId_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics) + private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationEvaluationMetrics(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetricsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000..873b96e71 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationEvaluationMetricsOrBuilder.java @@ -0,0 +1,246 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/classification.proto + +package com.google.cloud.automl.v1; + +public interface ClassificationEvaluationMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
+   * for the overall evaluation.
+   * 
+ * + * float au_prc = 1; + */ + float getAuPrc(); + + /** + * + * + *
+   * Output only. The Area Under Receiver Operating Characteristic curve metric.
+   * Micro-averaged for the overall evaluation.
+   * 
+ * + * float au_roc = 6; + */ + float getAuRoc(); + + /** + * + * + *
+   * Output only. The Log Loss metric.
+   * 
+ * + * float log_loss = 7; + */ + float getLogLoss(); + + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + java.util.List + getConfidenceMetricsEntryList(); + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntry(int index); + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + int getConfidenceMetricsEntryCount(); + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + java.util.List< + ? extends + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntryOrBuilderList(); + /** + * + * + *
+   * Output only. Metrics for each confidence_threshold in
+   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
+   * position_threshold = INT32_MAX_VALUE.
+   * ROC and precision-recall curves, and other aggregated metrics are derived
+   * from them. The confidence metrics entries may also be supplied for
+   * additional values of position_threshold, but from these no aggregated
+   * metrics are computed.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntryOrBuilder(int index); + + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + boolean hasConfusionMatrix(); + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix getConfusionMatrix(); + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for MULTICLASS classification problems where number
+   * of labels is no more than 10.
+   * Only set for model level evaluation, not for evaluation per label.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder(); + + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + java.util.List getAnnotationSpecIdList(); + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + int getAnnotationSpecIdCount(); + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + java.lang.String getAnnotationSpecId(int index); + /** + * + * + *
+   * Output only. The annotation spec ids used for this evaluation.
+   * 
+ * + * repeated string annotation_spec_id = 5; + */ + com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationProto.java new file mode 100644 index 000000000..f39b61d51 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ClassificationProto.java @@ -0,0 +1,176 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/classification.proto + +package com.google.cloud.automl.v1; + +public final class ClassificationProto { + private ClassificationProto() {} + + 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_automl_v1_ClassificationAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ClassificationAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_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/automl/v1/classification." + + "proto\022\026google.cloud.automl.v1\032\034google/ap" + + "i/annotations.proto\")\n\030ClassificationAnn" + + "otation\022\r\n\005score\030\001 \001(\002\"\201\007\n\037Classificatio" + + "nEvaluationMetrics\022\016\n\006au_prc\030\001 \001(\002\022\016\n\006au" + + "_roc\030\006 \001(\002\022\020\n\010log_loss\030\007 \001(\002\022p\n\030confiden" + + "ce_metrics_entry\030\003 \003(\0132N.google.cloud.au" + + "toml.v1.ClassificationEvaluationMetrics." + + "ConfidenceMetricsEntry\022a\n\020confusion_matr" + + "ix\030\004 \001(\0132G.google.cloud.automl.v1.Classi" + + "ficationEvaluationMetrics.ConfusionMatri" + + "x\022\032\n\022annotation_spec_id\030\005 \003(\t\032\374\002\n\026Confid" + + "enceMetricsEntry\022\034\n\024confidence_threshold" + + "\030\001 \001(\002\022\032\n\022position_threshold\030\016 \001(\005\022\016\n\006re" + + "call\030\002 \001(\002\022\021\n\tprecision\030\003 \001(\002\022\033\n\023false_p" + + "ositive_rate\030\010 \001(\002\022\020\n\010f1_score\030\004 \001(\002\022\022\n\n" + + "recall_at1\030\005 \001(\002\022\025\n\rprecision_at1\030\006 \001(\002\022" + + "\037\n\027false_positive_rate_at1\030\t \001(\002\022\024\n\014f1_s" + + "core_at1\030\007 \001(\002\022\033\n\023true_positive_count\030\n " + + "\001(\003\022\034\n\024false_positive_count\030\013 \001(\003\022\034\n\024fal" + + "se_negative_count\030\014 \001(\003\022\033\n\023true_negative" + + "_count\030\r \001(\003\032\273\001\n\017ConfusionMatrix\022\032\n\022anno" + + "tation_spec_id\030\001 \003(\t\022\024\n\014display_name\030\003 \003" + + "(\t\022X\n\003row\030\002 \003(\0132K.google.cloud.automl.v1" + + ".ClassificationEvaluationMetrics.Confusi" + + "onMatrix.Row\032\034\n\003Row\022\025\n\rexample_count\030\001 \003" + + "(\005*Y\n\022ClassificationType\022#\n\037CLASSIFICATI" + + "ON_TYPE_UNSPECIFIED\020\000\022\016\n\nMULTICLASS\020\001\022\016\n" + + "\nMULTILABEL\020\002B\277\001\n\032com.google.cloud.autom" + + "l.v1B\023ClassificationProtoP\001Z + * Type of the classification problem. + * + * + * Protobuf enum {@code google.cloud.automl.v1.ClassificationType} + */ +public enum ClassificationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * An un-set value of this enum.
+   * 
+ * + * CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + CLASSIFICATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * At most one label is allowed per example.
+   * 
+ * + * MULTICLASS = 1; + */ + MULTICLASS(1), + /** + * + * + *
+   * Multiple labels are allowed for one example.
+   * 
+ * + * MULTILABEL = 2; + */ + MULTILABEL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * An un-set value of this enum.
+   * 
+ * + * CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + public static final int CLASSIFICATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * At most one label is allowed per example.
+   * 
+ * + * MULTICLASS = 1; + */ + public static final int MULTICLASS_VALUE = 1; + /** + * + * + *
+   * Multiple labels are allowed for one example.
+   * 
+ * + * MULTILABEL = 2; + */ + public static final int MULTILABEL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ClassificationType valueOf(int value) { + return forNumber(value); + } + + public static ClassificationType forNumber(int value) { + switch (value) { + case 0: + return CLASSIFICATION_TYPE_UNSPECIFIED; + case 1: + return MULTICLASS; + case 2: + return MULTILABEL; + 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 ClassificationType findValueByNumber(int number) { + return ClassificationType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.automl.v1.ClassificationProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ClassificationType[] VALUES = values(); + + public static ClassificationType 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 ClassificationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.ClassificationType) +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadata.java new file mode 100644 index 000000000..b672c47c0 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadata.java @@ -0,0 +1,452 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Details of CreateDataset operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateDatasetOperationMetadata} + */ +public final class CreateDatasetOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.CreateDatasetOperationMetadata) + CreateDatasetOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDatasetOperationMetadata.newBuilder() to construct. + private CreateDatasetOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDatasetOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateDatasetOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.class, + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.CreateDatasetOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.CreateDatasetOperationMetadata other = + (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata 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.automl.v1.CreateDatasetOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata 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.automl.v1.CreateDatasetOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata 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.automl.v1.CreateDatasetOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata 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.automl.v1.CreateDatasetOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata 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.automl.v1.CreateDatasetOperationMetadata 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; + } + /** + * + * + *
+   * Details of CreateDataset operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.CreateDatasetOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.CreateDatasetOperationMetadata) + com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.class, + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.CreateDatasetOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata build() { + com.google.cloud.automl.v1.CreateDatasetOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata buildPartial() { + com.google.cloud.automl.v1.CreateDatasetOperationMetadata result = + new com.google.cloud.automl.v1.CreateDatasetOperationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.CreateDatasetOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.CreateDatasetOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.CreateDatasetOperationMetadata other) { + if (other == com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.CreateDatasetOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.CreateDatasetOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.CreateDatasetOperationMetadata) + private static final com.google.cloud.automl.v1.CreateDatasetOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.CreateDatasetOperationMetadata(); + } + + public static com.google.cloud.automl.v1.CreateDatasetOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDatasetOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateDatasetOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadataOrBuilder.java new file mode 100644 index 000000000..20047c5d0 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/CreateDatasetOperationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface CreateDatasetOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.CreateDatasetOperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java index b640c623e..64e3f24b9 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DataItems.java @@ -27,10 +27,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_Image_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Image_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1_TextSnippet_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_TextSnippet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_DocumentDimensions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_DocumentDimensions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_Document_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Document_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_Document_Layout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_Document_Layout_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1_ExamplePayload_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -45,19 +61,50 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\'google/cloud/automl/v1/data_items.prot" - + "o\022\026google.cloud.automl.v1\032\037google/cloud/" - + "automl/v1/io.proto\032\031google/protobuf/any." - + "proto\032\036google/protobuf/duration.proto\032\034g" - + "oogle/protobuf/struct.proto\032\034google/api/" - + "annotations.proto\"F\n\013TextSnippet\022\017\n\007cont" - + "ent\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\022\023\n\013content_" - + "uri\030\004 \001(\t\"X\n\016ExamplePayload\022;\n\014text_snip" + + "o\022\026google.cloud.automl.v1\032\034google/api/an" + + "notations.proto\032%google/cloud/automl/v1/" + + "geometry.proto\032\037google/cloud/automl/v1/i" + + "o.proto\032)google/cloud/automl/v1/text_seg" + + "ment.proto\032\031google/protobuf/any.proto\032\036g" + + "oogle/protobuf/duration.proto\032\034google/pr" + + "otobuf/struct.proto\"=\n\005Image\022\025\n\013image_by" + + "tes\030\001 \001(\014H\000\022\025\n\rthumbnail_uri\030\004 \001(\tB\006\n\004da" + + "ta\"F\n\013TextSnippet\022\017\n\007content\030\001 \001(\t\022\021\n\tmi" + + "me_type\030\002 \001(\t\022\023\n\013content_uri\030\004 \001(\t\"\352\001\n\022D" + + "ocumentDimensions\022N\n\004unit\030\001 \001(\0162@.google" + + ".cloud.automl.v1.DocumentDimensions.Docu" + + "mentDimensionUnit\022\r\n\005width\030\002 \001(\002\022\016\n\006heig" + + "ht\030\003 \001(\002\"e\n\025DocumentDimensionUnit\022\'\n#DOC" + + "UMENT_DIMENSION_UNIT_UNSPECIFIED\020\000\022\010\n\004IN" + + "CH\020\001\022\016\n\nCENTIMETER\020\002\022\t\n\005POINT\020\003\"\326\005\n\010Docu" + + "ment\022A\n\014input_config\030\001 \001(\0132+.google.clou" + + "d.automl.v1.DocumentInputConfig\022:\n\rdocum" + + "ent_text\030\002 \001(\0132#.google.cloud.automl.v1." + + "TextSnippet\0227\n\006layout\030\003 \003(\0132\'.google.clo" + + "ud.automl.v1.Document.Layout\022G\n\023document" + + "_dimensions\030\004 \001(\0132*.google.cloud.automl." + + "v1.DocumentDimensions\022\022\n\npage_count\030\005 \001(" + + "\005\032\264\003\n\006Layout\0229\n\014text_segment\030\001 \001(\0132#.goo" + + "gle.cloud.automl.v1.TextSegment\022\023\n\013page_" + + "number\030\002 \001(\005\022;\n\rbounding_poly\030\003 \001(\0132$.go" + + "ogle.cloud.automl.v1.BoundingPoly\022R\n\021tex" + + "t_segment_type\030\004 \001(\01627.google.cloud.auto" + + "ml.v1.Document.Layout.TextSegmentType\"\310\001" + + "\n\017TextSegmentType\022!\n\035TEXT_SEGMENT_TYPE_U" + + "NSPECIFIED\020\000\022\t\n\005TOKEN\020\001\022\r\n\tPARAGRAPH\020\002\022\016" + + "\n\nFORM_FIELD\020\003\022\023\n\017FORM_FIELD_NAME\020\004\022\027\n\023F" + + "ORM_FIELD_CONTENTS\020\005\022\t\n\005TABLE\020\006\022\020\n\014TABLE" + + "_HEADER\020\007\022\r\n\tTABLE_ROW\020\010\022\016\n\nTABLE_CELL\020\t" + + "\"\276\001\n\016ExamplePayload\022.\n\005image\030\001 \001(\0132\035.goo" + + "gle.cloud.automl.v1.ImageH\000\022;\n\014text_snip" + "pet\030\002 \001(\0132#.google.cloud.automl.v1.TextS" - + "nippetH\000B\t\n\007payloadB\252\001\n\032com.google.cloud" - + ".automl.v1P\001Z labels__ = input.readMessage( @@ -201,6 +310,11 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { public enum DatasetMetadataCase implements com.google.protobuf.Internal.EnumLite { TRANSLATION_DATASET_METADATA(23), + IMAGE_CLASSIFICATION_DATASET_METADATA(24), + TEXT_CLASSIFICATION_DATASET_METADATA(25), + IMAGE_OBJECT_DETECTION_DATASET_METADATA(26), + TEXT_EXTRACTION_DATASET_METADATA(28), + TEXT_SENTIMENT_DATASET_METADATA(30), DATASETMETADATA_NOT_SET(0); private final int value; @@ -217,6 +331,16 @@ public static DatasetMetadataCase forNumber(int value) { switch (value) { case 23: return TRANSLATION_DATASET_METADATA; + case 24: + return IMAGE_CLASSIFICATION_DATASET_METADATA; + case 25: + return TEXT_CLASSIFICATION_DATASET_METADATA; + case 26: + return IMAGE_OBJECT_DETECTION_DATASET_METADATA; + case 28: + return TEXT_EXTRACTION_DATASET_METADATA; + case 30: + return TEXT_SENTIMENT_DATASET_METADATA; case 0: return DATASETMETADATA_NOT_SET; default: @@ -281,6 +405,265 @@ public com.google.cloud.automl.v1.TranslationDatasetMetadata getTranslationDatas return com.google.cloud.automl.v1.TranslationDatasetMetadata.getDefaultInstance(); } + public static final int IMAGE_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER = 24; + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public boolean hasImageClassificationDatasetMetadata() { + return datasetMetadataCase_ == 24; + } + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + getImageClassificationDatasetMetadata() { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder + getImageClassificationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + + public static final int TEXT_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER = 25; + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public boolean hasTextClassificationDatasetMetadata() { + return datasetMetadataCase_ == 25; + } + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata + getTextClassificationDatasetMetadata() { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder + getTextClassificationDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + + public static final int IMAGE_OBJECT_DETECTION_DATASET_METADATA_FIELD_NUMBER = 26; + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public boolean hasImageObjectDetectionDatasetMetadata() { + return datasetMetadataCase_ == 26; + } + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getImageObjectDetectionDatasetMetadata() { + if (datasetMetadataCase_ == 26) { + return (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder + getImageObjectDetectionDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 26) { + return (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + + public static final int TEXT_EXTRACTION_DATASET_METADATA_FIELD_NUMBER = 28; + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public boolean hasTextExtractionDatasetMetadata() { + return datasetMetadataCase_ == 28; + } + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata + getTextExtractionDatasetMetadata() { + if (datasetMetadataCase_ == 28) { + return (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder + getTextExtractionDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 28) { + return (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + + public static final int TEXT_SENTIMENT_DATASET_METADATA_FIELD_NUMBER = 30; + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public boolean hasTextSentimentDatasetMetadata() { + return datasetMetadataCase_ == 30; + } + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata getTextSentimentDatasetMetadata() { + if (datasetMetadataCase_ == 30) { + return (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder + getTextSentimentDatasetMetadataOrBuilder() { + if (datasetMetadataCase_ == 30) { + return (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -668,6 +1051,26 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage( 23, (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_); } + if (datasetMetadataCase_ == 24) { + output.writeMessage( + 24, (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 25) { + output.writeMessage( + 25, (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 26) { + output.writeMessage( + 26, (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 28) { + output.writeMessage( + 28, (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 30) { + output.writeMessage( + 30, (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_); + } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 39); unknownFields.writeTo(output); @@ -702,6 +1105,32 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 23, (com.google.cloud.automl.v1.TranslationDatasetMetadata) datasetMetadata_); } + if (datasetMetadataCase_ == 24) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 25) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 25, (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 26) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 26, + (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 28) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 28, (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_); + } + if (datasetMetadataCase_ == 30) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 30, (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_); + } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { com.google.protobuf.MapEntry labels__ = @@ -743,6 +1172,26 @@ public boolean equals(final java.lang.Object obj) { if (!getTranslationDatasetMetadata().equals(other.getTranslationDatasetMetadata())) return false; break; + case 24: + if (!getImageClassificationDatasetMetadata() + .equals(other.getImageClassificationDatasetMetadata())) return false; + break; + case 25: + if (!getTextClassificationDatasetMetadata() + .equals(other.getTextClassificationDatasetMetadata())) return false; + break; + case 26: + if (!getImageObjectDetectionDatasetMetadata() + .equals(other.getImageObjectDetectionDatasetMetadata())) return false; + break; + case 28: + if (!getTextExtractionDatasetMetadata().equals(other.getTextExtractionDatasetMetadata())) + return false; + break; + case 30: + if (!getTextSentimentDatasetMetadata().equals(other.getTextSentimentDatasetMetadata())) + return false; + break; case 0: default: } @@ -780,6 +1229,26 @@ public int hashCode() { hash = (37 * hash) + TRANSLATION_DATASET_METADATA_FIELD_NUMBER; hash = (53 * hash) + getTranslationDatasetMetadata().hashCode(); break; + case 24: + hash = (37 * hash) + IMAGE_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageClassificationDatasetMetadata().hashCode(); + break; + case 25: + hash = (37 * hash) + TEXT_CLASSIFICATION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextClassificationDatasetMetadata().hashCode(); + break; + case 26: + hash = (37 * hash) + IMAGE_OBJECT_DETECTION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageObjectDetectionDatasetMetadata().hashCode(); + break; + case 28: + hash = (37 * hash) + TEXT_EXTRACTION_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextExtractionDatasetMetadata().hashCode(); + break; + case 30: + hash = (37 * hash) + TEXT_SENTIMENT_DATASET_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextSentimentDatasetMetadata().hashCode(); + break; case 0: default: } @@ -1002,10 +1471,45 @@ public com.google.cloud.automl.v1.Dataset buildPartial() { result.datasetMetadata_ = translationDatasetMetadataBuilder_.build(); } } - result.name_ = name_; - result.displayName_ = displayName_; - result.description_ = description_; - result.exampleCount_ = exampleCount_; + if (datasetMetadataCase_ == 24) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = imageClassificationDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 25) { + if (textClassificationDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = textClassificationDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 26) { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = imageObjectDetectionDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 28) { + if (textExtractionDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = textExtractionDatasetMetadataBuilder_.build(); + } + } + if (datasetMetadataCase_ == 30) { + if (textSentimentDatasetMetadataBuilder_ == null) { + result.datasetMetadata_ = datasetMetadata_; + } else { + result.datasetMetadata_ = textSentimentDatasetMetadataBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + result.exampleCount_ = exampleCount_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -1094,6 +1598,32 @@ public Builder mergeFrom(com.google.cloud.automl.v1.Dataset other) { mergeTranslationDatasetMetadata(other.getTranslationDatasetMetadata()); break; } + case IMAGE_CLASSIFICATION_DATASET_METADATA: + { + mergeImageClassificationDatasetMetadata(other.getImageClassificationDatasetMetadata()); + break; + } + case TEXT_CLASSIFICATION_DATASET_METADATA: + { + mergeTextClassificationDatasetMetadata(other.getTextClassificationDatasetMetadata()); + break; + } + case IMAGE_OBJECT_DETECTION_DATASET_METADATA: + { + mergeImageObjectDetectionDatasetMetadata( + other.getImageObjectDetectionDatasetMetadata()); + break; + } + case TEXT_EXTRACTION_DATASET_METADATA: + { + mergeTextExtractionDatasetMetadata(other.getTextExtractionDatasetMetadata()); + break; + } + case TEXT_SENTIMENT_DATASET_METADATA: + { + mergeTextSentimentDatasetMetadata(other.getTextSentimentDatasetMetadata()); + break; + } case DATASETMETADATA_NOT_SET: { break; @@ -1361,6 +1891,1147 @@ public Builder clearTranslationDatasetMetadata() { return translationDatasetMetadataBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder> + imageClassificationDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public boolean hasImageClassificationDatasetMetadata() { + return datasetMetadataCase_ == 24; + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + getImageClassificationDatasetMetadata() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 24) { + return imageClassificationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public Builder setImageClassificationDatasetMetadata( + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata value) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + imageClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 24; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public Builder setImageClassificationDatasetMetadata( + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder builderForValue) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageClassificationDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 24; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public Builder mergeImageClassificationDatasetMetadata( + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata value) { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24 + && datasetMetadata_ + != com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + .getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) + datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 24) { + imageClassificationDatasetMetadataBuilder_.mergeFrom(value); + } + imageClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 24; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public Builder clearImageClassificationDatasetMetadata() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 24) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 24) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + imageClassificationDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder + getImageClassificationDatasetMetadataBuilder() { + return getImageClassificationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder + getImageClassificationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 24) && (imageClassificationDatasetMetadataBuilder_ != null)) { + return imageClassificationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 24) { + return (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for image classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder> + getImageClassificationDatasetMetadataFieldBuilder() { + if (imageClassificationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 24)) { + datasetMetadata_ = + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + imageClassificationDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 24; + onChanged(); + ; + return imageClassificationDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationDatasetMetadata, + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder> + textClassificationDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public boolean hasTextClassificationDatasetMetadata() { + return datasetMetadataCase_ == 25; + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata + getTextClassificationDatasetMetadata() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 25) { + return textClassificationDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public Builder setTextClassificationDatasetMetadata( + com.google.cloud.automl.v1.TextClassificationDatasetMetadata value) { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + textClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 25; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public Builder setTextClassificationDatasetMetadata( + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder builderForValue) { + if (textClassificationDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + textClassificationDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 25; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public Builder mergeTextClassificationDatasetMetadata( + com.google.cloud.automl.v1.TextClassificationDatasetMetadata value) { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25 + && datasetMetadata_ + != com.google.cloud.automl.v1.TextClassificationDatasetMetadata + .getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) + datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 25) { + textClassificationDatasetMetadataBuilder_.mergeFrom(value); + } + textClassificationDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 25; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public Builder clearTextClassificationDatasetMetadata() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 25) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 25) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + textClassificationDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder + getTextClassificationDatasetMetadataBuilder() { + return getTextClassificationDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + public com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder + getTextClassificationDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 25) && (textClassificationDatasetMetadataBuilder_ != null)) { + return textClassificationDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 25) { + return (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationDatasetMetadata, + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder> + getTextClassificationDatasetMetadataFieldBuilder() { + if (textClassificationDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 25)) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + textClassificationDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationDatasetMetadata, + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 25; + onChanged(); + ; + return textClassificationDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder> + imageObjectDetectionDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public boolean hasImageObjectDetectionDatasetMetadata() { + return datasetMetadataCase_ == 26; + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getImageObjectDetectionDatasetMetadata() { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 26) { + return (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 26) { + return imageObjectDetectionDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public Builder setImageObjectDetectionDatasetMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata value) { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + imageObjectDetectionDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 26; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public Builder setImageObjectDetectionDatasetMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder builderForValue) { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageObjectDetectionDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 26; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public Builder mergeImageObjectDetectionDatasetMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata value) { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 26 + && datasetMetadata_ + != com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + .getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 26) { + imageObjectDetectionDatasetMetadataBuilder_.mergeFrom(value); + } + imageObjectDetectionDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 26; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public Builder clearImageObjectDetectionDatasetMetadata() { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 26) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 26) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + imageObjectDetectionDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder + getImageObjectDetectionDatasetMetadataBuilder() { + return getImageObjectDetectionDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder + getImageObjectDetectionDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 26) && (imageObjectDetectionDatasetMetadataBuilder_ != null)) { + return imageObjectDetectionDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 26) { + return (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder> + getImageObjectDetectionDatasetMetadataFieldBuilder() { + if (imageObjectDetectionDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 26)) { + datasetMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + imageObjectDetectionDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 26; + onChanged(); + ; + return imageObjectDetectionDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionDatasetMetadata, + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder> + textExtractionDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public boolean hasTextExtractionDatasetMetadata() { + return datasetMetadataCase_ == 28; + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata + getTextExtractionDatasetMetadata() { + if (textExtractionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 28) { + return (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 28) { + return textExtractionDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public Builder setTextExtractionDatasetMetadata( + com.google.cloud.automl.v1.TextExtractionDatasetMetadata value) { + if (textExtractionDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + textExtractionDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 28; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public Builder setTextExtractionDatasetMetadata( + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder builderForValue) { + if (textExtractionDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + textExtractionDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 28; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public Builder mergeTextExtractionDatasetMetadata( + com.google.cloud.automl.v1.TextExtractionDatasetMetadata value) { + if (textExtractionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 28 + && datasetMetadata_ + != com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 28) { + textExtractionDatasetMetadataBuilder_.mergeFrom(value); + } + textExtractionDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 28; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public Builder clearTextExtractionDatasetMetadata() { + if (textExtractionDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 28) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 28) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + textExtractionDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder + getTextExtractionDatasetMetadataBuilder() { + return getTextExtractionDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + public com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder + getTextExtractionDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 28) && (textExtractionDatasetMetadataBuilder_ != null)) { + return textExtractionDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 28) { + return (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text extraction.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionDatasetMetadata, + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder> + getTextExtractionDatasetMetadataFieldBuilder() { + if (textExtractionDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 28)) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + textExtractionDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionDatasetMetadata, + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 28; + onChanged(); + ; + return textExtractionDatasetMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentDatasetMetadata, + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder> + textSentimentDatasetMetadataBuilder_; + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public boolean hasTextSentimentDatasetMetadata() { + return datasetMetadataCase_ == 30; + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata + getTextSentimentDatasetMetadata() { + if (textSentimentDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 30) { + return (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } else { + if (datasetMetadataCase_ == 30) { + return textSentimentDatasetMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public Builder setTextSentimentDatasetMetadata( + com.google.cloud.automl.v1.TextSentimentDatasetMetadata value) { + if (textSentimentDatasetMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datasetMetadata_ = value; + onChanged(); + } else { + textSentimentDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 30; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public Builder setTextSentimentDatasetMetadata( + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder builderForValue) { + if (textSentimentDatasetMetadataBuilder_ == null) { + datasetMetadata_ = builderForValue.build(); + onChanged(); + } else { + textSentimentDatasetMetadataBuilder_.setMessage(builderForValue.build()); + } + datasetMetadataCase_ = 30; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public Builder mergeTextSentimentDatasetMetadata( + com.google.cloud.automl.v1.TextSentimentDatasetMetadata value) { + if (textSentimentDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 30 + && datasetMetadata_ + != com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance()) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.newBuilder( + (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + datasetMetadata_ = value; + } + onChanged(); + } else { + if (datasetMetadataCase_ == 30) { + textSentimentDatasetMetadataBuilder_.mergeFrom(value); + } + textSentimentDatasetMetadataBuilder_.setMessage(value); + } + datasetMetadataCase_ = 30; + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public Builder clearTextSentimentDatasetMetadata() { + if (textSentimentDatasetMetadataBuilder_ == null) { + if (datasetMetadataCase_ == 30) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + onChanged(); + } + } else { + if (datasetMetadataCase_ == 30) { + datasetMetadataCase_ = 0; + datasetMetadata_ = null; + } + textSentimentDatasetMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder + getTextSentimentDatasetMetadataBuilder() { + return getTextSentimentDatasetMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + public com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder + getTextSentimentDatasetMetadataOrBuilder() { + if ((datasetMetadataCase_ == 30) && (textSentimentDatasetMetadataBuilder_ != null)) { + return textSentimentDatasetMetadataBuilder_.getMessageOrBuilder(); + } else { + if (datasetMetadataCase_ == 30) { + return (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for a dataset used for text sentiment.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentDatasetMetadata, + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder> + getTextSentimentDatasetMetadataFieldBuilder() { + if (textSentimentDatasetMetadataBuilder_ == null) { + if (!(datasetMetadataCase_ == 30)) { + datasetMetadata_ = + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + textSentimentDatasetMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentDatasetMetadata, + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) datasetMetadata_, + getParentForChildren(), + isClean()); + datasetMetadata_ = null; + } + datasetMetadataCase_ = 30; + onChanged(); + ; + return textSentimentDatasetMetadataBuilder_; + } + private java.lang.Object name_ = ""; /** * diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java index ffc9cb73c..5bfd9f28f 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOrBuilder.java @@ -58,6 +58,199 @@ public interface DatasetOrBuilder com.google.cloud.automl.v1.TranslationDatasetMetadataOrBuilder getTranslationDatasetMetadataOrBuilder(); + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + boolean hasImageClassificationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + getImageClassificationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for image classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * + */ + com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder + getImageClassificationDatasetMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + boolean hasTextClassificationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + com.google.cloud.automl.v1.TextClassificationDatasetMetadata + getTextClassificationDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * + */ + com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder + getTextClassificationDatasetMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + boolean hasImageObjectDetectionDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getImageObjectDetectionDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder + getImageObjectDetectionDatasetMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + boolean hasTextExtractionDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + com.google.cloud.automl.v1.TextExtractionDatasetMetadata getTextExtractionDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text extraction.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * + */ + com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder + getTextExtractionDatasetMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + boolean hasTextSentimentDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + com.google.cloud.automl.v1.TextSentimentDatasetMetadata getTextSentimentDatasetMetadata(); + /** + * + * + *
+   * Metadata for a dataset used for text sentiment.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * + */ + com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder + getTextSentimentDatasetMetadataOrBuilder(); + /** * * diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java index 586d8a4b0..ba13293df 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DatasetOuterClass.java @@ -45,24 +45,39 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n$google/cloud/automl/v1/dataset.proto\022\026" - + "google.cloud.automl.v1\032(google/cloud/aut" - + "oml/v1/translation.proto\032\037google/protobu" - + "f/timestamp.proto\032\034google/api/annotation" - + "s.proto\"\364\002\n\007Dataset\022Z\n\034translation_datas" - + "et_metadata\030\027 \001(\01322.google.cloud.automl." - + "v1.TranslationDatasetMetadataH\000\022\014\n\004name\030" - + "\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\023\n\013descripti" - + "on\030\003 \001(\t\022\025\n\rexample_count\030\025 \001(\005\022/\n\013creat" - + "e_time\030\016 \001(\0132\032.google.protobuf.Timestamp" - + "\022\014\n\004etag\030\021 \001(\t\022;\n\006labels\030\' \003(\0132+.google." - + "cloud.automl.v1.Dataset.LabelsEntry\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001B\022\n\020dataset_metadataB\252\001\n\032com.google.cl" - + "oud.automl.v1P\001Z + * Details of DeployModel operation. + * + * + * Protobuf type {@code google.cloud.automl.v1.DeployModelOperationMetadata} + */ +public final class DeployModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DeployModelOperationMetadata) + DeployModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployModelOperationMetadata.newBuilder() to construct. + private DeployModelOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployModelOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployModelOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeployModelOperationMetadata.class, + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.DeployModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DeployModelOperationMetadata other = + (com.google.cloud.automl.v1.DeployModelOperationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata 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.automl.v1.DeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata 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.automl.v1.DeployModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata 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.automl.v1.DeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata 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.automl.v1.DeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata 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.automl.v1.DeployModelOperationMetadata 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; + } + /** + * + * + *
+   * Details of DeployModel operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeployModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DeployModelOperationMetadata) + com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeployModelOperationMetadata.class, + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DeployModelOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelOperationMetadata build() { + com.google.cloud.automl.v1.DeployModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelOperationMetadata buildPartial() { + com.google.cloud.automl.v1.DeployModelOperationMetadata result = + new com.google.cloud.automl.v1.DeployModelOperationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.DeployModelOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.DeployModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DeployModelOperationMetadata other) { + if (other == com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.DeployModelOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.DeployModelOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.DeployModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeployModelOperationMetadata) + private static final com.google.cloud.automl.v1.DeployModelOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DeployModelOperationMetadata(); + } + + public static com.google.cloud.automl.v1.DeployModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployModelOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000..0e89bf77f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelOperationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface DeployModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DeployModelOperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequest.java new file mode 100644 index 000000000..43307203a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequest.java @@ -0,0 +1,1392 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Request message for
+ * [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeployModelRequest} + */ +public final class DeployModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DeployModelRequest) + DeployModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployModelRequest.newBuilder() to construct. + private DeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeployModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder + subBuilder = null; + if (modelDeploymentMetadataCase_ == 2) { + subBuilder = + ((com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_) + .toBuilder(); + } + modelDeploymentMetadata_ = + input.readMessage( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_); + modelDeploymentMetadata_ = subBuilder.buildPartial(); + } + modelDeploymentMetadataCase_ = 2; + break; + } + case 34: + { + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder + subBuilder = null; + if (modelDeploymentMetadataCase_ == 4) { + subBuilder = + ((com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_) + .toBuilder(); + } + modelDeploymentMetadata_ = + input.readMessage( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_); + modelDeploymentMetadata_ = subBuilder.buildPartial(); + } + modelDeploymentMetadataCase_ = 4; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeployModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeployModelRequest.class, + com.google.cloud.automl.v1.DeployModelRequest.Builder.class); + } + + private int modelDeploymentMetadataCase_ = 0; + private java.lang.Object modelDeploymentMetadata_; + + public enum ModelDeploymentMetadataCase implements com.google.protobuf.Internal.EnumLite { + IMAGE_OBJECT_DETECTION_MODEL_DEPLOYMENT_METADATA(2), + IMAGE_CLASSIFICATION_MODEL_DEPLOYMENT_METADATA(4), + MODELDEPLOYMENTMETADATA_NOT_SET(0); + private final int value; + + private ModelDeploymentMetadataCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ModelDeploymentMetadataCase valueOf(int value) { + return forNumber(value); + } + + public static ModelDeploymentMetadataCase forNumber(int value) { + switch (value) { + case 2: + return IMAGE_OBJECT_DETECTION_MODEL_DEPLOYMENT_METADATA; + case 4: + return IMAGE_CLASSIFICATION_MODEL_DEPLOYMENT_METADATA; + case 0: + return MODELDEPLOYMENTMETADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelDeploymentMetadataCase getModelDeploymentMetadataCase() { + return ModelDeploymentMetadataCase.forNumber(modelDeploymentMetadataCase_); + } + + public static final int IMAGE_OBJECT_DETECTION_MODEL_DEPLOYMENT_METADATA_FIELD_NUMBER = 2; + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public boolean hasImageObjectDetectionModelDeploymentMetadata() { + return modelDeploymentMetadataCase_ == 2; + } + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getImageObjectDetectionModelDeploymentMetadata() { + if (modelDeploymentMetadataCase_ == 2) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder + getImageObjectDetectionModelDeploymentMetadataOrBuilder() { + if (modelDeploymentMetadataCase_ == 2) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + + public static final int IMAGE_CLASSIFICATION_MODEL_DEPLOYMENT_METADATA_FIELD_NUMBER = 4; + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public boolean hasImageClassificationModelDeploymentMetadata() { + return modelDeploymentMetadataCase_ == 4; + } + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getImageClassificationModelDeploymentMetadata() { + if (modelDeploymentMetadataCase_ == 4) { + return (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder + getImageClassificationModelDeploymentMetadataOrBuilder() { + if (modelDeploymentMetadataCase_ == 4) { + return (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (modelDeploymentMetadataCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_); + } + if (modelDeploymentMetadataCase_ == 4) { + output.writeMessage( + 4, + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (modelDeploymentMetadataCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_); + } + if (modelDeploymentMetadataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.DeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DeployModelRequest other = + (com.google.cloud.automl.v1.DeployModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getModelDeploymentMetadataCase().equals(other.getModelDeploymentMetadataCase())) + return false; + switch (modelDeploymentMetadataCase_) { + case 2: + if (!getImageObjectDetectionModelDeploymentMetadata() + .equals(other.getImageObjectDetectionModelDeploymentMetadata())) return false; + break; + case 4: + if (!getImageClassificationModelDeploymentMetadata() + .equals(other.getImageClassificationModelDeploymentMetadata())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (modelDeploymentMetadataCase_) { + case 2: + hash = (37 * hash) + IMAGE_OBJECT_DETECTION_MODEL_DEPLOYMENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageObjectDetectionModelDeploymentMetadata().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_CLASSIFICATION_MODEL_DEPLOYMENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageClassificationModelDeploymentMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.DeployModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelRequest 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.automl.v1.DeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelRequest 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.automl.v1.DeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DeployModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.DeployModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelRequest 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.automl.v1.DeployModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelRequest 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.automl.v1.DeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DeployModelRequest 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.automl.v1.DeployModelRequest 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
+   * [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DeployModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DeployModelRequest) + com.google.cloud.automl.v1.DeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeployModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DeployModelRequest.class, + com.google.cloud.automl.v1.DeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DeployModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_DeployModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DeployModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelRequest build() { + com.google.cloud.automl.v1.DeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelRequest buildPartial() { + com.google.cloud.automl.v1.DeployModelRequest result = + new com.google.cloud.automl.v1.DeployModelRequest(this); + if (modelDeploymentMetadataCase_ == 2) { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + result.modelDeploymentMetadata_ = modelDeploymentMetadata_; + } else { + result.modelDeploymentMetadata_ = + imageObjectDetectionModelDeploymentMetadataBuilder_.build(); + } + } + if (modelDeploymentMetadataCase_ == 4) { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + result.modelDeploymentMetadata_ = modelDeploymentMetadata_; + } else { + result.modelDeploymentMetadata_ = + imageClassificationModelDeploymentMetadataBuilder_.build(); + } + } + result.name_ = name_; + result.modelDeploymentMetadataCase_ = modelDeploymentMetadataCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.DeployModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.DeployModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DeployModelRequest other) { + if (other == com.google.cloud.automl.v1.DeployModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + switch (other.getModelDeploymentMetadataCase()) { + case IMAGE_OBJECT_DETECTION_MODEL_DEPLOYMENT_METADATA: + { + mergeImageObjectDetectionModelDeploymentMetadata( + other.getImageObjectDetectionModelDeploymentMetadata()); + break; + } + case IMAGE_CLASSIFICATION_MODEL_DEPLOYMENT_METADATA: + { + mergeImageClassificationModelDeploymentMetadata( + other.getImageClassificationModelDeploymentMetadata()); + break; + } + case MODELDEPLOYMENTMETADATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.DeployModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.DeployModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelDeploymentMetadataCase_ = 0; + private java.lang.Object modelDeploymentMetadata_; + + public ModelDeploymentMetadataCase getModelDeploymentMetadataCase() { + return ModelDeploymentMetadataCase.forNumber(modelDeploymentMetadataCase_); + } + + public Builder clearModelDeploymentMetadata() { + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder> + imageObjectDetectionModelDeploymentMetadataBuilder_; + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public boolean hasImageObjectDetectionModelDeploymentMetadata() { + return modelDeploymentMetadataCase_ == 2; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getImageObjectDetectionModelDeploymentMetadata() { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 2) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } else { + if (modelDeploymentMetadataCase_ == 2) { + return imageObjectDetectionModelDeploymentMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public Builder setImageObjectDetectionModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata value) { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelDeploymentMetadata_ = value; + onChanged(); + } else { + imageObjectDetectionModelDeploymentMetadataBuilder_.setMessage(value); + } + modelDeploymentMetadataCase_ = 2; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public Builder setImageObjectDetectionModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder + builderForValue) { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + modelDeploymentMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageObjectDetectionModelDeploymentMetadataBuilder_.setMessage(builderForValue.build()); + } + modelDeploymentMetadataCase_ = 2; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public Builder mergeImageObjectDetectionModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata value) { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 2 + && modelDeploymentMetadata_ + != com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance()) { + modelDeploymentMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelDeploymentMetadata_ = value; + } + onChanged(); + } else { + if (modelDeploymentMetadataCase_ == 2) { + imageObjectDetectionModelDeploymentMetadataBuilder_.mergeFrom(value); + } + imageObjectDetectionModelDeploymentMetadataBuilder_.setMessage(value); + } + modelDeploymentMetadataCase_ = 2; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public Builder clearImageObjectDetectionModelDeploymentMetadata() { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 2) { + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + onChanged(); + } + } else { + if (modelDeploymentMetadataCase_ == 2) { + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + } + imageObjectDetectionModelDeploymentMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder + getImageObjectDetectionModelDeploymentMetadataBuilder() { + return getImageObjectDetectionModelDeploymentMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder + getImageObjectDetectionModelDeploymentMetadataOrBuilder() { + if ((modelDeploymentMetadataCase_ == 2) + && (imageObjectDetectionModelDeploymentMetadataBuilder_ != null)) { + return imageObjectDetectionModelDeploymentMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelDeploymentMetadataCase_ == 2) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model deployment metadata specific to Image Object Detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder> + getImageObjectDetectionModelDeploymentMetadataFieldBuilder() { + if (imageObjectDetectionModelDeploymentMetadataBuilder_ == null) { + if (!(modelDeploymentMetadataCase_ == 2)) { + modelDeploymentMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + imageObjectDetectionModelDeploymentMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + modelDeploymentMetadata_, + getParentForChildren(), + isClean()); + modelDeploymentMetadata_ = null; + } + modelDeploymentMetadataCase_ = 2; + onChanged(); + ; + return imageObjectDetectionModelDeploymentMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder> + imageClassificationModelDeploymentMetadataBuilder_; + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public boolean hasImageClassificationModelDeploymentMetadata() { + return modelDeploymentMetadataCase_ == 4; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getImageClassificationModelDeploymentMetadata() { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 4) { + return (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } else { + if (modelDeploymentMetadataCase_ == 4) { + return imageClassificationModelDeploymentMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public Builder setImageClassificationModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata value) { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelDeploymentMetadata_ = value; + onChanged(); + } else { + imageClassificationModelDeploymentMetadataBuilder_.setMessage(value); + } + modelDeploymentMetadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public Builder setImageClassificationModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder + builderForValue) { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + modelDeploymentMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageClassificationModelDeploymentMetadataBuilder_.setMessage(builderForValue.build()); + } + modelDeploymentMetadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public Builder mergeImageClassificationModelDeploymentMetadata( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata value) { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 4 + && modelDeploymentMetadata_ + != com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance()) { + modelDeploymentMetadata_ = + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelDeploymentMetadata_ = value; + } + onChanged(); + } else { + if (modelDeploymentMetadataCase_ == 4) { + imageClassificationModelDeploymentMetadataBuilder_.mergeFrom(value); + } + imageClassificationModelDeploymentMetadataBuilder_.setMessage(value); + } + modelDeploymentMetadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public Builder clearImageClassificationModelDeploymentMetadata() { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + if (modelDeploymentMetadataCase_ == 4) { + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + onChanged(); + } + } else { + if (modelDeploymentMetadataCase_ == 4) { + modelDeploymentMetadataCase_ = 0; + modelDeploymentMetadata_ = null; + } + imageClassificationModelDeploymentMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder + getImageClassificationModelDeploymentMetadataBuilder() { + return getImageClassificationModelDeploymentMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder + getImageClassificationModelDeploymentMetadataOrBuilder() { + if ((modelDeploymentMetadataCase_ == 4) + && (imageClassificationModelDeploymentMetadataBuilder_ != null)) { + return imageClassificationModelDeploymentMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelDeploymentMetadataCase_ == 4) { + return (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model deployment metadata specific to Image Classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder> + getImageClassificationModelDeploymentMetadataFieldBuilder() { + if (imageClassificationModelDeploymentMetadataBuilder_ == null) { + if (!(modelDeploymentMetadataCase_ == 4)) { + modelDeploymentMetadata_ = + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + imageClassificationModelDeploymentMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + modelDeploymentMetadata_, + getParentForChildren(), + isClean()); + modelDeploymentMetadata_ = null; + } + modelDeploymentMetadataCase_ = 4; + onChanged(); + ; + return imageClassificationModelDeploymentMetadataBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to deploy.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.DeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeployModelRequest) + private static final com.google.cloud.automl.v1.DeployModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DeployModelRequest(); + } + + public static com.google.cloud.automl.v1.DeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeployModelRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequestOrBuilder.java new file mode 100644 index 000000000..38917f397 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DeployModelRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +public interface DeployModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + boolean hasImageObjectDetectionModelDeploymentMetadata(); + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getImageObjectDetectionModelDeploymentMetadata(); + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder + getImageObjectDetectionModelDeploymentMetadataOrBuilder(); + + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + boolean hasImageClassificationModelDeploymentMetadata(); + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getImageClassificationModelDeploymentMetadata(); + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * + */ + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder + getImageClassificationModelDeploymentMetadataOrBuilder(); + + /** + * + * + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the model to deploy.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + public com.google.cloud.automl.v1.DeployModelRequest.ModelDeploymentMetadataCase + getModelDeploymentMetadataCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Detection.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Detection.java new file mode 100644 index 000000000..60fff4066 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Detection.java @@ -0,0 +1,139 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +public final class Detection { + private Detection() {} + + 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_automl_v1_ImageObjectDetectionAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_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/automl/v1/detection.proto" + + "\022\026google.cloud.automl.v1\032\034google/api/ann" + + "otations.proto\032%google/cloud/automl/v1/g" + + "eometry.proto\032\036google/protobuf/duration." + + "proto\"k\n\036ImageObjectDetectionAnnotation\022" + + ":\n\014bounding_box\030\001 \001(\0132$.google.cloud.aut" + + "oml.v1.BoundingPoly\022\r\n\005score\030\002 \001(\002\"\251\002\n\027B" + + "oundingBoxMetricsEntry\022\025\n\riou_threshold\030" + + "\001 \001(\002\022\036\n\026mean_average_precision\030\002 \001(\002\022j\n" + + "\032confidence_metrics_entries\030\003 \003(\0132F.goog" + + "le.cloud.automl.v1.BoundingBoxMetricsEnt" + + "ry.ConfidenceMetricsEntry\032k\n\026ConfidenceM" + + "etricsEntry\022\034\n\024confidence_threshold\030\001 \001(" + + "\002\022\016\n\006recall\030\002 \001(\002\022\021\n\tprecision\030\003 \001(\002\022\020\n\010" + + "f1_score\030\004 \001(\002\"\321\001\n%ImageObjectDetectionE" + + "valuationMetrics\022$\n\034evaluated_bounding_b" + + "ox_count\030\001 \001(\005\022U\n\034bounding_box_metrics_e" + + "ntries\030\002 \003(\0132/.google.cloud.automl.v1.Bo" + + "undingBoxMetricsEntry\022+\n#bounding_box_me" + + "an_average_precision\030\003 \001(\002B\252\001\n\032com.googl" + + "e.cloud.automl.v1P\001Z + * A structured text document e.g. a PDF. + * + * + * Protobuf type {@code google.cloud.automl.v1.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + layout_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Document( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.DocumentInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.DocumentInputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.automl.v1.TextSnippet.Builder subBuilder = null; + if (documentText_ != null) { + subBuilder = documentText_.toBuilder(); + } + documentText_ = + input.readMessage( + com.google.cloud.automl.v1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentText_); + documentText_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + layout_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + layout_.add( + input.readMessage( + com.google.cloud.automl.v1.Document.Layout.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.automl.v1.DocumentDimensions.Builder subBuilder = null; + if (documentDimensions_ != null) { + subBuilder = documentDimensions_.toBuilder(); + } + documentDimensions_ = + input.readMessage( + com.google.cloud.automl.v1.DocumentDimensions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentDimensions_); + documentDimensions_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + pageCount_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + layout_ = java.util.Collections.unmodifiableList(layout_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Document.class, + com.google.cloud.automl.v1.Document.Builder.class); + } + + public interface LayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Document.Layout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + boolean hasTextSegment(); + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + com.google.cloud.automl.v1.TextSegment getTextSegment(); + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder(); + + /** + * + * + *
+     * Page number of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the original document, starts from 1.
+     * 
+ * + * int32 page_number = 2; + */ + int getPageNumber(); + + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + boolean hasBoundingPoly(); + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + com.google.cloud.automl.v1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * document.
+     * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + int getTextSegmentTypeValue(); + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * document.
+     * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType(); + } + /** + * + * + *
+   * Describes the layout information of a
+   * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the
+   * document.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Document.Layout} + */ + public static final class Layout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Document.Layout) + LayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use Layout.newBuilder() to construct. + private Layout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Layout() { + textSegmentType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Layout( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.TextSegment.Builder subBuilder = null; + if (textSegment_ != null) { + subBuilder = textSegment_.toBuilder(); + } + textSegment_ = + input.readMessage( + com.google.cloud.automl.v1.TextSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(textSegment_); + textSegment_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + pageNumber_ = input.readInt32(); + break; + } + case 26: + { + com.google.cloud.automl.v1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.automl.v1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + int rawValue = input.readEnum(); + + textSegmentType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_Layout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Document.Layout.class, + com.google.cloud.automl.v1.Document.Layout.Builder.class); + } + + /** + * + * + *
+     * The type of TextSegment in the context of the original document.
+     * 
+ * + * Protobuf enum {@code google.cloud.automl.v1.Document.Layout.TextSegmentType} + */ + public enum TextSegmentType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Should not be used.
+       * 
+ * + * TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + TEXT_SEGMENT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * The text segment is a token. e.g. word.
+       * 
+ * + * TOKEN = 1; + */ + TOKEN(1), + /** + * + * + *
+       * The text segment is a paragraph.
+       * 
+ * + * PARAGRAPH = 2; + */ + PARAGRAPH(2), + /** + * + * + *
+       * The text segment is a form field.
+       * 
+ * + * FORM_FIELD = 3; + */ + FORM_FIELD(3), + /** + * + * + *
+       * The text segment is the name part of a form field. It will be treated
+       * as child of another FORM_FIELD TextSegment if its span is subspan of
+       * another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_NAME = 4; + */ + FORM_FIELD_NAME(4), + /** + * + * + *
+       * The text segment is the text content part of a form field. It will be
+       * treated as child of another FORM_FIELD TextSegment if its span is
+       * subspan of another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_CONTENTS = 5; + */ + FORM_FIELD_CONTENTS(5), + /** + * + * + *
+       * The text segment is a whole table, including headers, and all rows.
+       * 
+ * + * TABLE = 6; + */ + TABLE(6), + /** + * + * + *
+       * The text segment is a table's headers. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_HEADER = 7; + */ + TABLE_HEADER(7), + /** + * + * + *
+       * The text segment is a row in table. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_ROW = 8; + */ + TABLE_ROW(8), + /** + * + * + *
+       * The text segment is a cell in table. It will be treated as child of
+       * another TABLE_ROW TextSegment if its span is subspan of another
+       * TextSegment with type TABLE_ROW.
+       * 
+ * + * TABLE_CELL = 9; + */ + TABLE_CELL(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Should not be used.
+       * 
+ * + * TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + public static final int TEXT_SEGMENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The text segment is a token. e.g. word.
+       * 
+ * + * TOKEN = 1; + */ + public static final int TOKEN_VALUE = 1; + /** + * + * + *
+       * The text segment is a paragraph.
+       * 
+ * + * PARAGRAPH = 2; + */ + public static final int PARAGRAPH_VALUE = 2; + /** + * + * + *
+       * The text segment is a form field.
+       * 
+ * + * FORM_FIELD = 3; + */ + public static final int FORM_FIELD_VALUE = 3; + /** + * + * + *
+       * The text segment is the name part of a form field. It will be treated
+       * as child of another FORM_FIELD TextSegment if its span is subspan of
+       * another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_NAME = 4; + */ + public static final int FORM_FIELD_NAME_VALUE = 4; + /** + * + * + *
+       * The text segment is the text content part of a form field. It will be
+       * treated as child of another FORM_FIELD TextSegment if its span is
+       * subspan of another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_CONTENTS = 5; + */ + public static final int FORM_FIELD_CONTENTS_VALUE = 5; + /** + * + * + *
+       * The text segment is a whole table, including headers, and all rows.
+       * 
+ * + * TABLE = 6; + */ + public static final int TABLE_VALUE = 6; + /** + * + * + *
+       * The text segment is a table's headers. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_HEADER = 7; + */ + public static final int TABLE_HEADER_VALUE = 7; + /** + * + * + *
+       * The text segment is a row in table. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_ROW = 8; + */ + public static final int TABLE_ROW_VALUE = 8; + /** + * + * + *
+       * The text segment is a cell in table. It will be treated as child of
+       * another TABLE_ROW TextSegment if its span is subspan of another
+       * TextSegment with type TABLE_ROW.
+       * 
+ * + * TABLE_CELL = 9; + */ + public static final int TABLE_CELL_VALUE = 9; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TextSegmentType valueOf(int value) { + return forNumber(value); + } + + public static TextSegmentType forNumber(int value) { + switch (value) { + case 0: + return TEXT_SEGMENT_TYPE_UNSPECIFIED; + case 1: + return TOKEN; + case 2: + return PARAGRAPH; + case 3: + return FORM_FIELD; + case 4: + return FORM_FIELD_NAME; + case 5: + return FORM_FIELD_CONTENTS; + case 6: + return TABLE; + case 7: + return TABLE_HEADER; + case 8: + return TABLE_ROW; + case 9: + return TABLE_CELL; + 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 TextSegmentType findValueByNumber(int number) { + return TextSegmentType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.automl.v1.Document.Layout.getDescriptor().getEnumTypes().get(0); + } + + private static final TextSegmentType[] VALUES = values(); + + public static TextSegmentType 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 TextSegmentType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.Document.Layout.TextSegmentType) + } + + public static final int TEXT_SEGMENT_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.TextSegment textSegment_; + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public boolean hasTextSegment() { + return textSegment_ != null; + } + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1.TextSegment getTextSegment() { + return textSegment_ == null + ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() + : textSegment_; + } + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + return getTextSegment(); + } + + public static final int PAGE_NUMBER_FIELD_NUMBER = 2; + private int pageNumber_; + /** + * + * + *
+     * Page number of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the original document, starts from 1.
+     * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } + + public static final int BOUNDING_POLY_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1.BoundingPoly boundingPoly_; + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } + + public static final int TEXT_SEGMENT_TYPE_FIELD_NUMBER = 4; + private int textSegmentType_; + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * document.
+     * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public int getTextSegmentTypeValue() { + return textSegmentType_; + } + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+     * document.
+     * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.Document.Layout.TextSegmentType result = + com.google.cloud.automl.v1.Document.Layout.TextSegmentType.valueOf(textSegmentType_); + return result == null + ? com.google.cloud.automl.v1.Document.Layout.TextSegmentType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (textSegment_ != null) { + output.writeMessage(1, getTextSegment()); + } + if (pageNumber_ != 0) { + output.writeInt32(2, pageNumber_); + } + if (boundingPoly_ != null) { + output.writeMessage(3, getBoundingPoly()); + } + if (textSegmentType_ + != com.google.cloud.automl.v1.Document.Layout.TextSegmentType + .TEXT_SEGMENT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, textSegmentType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (textSegment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTextSegment()); + } + if (pageNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageNumber_); + } + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBoundingPoly()); + } + if (textSegmentType_ + != com.google.cloud.automl.v1.Document.Layout.TextSegmentType + .TEXT_SEGMENT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, textSegmentType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.Document.Layout)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.Document.Layout other = + (com.google.cloud.automl.v1.Document.Layout) obj; + + if (hasTextSegment() != other.hasTextSegment()) return false; + if (hasTextSegment()) { + if (!getTextSegment().equals(other.getTextSegment())) return false; + } + if (getPageNumber() != other.getPageNumber()) return false; + if (hasBoundingPoly() != other.hasBoundingPoly()) return false; + if (hasBoundingPoly()) { + if (!getBoundingPoly().equals(other.getBoundingPoly())) return false; + } + if (textSegmentType_ != other.textSegmentType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTextSegment()) { + hash = (37 * hash) + TEXT_SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getTextSegment().hashCode(); + } + hash = (37 * hash) + PAGE_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getPageNumber(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + hash = (37 * hash) + TEXT_SEGMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + textSegmentType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.Document.Layout parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document.Layout 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.automl.v1.Document.Layout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document.Layout 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.automl.v1.Document.Layout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document.Layout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.Document.Layout parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document.Layout 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.automl.v1.Document.Layout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document.Layout 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.automl.v1.Document.Layout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document.Layout 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.automl.v1.Document.Layout 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; + } + /** + * + * + *
+     * Describes the layout information of a
+     * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the
+     * document.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Document.Layout} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Document.Layout) + com.google.cloud.automl.v1.Document.LayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_Layout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Document.Layout.class, + com.google.cloud.automl.v1.Document.Layout.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.Document.Layout.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (textSegmentBuilder_ == null) { + textSegment_ = null; + } else { + textSegment_ = null; + textSegmentBuilder_ = null; + } + pageNumber_ = 0; + + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + textSegmentType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document.Layout getDefaultInstanceForType() { + return com.google.cloud.automl.v1.Document.Layout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document.Layout build() { + com.google.cloud.automl.v1.Document.Layout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document.Layout buildPartial() { + com.google.cloud.automl.v1.Document.Layout result = + new com.google.cloud.automl.v1.Document.Layout(this); + if (textSegmentBuilder_ == null) { + result.textSegment_ = textSegment_; + } else { + result.textSegment_ = textSegmentBuilder_.build(); + } + result.pageNumber_ = pageNumber_; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.textSegmentType_ = textSegmentType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.Document.Layout) { + return mergeFrom((com.google.cloud.automl.v1.Document.Layout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.Document.Layout other) { + if (other == com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()) return this; + if (other.hasTextSegment()) { + mergeTextSegment(other.getTextSegment()); + } + if (other.getPageNumber() != 0) { + setPageNumber(other.getPageNumber()); + } + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (other.textSegmentType_ != 0) { + setTextSegmentTypeValue(other.getTextSegmentTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.Document.Layout parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.Document.Layout) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.TextSegment textSegment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder> + textSegmentBuilder_; + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public boolean hasTextSegment() { + return textSegmentBuilder_ != null || textSegment_ != null; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1.TextSegment getTextSegment() { + if (textSegmentBuilder_ == null) { + return textSegment_ == null + ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() + : textSegment_; + } else { + return textSegmentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public Builder setTextSegment(com.google.cloud.automl.v1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textSegment_ = value; + onChanged(); + } else { + textSegmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public Builder setTextSegment( + com.google.cloud.automl.v1.TextSegment.Builder builderForValue) { + if (textSegmentBuilder_ == null) { + textSegment_ = builderForValue.build(); + onChanged(); + } else { + textSegmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public Builder mergeTextSegment(com.google.cloud.automl.v1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (textSegment_ != null) { + textSegment_ = + com.google.cloud.automl.v1.TextSegment.newBuilder(textSegment_) + .mergeFrom(value) + .buildPartial(); + } else { + textSegment_ = value; + } + onChanged(); + } else { + textSegmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public Builder clearTextSegment() { + if (textSegmentBuilder_ == null) { + textSegment_ = null; + onChanged(); + } else { + textSegment_ = null; + textSegmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1.TextSegment.Builder getTextSegmentBuilder() { + + onChanged(); + return getTextSegmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + if (textSegmentBuilder_ != null) { + return textSegmentBuilder_.getMessageOrBuilder(); + } else { + return textSegment_ == null + ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() + : textSegment_; + } + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder> + getTextSegmentFieldBuilder() { + if (textSegmentBuilder_ == null) { + textSegmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder>( + getTextSegment(), getParentForChildren(), isClean()); + textSegment_ = null; + } + return textSegmentBuilder_; + } + + private int pageNumber_; + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public Builder setPageNumber(int value) { + + pageNumber_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public Builder clearPageNumber() { + + pageNumber_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.BoundingPoly boundingPoly_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public Builder setBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public Builder setBoundingPoly( + com.google.cloud.automl.v1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public Builder mergeBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.automl.v1.BoundingPoly.newBuilder(boundingPoly_) + .mergeFrom(value) + .buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private int textSegmentType_ = 0; + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * document.
+       * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public int getTextSegmentTypeValue() { + return textSegmentType_; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * document.
+       * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public Builder setTextSegmentTypeValue(int value) { + textSegmentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * document.
+       * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.Document.Layout.TextSegmentType result = + com.google.cloud.automl.v1.Document.Layout.TextSegmentType.valueOf(textSegmentType_); + return result == null + ? com.google.cloud.automl.v1.Document.Layout.TextSegmentType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * document.
+       * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public Builder setTextSegmentType( + com.google.cloud.automl.v1.Document.Layout.TextSegmentType value) { + if (value == null) { + throw new NullPointerException(); + } + + textSegmentType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
+       * document.
+       * 
+ * + * .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + public Builder clearTextSegmentType() { + + textSegmentType_ = 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.automl.v1.Document.Layout) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Document.Layout) + private static final com.google.cloud.automl.v1.Document.Layout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Document.Layout(); + } + + public static com.google.cloud.automl.v1.Document.Layout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Layout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Layout(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document.Layout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.DocumentInputConfig inputConfig_; + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.DocumentInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int DOCUMENT_TEXT_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1.TextSnippet documentText_; + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public boolean hasDocumentText() { + return documentText_ != null; + } + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1.TextSnippet getDocumentText() { + return documentText_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : documentText_; + } + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getDocumentTextOrBuilder() { + return getDocumentText(); + } + + public static final int LAYOUT_FIELD_NUMBER = 3; + private java.util.List layout_; + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public java.util.List getLayoutList() { + return layout_; + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutOrBuilderList() { + return layout_; + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public int getLayoutCount() { + return layout_.size(); + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.Layout getLayout(int index) { + return layout_.get(index); + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { + return layout_.get(index); + } + + public static final int DOCUMENT_DIMENSIONS_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1.DocumentDimensions documentDimensions_; + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public boolean hasDocumentDimensions() { + return documentDimensions_ != null; + } + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1.DocumentDimensions getDocumentDimensions() { + return documentDimensions_ == null + ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; + } + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder() { + return getDocumentDimensions(); + } + + public static final int PAGE_COUNT_FIELD_NUMBER = 5; + private int pageCount_; + /** + * + * + *
+   * Number of pages in the document.
+   * 
+ * + * int32 page_count = 5; + */ + public int getPageCount() { + return pageCount_; + } + + 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 (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + if (documentText_ != null) { + output.writeMessage(2, getDocumentText()); + } + for (int i = 0; i < layout_.size(); i++) { + output.writeMessage(3, layout_.get(i)); + } + if (documentDimensions_ != null) { + output.writeMessage(4, getDocumentDimensions()); + } + if (pageCount_ != 0) { + output.writeInt32(5, pageCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + if (documentText_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentText()); + } + for (int i = 0; i < layout_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, layout_.get(i)); + } + if (documentDimensions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentDimensions()); + } + if (pageCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, pageCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.Document)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.Document other = (com.google.cloud.automl.v1.Document) obj; + + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasDocumentText() != other.hasDocumentText()) return false; + if (hasDocumentText()) { + if (!getDocumentText().equals(other.getDocumentText())) return false; + } + if (!getLayoutList().equals(other.getLayoutList())) return false; + if (hasDocumentDimensions() != other.hasDocumentDimensions()) return false; + if (hasDocumentDimensions()) { + if (!getDocumentDimensions().equals(other.getDocumentDimensions())) return false; + } + if (getPageCount() != other.getPageCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasDocumentText()) { + hash = (37 * hash) + DOCUMENT_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getDocumentText().hashCode(); + } + if (getLayoutCount() > 0) { + hash = (37 * hash) + LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getLayoutList().hashCode(); + } + if (hasDocumentDimensions()) { + hash = (37 * hash) + DOCUMENT_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentDimensions().hashCode(); + } + hash = (37 * hash) + PAGE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPageCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.Document parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document 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.automl.v1.Document parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document 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.automl.v1.Document parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Document parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.Document parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document 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.automl.v1.Document parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document 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.automl.v1.Document parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Document 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.automl.v1.Document prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A structured text document e.g. a PDF.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Document} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Document) + com.google.cloud.automl.v1.DocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Document.class, + com.google.cloud.automl.v1.Document.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.Document.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLayoutFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (documentTextBuilder_ == null) { + documentText_ = null; + } else { + documentText_ = null; + documentTextBuilder_ = null; + } + if (layoutBuilder_ == null) { + layout_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + layoutBuilder_.clear(); + } + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = null; + } else { + documentDimensions_ = null; + documentDimensionsBuilder_ = null; + } + pageCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Document_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document getDefaultInstanceForType() { + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document build() { + com.google.cloud.automl.v1.Document result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document buildPartial() { + com.google.cloud.automl.v1.Document result = new com.google.cloud.automl.v1.Document(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (documentTextBuilder_ == null) { + result.documentText_ = documentText_; + } else { + result.documentText_ = documentTextBuilder_.build(); + } + if (layoutBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + layout_ = java.util.Collections.unmodifiableList(layout_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.layout_ = layout_; + } else { + result.layout_ = layoutBuilder_.build(); + } + if (documentDimensionsBuilder_ == null) { + result.documentDimensions_ = documentDimensions_; + } else { + result.documentDimensions_ = documentDimensionsBuilder_.build(); + } + result.pageCount_ = pageCount_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.Document) { + return mergeFrom((com.google.cloud.automl.v1.Document) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.Document other) { + if (other == com.google.cloud.automl.v1.Document.getDefaultInstance()) return this; + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasDocumentText()) { + mergeDocumentText(other.getDocumentText()); + } + if (layoutBuilder_ == null) { + if (!other.layout_.isEmpty()) { + if (layout_.isEmpty()) { + layout_ = other.layout_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLayoutIsMutable(); + layout_.addAll(other.layout_); + } + onChanged(); + } + } else { + if (!other.layout_.isEmpty()) { + if (layoutBuilder_.isEmpty()) { + layoutBuilder_.dispose(); + layoutBuilder_ = null; + layout_ = other.layout_; + bitField0_ = (bitField0_ & ~0x00000004); + layoutBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLayoutFieldBuilder() + : null; + } else { + layoutBuilder_.addAllMessages(other.layout_); + } + } + } + if (other.hasDocumentDimensions()) { + mergeDocumentDimensions(other.getDocumentDimensions()); + } + if (other.getPageCount() != 0) { + setPageCount(other.getPageCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.Document parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.Document) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.automl.v1.DocumentInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentInputConfig, + com.google.cloud.automl.v1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1.DocumentInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.DocumentInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1.DocumentInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1.DocumentInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.DocumentInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentInputConfig, + com.google.cloud.automl.v1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1.DocumentInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentInputConfig, + com.google.cloud.automl.v1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1.DocumentInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.automl.v1.TextSnippet documentText_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder> + documentTextBuilder_; + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public boolean hasDocumentText() { + return documentTextBuilder_ != null || documentText_ != null; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1.TextSnippet getDocumentText() { + if (documentTextBuilder_ == null) { + return documentText_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : documentText_; + } else { + return documentTextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public Builder setDocumentText(com.google.cloud.automl.v1.TextSnippet value) { + if (documentTextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentText_ = value; + onChanged(); + } else { + documentTextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public Builder setDocumentText(com.google.cloud.automl.v1.TextSnippet.Builder builderForValue) { + if (documentTextBuilder_ == null) { + documentText_ = builderForValue.build(); + onChanged(); + } else { + documentTextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public Builder mergeDocumentText(com.google.cloud.automl.v1.TextSnippet value) { + if (documentTextBuilder_ == null) { + if (documentText_ != null) { + documentText_ = + com.google.cloud.automl.v1.TextSnippet.newBuilder(documentText_) + .mergeFrom(value) + .buildPartial(); + } else { + documentText_ = value; + } + onChanged(); + } else { + documentTextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public Builder clearDocumentText() { + if (documentTextBuilder_ == null) { + documentText_ = null; + onChanged(); + } else { + documentText_ = null; + documentTextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1.TextSnippet.Builder getDocumentTextBuilder() { + + onChanged(); + return getDocumentTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1.TextSnippetOrBuilder getDocumentTextOrBuilder() { + if (documentTextBuilder_ != null) { + return documentTextBuilder_.getMessageOrBuilder(); + } else { + return documentText_ == null + ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() + : documentText_; + } + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder> + getDocumentTextFieldBuilder() { + if (documentTextBuilder_ == null) { + documentTextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSnippet, + com.google.cloud.automl.v1.TextSnippet.Builder, + com.google.cloud.automl.v1.TextSnippetOrBuilder>( + getDocumentText(), getParentForChildren(), isClean()); + documentText_ = null; + } + return documentTextBuilder_; + } + + private java.util.List layout_ = + java.util.Collections.emptyList(); + + private void ensureLayoutIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + layout_ = new java.util.ArrayList(layout_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Document.Layout, + com.google.cloud.automl.v1.Document.Layout.Builder, + com.google.cloud.automl.v1.Document.LayoutOrBuilder> + layoutBuilder_; + + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public java.util.List getLayoutList() { + if (layoutBuilder_ == null) { + return java.util.Collections.unmodifiableList(layout_); + } else { + return layoutBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public int getLayoutCount() { + if (layoutBuilder_ == null) { + return layout_.size(); + } else { + return layoutBuilder_.getCount(); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.Layout getLayout(int index) { + if (layoutBuilder_ == null) { + return layout_.get(index); + } else { + return layoutBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder setLayout(int index, com.google.cloud.automl.v1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.set(index, value); + onChanged(); + } else { + layoutBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder setLayout( + int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.set(index, builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder addLayout(com.google.cloud.automl.v1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.add(value); + onChanged(); + } else { + layoutBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder addLayout(int index, com.google.cloud.automl.v1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.add(index, value); + onChanged(); + } else { + layoutBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder addLayout(com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.add(builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder addLayout( + int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.add(index, builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder addAllLayout( + java.lang.Iterable values) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, layout_); + onChanged(); + } else { + layoutBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder clearLayout() { + if (layoutBuilder_ == null) { + layout_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + layoutBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public Builder removeLayout(int index) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.remove(index); + onChanged(); + } else { + layoutBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.Layout.Builder getLayoutBuilder(int index) { + return getLayoutFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { + if (layoutBuilder_ == null) { + return layout_.get(index); + } else { + return layoutBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutOrBuilderList() { + if (layoutBuilder_ != null) { + return layoutBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(layout_); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.Layout.Builder addLayoutBuilder() { + return getLayoutFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()); + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1.Document.Layout.Builder addLayoutBuilder(int index) { + return getLayoutFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()); + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutBuilderList() { + return getLayoutFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Document.Layout, + com.google.cloud.automl.v1.Document.Layout.Builder, + com.google.cloud.automl.v1.Document.LayoutOrBuilder> + getLayoutFieldBuilder() { + if (layoutBuilder_ == null) { + layoutBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.Document.Layout, + com.google.cloud.automl.v1.Document.Layout.Builder, + com.google.cloud.automl.v1.Document.LayoutOrBuilder>( + layout_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + layout_ = null; + } + return layoutBuilder_; + } + + private com.google.cloud.automl.v1.DocumentDimensions documentDimensions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentDimensions, + com.google.cloud.automl.v1.DocumentDimensions.Builder, + com.google.cloud.automl.v1.DocumentDimensionsOrBuilder> + documentDimensionsBuilder_; + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public boolean hasDocumentDimensions() { + return documentDimensionsBuilder_ != null || documentDimensions_ != null; + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1.DocumentDimensions getDocumentDimensions() { + if (documentDimensionsBuilder_ == null) { + return documentDimensions_ == null + ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; + } else { + return documentDimensionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public Builder setDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value) { + if (documentDimensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentDimensions_ = value; + onChanged(); + } else { + documentDimensionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public Builder setDocumentDimensions( + com.google.cloud.automl.v1.DocumentDimensions.Builder builderForValue) { + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = builderForValue.build(); + onChanged(); + } else { + documentDimensionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public Builder mergeDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value) { + if (documentDimensionsBuilder_ == null) { + if (documentDimensions_ != null) { + documentDimensions_ = + com.google.cloud.automl.v1.DocumentDimensions.newBuilder(documentDimensions_) + .mergeFrom(value) + .buildPartial(); + } else { + documentDimensions_ = value; + } + onChanged(); + } else { + documentDimensionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public Builder clearDocumentDimensions() { + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = null; + onChanged(); + } else { + documentDimensions_ = null; + documentDimensionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1.DocumentDimensions.Builder getDocumentDimensionsBuilder() { + + onChanged(); + return getDocumentDimensionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder() { + if (documentDimensionsBuilder_ != null) { + return documentDimensionsBuilder_.getMessageOrBuilder(); + } else { + return documentDimensions_ == null + ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; + } + } + /** + * + * + *
+     * The dimensions of the page in the document.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentDimensions, + com.google.cloud.automl.v1.DocumentDimensions.Builder, + com.google.cloud.automl.v1.DocumentDimensionsOrBuilder> + getDocumentDimensionsFieldBuilder() { + if (documentDimensionsBuilder_ == null) { + documentDimensionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.DocumentDimensions, + com.google.cloud.automl.v1.DocumentDimensions.Builder, + com.google.cloud.automl.v1.DocumentDimensionsOrBuilder>( + getDocumentDimensions(), getParentForChildren(), isClean()); + documentDimensions_ = null; + } + return documentDimensionsBuilder_; + } + + private int pageCount_; + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public int getPageCount() { + return pageCount_; + } + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public Builder setPageCount(int value) { + + pageCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public Builder clearPageCount() { + + pageCount_ = 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.automl.v1.Document) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Document) + private static final com.google.cloud.automl.v1.Document DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Document(); + } + + public static com.google.cloud.automl.v1.Document getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Document parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Document(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Document getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensions.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensions.java new file mode 100644 index 000000000..221803fb1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensions.java @@ -0,0 +1,920 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/data_items.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Message that describes dimension of a document.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DocumentDimensions} + */ +public final class DocumentDimensions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DocumentDimensions) + DocumentDimensionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentDimensions.newBuilder() to construct. + private DocumentDimensions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentDimensions() { + unit_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentDimensions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + unit_ = rawValue; + break; + } + case 21: + { + width_ = input.readFloat(); + break; + } + case 29: + { + height_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_DocumentDimensions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_DocumentDimensions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DocumentDimensions.class, + com.google.cloud.automl.v1.DocumentDimensions.Builder.class); + } + + /** + * + * + *
+   * Unit of the document dimension.
+   * 
+ * + * Protobuf enum {@code google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit} + */ + public enum DocumentDimensionUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Should not be used.
+     * 
+ * + * DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED(0), + /** + * + * + *
+     * Document dimension is measured in inches.
+     * 
+ * + * INCH = 1; + */ + INCH(1), + /** + * + * + *
+     * Document dimension is measured in centimeters.
+     * 
+ * + * CENTIMETER = 2; + */ + CENTIMETER(2), + /** + * + * + *
+     * Document dimension is measured in points. 72 points = 1 inch.
+     * 
+ * + * POINT = 3; + */ + POINT(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Should not be used.
+     * 
+ * + * DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + public static final int DOCUMENT_DIMENSION_UNIT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Document dimension is measured in inches.
+     * 
+ * + * INCH = 1; + */ + public static final int INCH_VALUE = 1; + /** + * + * + *
+     * Document dimension is measured in centimeters.
+     * 
+ * + * CENTIMETER = 2; + */ + public static final int CENTIMETER_VALUE = 2; + /** + * + * + *
+     * Document dimension is measured in points. 72 points = 1 inch.
+     * 
+ * + * POINT = 3; + */ + public static final int POINT_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DocumentDimensionUnit valueOf(int value) { + return forNumber(value); + } + + public static DocumentDimensionUnit forNumber(int value) { + switch (value) { + case 0: + return DOCUMENT_DIMENSION_UNIT_UNSPECIFIED; + case 1: + return INCH; + case 2: + return CENTIMETER; + case 3: + return POINT; + 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 DocumentDimensionUnit findValueByNumber(int number) { + return DocumentDimensionUnit.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.automl.v1.DocumentDimensions.getDescriptor().getEnumTypes().get(0); + } + + private static final DocumentDimensionUnit[] VALUES = values(); + + public static DocumentDimensionUnit 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 DocumentDimensionUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit) + } + + public static final int UNIT_FIELD_NUMBER = 1; + private int unit_; + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit getUnit() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit result = + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit.valueOf(unit_); + return result == null + ? com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit.UNRECOGNIZED + : result; + } + + public static final int WIDTH_FIELD_NUMBER = 2; + private float width_; + /** + * + * + *
+   * Width value of the document, works together with the unit.
+   * 
+ * + * float width = 2; + */ + public float getWidth() { + return width_; + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private float height_; + /** + * + * + *
+   * Height value of the document, works together with the unit.
+   * 
+ * + * float height = 3; + */ + public float getHeight() { + return height_; + } + + 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 (unit_ + != com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + .DOCUMENT_DIMENSION_UNIT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, unit_); + } + if (width_ != 0F) { + output.writeFloat(2, width_); + } + if (height_ != 0F) { + output.writeFloat(3, height_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unit_ + != com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + .DOCUMENT_DIMENSION_UNIT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, unit_); + } + if (width_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, width_); + } + if (height_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, height_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.DocumentDimensions)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DocumentDimensions other = + (com.google.cloud.automl.v1.DocumentDimensions) obj; + + if (unit_ != other.unit_) return false; + if (java.lang.Float.floatToIntBits(getWidth()) + != java.lang.Float.floatToIntBits(other.getWidth())) return false; + if (java.lang.Float.floatToIntBits(getHeight()) + != java.lang.Float.floatToIntBits(other.getHeight())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + unit_; + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getWidth()); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getHeight()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.DocumentDimensions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentDimensions 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.automl.v1.DocumentDimensions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentDimensions 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.automl.v1.DocumentDimensions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentDimensions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.DocumentDimensions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentDimensions 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.automl.v1.DocumentDimensions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentDimensions 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.automl.v1.DocumentDimensions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentDimensions 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.automl.v1.DocumentDimensions 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; + } + /** + * + * + *
+   * Message that describes dimension of a document.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DocumentDimensions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DocumentDimensions) + com.google.cloud.automl.v1.DocumentDimensionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_DocumentDimensions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_DocumentDimensions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DocumentDimensions.class, + com.google.cloud.automl.v1.DocumentDimensions.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DocumentDimensions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + unit_ = 0; + + width_ = 0F; + + height_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_DocumentDimensions_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentDimensions getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentDimensions build() { + com.google.cloud.automl.v1.DocumentDimensions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentDimensions buildPartial() { + com.google.cloud.automl.v1.DocumentDimensions result = + new com.google.cloud.automl.v1.DocumentDimensions(this); + result.unit_ = unit_; + result.width_ = width_; + result.height_ = height_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.DocumentDimensions) { + return mergeFrom((com.google.cloud.automl.v1.DocumentDimensions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DocumentDimensions other) { + if (other == com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance()) return this; + if (other.unit_ != 0) { + setUnitValue(other.getUnitValue()); + } + if (other.getWidth() != 0F) { + setWidth(other.getWidth()); + } + if (other.getHeight() != 0F) { + setHeight(other.getHeight()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.DocumentDimensions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.DocumentDimensions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int unit_ = 0; + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder setUnitValue(int value) { + unit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit getUnit() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit result = + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit.valueOf(unit_); + return result == null + ? com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder setUnit( + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder clearUnit() { + + unit_ = 0; + onChanged(); + return this; + } + + private float width_; + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public float getWidth() { + return width_; + } + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public Builder setWidth(float value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public Builder clearWidth() { + + width_ = 0F; + onChanged(); + return this; + } + + private float height_; + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public float getHeight() { + return height_; + } + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public Builder setHeight(float value) { + + height_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public Builder clearHeight() { + + height_ = 0F; + 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.automl.v1.DocumentDimensions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DocumentDimensions) + private static final com.google.cloud.automl.v1.DocumentDimensions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DocumentDimensions(); + } + + public static com.google.cloud.automl.v1.DocumentDimensions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentDimensions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentDimensions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentDimensions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensionsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensionsOrBuilder.java new file mode 100644 index 000000000..6a74b2de4 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentDimensionsOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/data_items.proto + +package com.google.cloud.automl.v1; + +public interface DocumentDimensionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DocumentDimensions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + int getUnitValue(); + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + com.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit getUnit(); + + /** + * + * + *
+   * Width value of the document, works together with the unit.
+   * 
+ * + * float width = 2; + */ + float getWidth(); + + /** + * + * + *
+   * Height value of the document, works together with the unit.
+   * 
+ * + * float height = 3; + */ + float getHeight(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfig.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfig.java new file mode 100644 index 000000000..15ea5fc05 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfig.java @@ -0,0 +1,751 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Input configuration of a [Document][google.cloud.automl.v1.Document].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DocumentInputConfig} + */ +public final class DocumentInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.DocumentInputConfig) + DocumentInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentInputConfig.newBuilder() to construct. + private DocumentInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentInputConfig() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentInputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.GcsSource.Builder subBuilder = null; + if (gcsSource_ != null) { + subBuilder = gcsSource_.toBuilder(); + } + gcsSource_ = + input.readMessage( + com.google.cloud.automl.v1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gcsSource_); + gcsSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DocumentInputConfig.class, + com.google.cloud.automl.v1.DocumentInputConfig.Builder.class); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.GcsSource gcsSource_; + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.automl.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return getGcsSource(); + } + + 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 (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.DocumentInputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.DocumentInputConfig other = + (com.google.cloud.automl.v1.DocumentInputConfig) obj; + + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.DocumentInputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig 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.automl.v1.DocumentInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig 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.automl.v1.DocumentInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig 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.automl.v1.DocumentInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig 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.automl.v1.DocumentInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig 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.automl.v1.DocumentInputConfig 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; + } + /** + * + * + *
+   * Input configuration of a [Document][google.cloud.automl.v1.Document].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.DocumentInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.DocumentInputConfig) + com.google.cloud.automl.v1.DocumentInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.DocumentInputConfig.class, + com.google.cloud.automl.v1.DocumentInputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.DocumentInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentInputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentInputConfig build() { + com.google.cloud.automl.v1.DocumentInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentInputConfig buildPartial() { + com.google.cloud.automl.v1.DocumentInputConfig result = + new com.google.cloud.automl.v1.DocumentInputConfig(this); + if (gcsSourceBuilder_ == null) { + result.gcsSource_ = gcsSource_; + } else { + result.gcsSource_ = gcsSourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.DocumentInputConfig) { + return mergeFrom((com.google.cloud.automl.v1.DocumentInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.DocumentInputConfig other) { + if (other == com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.DocumentInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.DocumentInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public boolean hasGcsSource() { + return gcsSourceBuilder_ != null || gcsSource_ != null; + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.automl.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.automl.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (gcsSource_ != null) { + gcsSource_ = + com.google.cloud.automl.v1.GcsSource.newBuilder(gcsSource_) + .mergeFrom(value) + .buildPartial(); + } else { + gcsSource_ = value; + } + onChanged(); + } else { + gcsSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + gcsSource_ = null; + onChanged(); + } else { + gcsSource_ = null; + gcsSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSource.Builder getGcsSourceBuilder() { + + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + public com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.automl.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * The Google Cloud Storage location of the document file. Only a single path
+     * should be given.
+     * Max supported size: 512MB.
+     * Supported extensions: .PDF.
+     * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsSource, + com.google.cloud.automl.v1.GcsSource.Builder, + com.google.cloud.automl.v1.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + @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.automl.v1.DocumentInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DocumentInputConfig) + private static final com.google.cloud.automl.v1.DocumentInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.DocumentInputConfig(); + } + + public static com.google.cloud.automl.v1.DocumentInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentInputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.DocumentInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfigOrBuilder.java new file mode 100644 index 000000000..c27164278 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentInputConfigOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +public interface DocumentInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.DocumentInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + boolean hasGcsSource(); + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + com.google.cloud.automl.v1.GcsSource getGcsSource(); + /** + * + * + *
+   * The Google Cloud Storage location of the document file. Only a single path
+   * should be given.
+   * Max supported size: 512MB.
+   * Supported extensions: .PDF.
+   * 
+ * + * .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentOrBuilder.java new file mode 100644 index 000000000..377487ad6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/DocumentOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/data_items.proto + +package com.google.cloud.automl.v1; + +public interface DocumentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Document) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + boolean hasInputConfig(); + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + com.google.cloud.automl.v1.DocumentInputConfig getInputConfig(); + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + com.google.cloud.automl.v1.DocumentInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + boolean hasDocumentText(); + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + com.google.cloud.automl.v1.TextSnippet getDocumentText(); + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + com.google.cloud.automl.v1.TextSnippetOrBuilder getDocumentTextOrBuilder(); + + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + java.util.List getLayoutList(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + com.google.cloud.automl.v1.Document.Layout getLayout(int index); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + int getLayoutCount(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + java.util.List + getLayoutOrBuilderList(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + com.google.cloud.automl.v1.Document.LayoutOrBuilder getLayoutOrBuilder(int index); + + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + boolean hasDocumentDimensions(); + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + com.google.cloud.automl.v1.DocumentDimensions getDocumentDimensions(); + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + com.google.cloud.automl.v1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder(); + + /** + * + * + *
+   * Number of pages in the document.
+   * 
+ * + * int32 page_count = 5; + */ + int getPageCount(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java index 29b2b6112..feb1a716a 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayload.java @@ -63,6 +63,21 @@ private ExamplePayload( case 0: done = true; break; + case 10: + { + com.google.cloud.automl.v1.Image.Builder subBuilder = null; + if (payloadCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1.Image) payload_).toBuilder(); + } + payload_ = + input.readMessage(com.google.cloud.automl.v1.Image.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.Image) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 1; + break; + } case 18: { com.google.cloud.automl.v1.TextSnippet.Builder subBuilder = null; @@ -79,6 +94,22 @@ private ExamplePayload( payloadCase_ = 2; break; } + case 34: + { + com.google.cloud.automl.v1.Document.Builder subBuilder = null; + if (payloadCase_ == 4) { + subBuilder = ((com.google.cloud.automl.v1.Document) payload_).toBuilder(); + } + payload_ = + input.readMessage( + com.google.cloud.automl.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.Document) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 4; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -117,7 +148,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { private java.lang.Object payload_; public enum PayloadCase implements com.google.protobuf.Internal.EnumLite { + IMAGE(1), TEXT_SNIPPET(2), + DOCUMENT(4), PAYLOAD_NOT_SET(0); private final int value; @@ -132,8 +165,12 @@ public static PayloadCase valueOf(int value) { public static PayloadCase forNumber(int value) { switch (value) { + case 1: + return IMAGE; case 2: return TEXT_SNIPPET; + case 4: + return DOCUMENT; case 0: return PAYLOAD_NOT_SET; default: @@ -150,6 +187,50 @@ public PayloadCase getPayloadCase() { return PayloadCase.forNumber(payloadCase_); } + public static final int IMAGE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public boolean hasImage() { + return payloadCase_ == 1; + } + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public com.google.cloud.automl.v1.Image getImage() { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1.Image) payload_; + } + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public com.google.cloud.automl.v1.ImageOrBuilder getImageOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1.Image) payload_; + } + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + public static final int TEXT_SNIPPET_FIELD_NUMBER = 2; /** * @@ -194,6 +275,50 @@ public com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder() return com.google.cloud.automl.v1.TextSnippet.getDefaultInstance(); } + public static final int DOCUMENT_FIELD_NUMBER = 4; + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public boolean hasDocument() { + return payloadCase_ == 4; + } + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public com.google.cloud.automl.v1.Document getDocument() { + if (payloadCase_ == 4) { + return (com.google.cloud.automl.v1.Document) payload_; + } + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public com.google.cloud.automl.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (payloadCase_ == 4) { + return (com.google.cloud.automl.v1.Document) payload_; + } + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -208,9 +333,15 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1.Image) payload_); + } if (payloadCase_ == 2) { output.writeMessage(2, (com.google.cloud.automl.v1.TextSnippet) payload_); } + if (payloadCase_ == 4) { + output.writeMessage(4, (com.google.cloud.automl.v1.Document) payload_); + } unknownFields.writeTo(output); } @@ -220,11 +351,21 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.automl.v1.Image) payload_); + } if (payloadCase_ == 2) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.automl.v1.TextSnippet) payload_); } + if (payloadCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.automl.v1.Document) payload_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -243,9 +384,15 @@ public boolean equals(final java.lang.Object obj) { if (!getPayloadCase().equals(other.getPayloadCase())) return false; switch (payloadCase_) { + case 1: + if (!getImage().equals(other.getImage())) return false; + break; case 2: if (!getTextSnippet().equals(other.getTextSnippet())) return false; break; + case 4: + if (!getDocument().equals(other.getDocument())) return false; + break; case 0: default: } @@ -261,10 +408,18 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); switch (payloadCase_) { + case 1: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; case 2: hash = (37 * hash) + TEXT_SNIPPET_FIELD_NUMBER; hash = (53 * hash) + getTextSnippet().hashCode(); break; + case 4: + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + break; case 0: default: } @@ -442,6 +597,13 @@ public com.google.cloud.automl.v1.ExamplePayload build() { public com.google.cloud.automl.v1.ExamplePayload buildPartial() { com.google.cloud.automl.v1.ExamplePayload result = new com.google.cloud.automl.v1.ExamplePayload(this); + if (payloadCase_ == 1) { + if (imageBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = imageBuilder_.build(); + } + } if (payloadCase_ == 2) { if (textSnippetBuilder_ == null) { result.payload_ = payload_; @@ -449,6 +611,13 @@ public com.google.cloud.automl.v1.ExamplePayload buildPartial() { result.payload_ = textSnippetBuilder_.build(); } } + if (payloadCase_ == 4) { + if (documentBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = documentBuilder_.build(); + } + } result.payloadCase_ = payloadCase_; onBuilt(); return result; @@ -500,11 +669,21 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.automl.v1.ExamplePayload other) { if (other == com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()) return this; switch (other.getPayloadCase()) { + case IMAGE: + { + mergeImage(other.getImage()); + break; + } case TEXT_SNIPPET: { mergeTextSnippet(other.getTextSnippet()); break; } + case DOCUMENT: + { + mergeDocument(other.getDocument()); + break; + } case PAYLOAD_NOT_SET: { break; @@ -553,6 +732,205 @@ public Builder clearPayload() { return this; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Image, + com.google.cloud.automl.v1.Image.Builder, + com.google.cloud.automl.v1.ImageOrBuilder> + imageBuilder_; + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public boolean hasImage() { + return payloadCase_ == 1; + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public com.google.cloud.automl.v1.Image getImage() { + if (imageBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1.Image) payload_; + } + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return imageBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public Builder setImage(com.google.cloud.automl.v1.Image value) { + if (imageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + imageBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public Builder setImage(com.google.cloud.automl.v1.Image.Builder builderForValue) { + if (imageBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + imageBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public Builder mergeImage(com.google.cloud.automl.v1.Image value) { + if (imageBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.cloud.automl.v1.Image.getDefaultInstance()) { + payload_ = + com.google.cloud.automl.v1.Image.newBuilder( + (com.google.cloud.automl.v1.Image) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + imageBuilder_.mergeFrom(value); + } + imageBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public Builder clearImage() { + if (imageBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + imageBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public com.google.cloud.automl.v1.Image.Builder getImageBuilder() { + return getImageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + public com.google.cloud.automl.v1.ImageOrBuilder getImageOrBuilder() { + if ((payloadCase_ == 1) && (imageBuilder_ != null)) { + return imageBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.cloud.automl.v1.Image) payload_; + } + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example image.
+     * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Image, + com.google.cloud.automl.v1.Image.Builder, + com.google.cloud.automl.v1.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + imageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Image, + com.google.cloud.automl.v1.Image.Builder, + com.google.cloud.automl.v1.ImageOrBuilder>( + (com.google.cloud.automl.v1.Image) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + ; + return imageBuilder_; + } + private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.automl.v1.TextSnippet, com.google.cloud.automl.v1.TextSnippet.Builder, @@ -754,6 +1132,205 @@ public com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder() return textSnippetBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Document, + com.google.cloud.automl.v1.Document.Builder, + com.google.cloud.automl.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public boolean hasDocument() { + return payloadCase_ == 4; + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public com.google.cloud.automl.v1.Document getDocument() { + if (documentBuilder_ == null) { + if (payloadCase_ == 4) { + return (com.google.cloud.automl.v1.Document) payload_; + } + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } else { + if (payloadCase_ == 4) { + return documentBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public Builder setDocument(com.google.cloud.automl.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + payloadCase_ = 4; + return this; + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public Builder setDocument(com.google.cloud.automl.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 4; + return this; + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public Builder mergeDocument(com.google.cloud.automl.v1.Document value) { + if (documentBuilder_ == null) { + if (payloadCase_ == 4 + && payload_ != com.google.cloud.automl.v1.Document.getDefaultInstance()) { + payload_ = + com.google.cloud.automl.v1.Document.newBuilder( + (com.google.cloud.automl.v1.Document) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 4) { + documentBuilder_.mergeFrom(value); + } + documentBuilder_.setMessage(value); + } + payloadCase_ = 4; + return this; + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + } + documentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public com.google.cloud.automl.v1.Document.Builder getDocumentBuilder() { + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + public com.google.cloud.automl.v1.DocumentOrBuilder getDocumentOrBuilder() { + if ((payloadCase_ == 4) && (documentBuilder_ != null)) { + return documentBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 4) { + return (com.google.cloud.automl.v1.Document) payload_; + } + return com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example document.
+     * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Document, + com.google.cloud.automl.v1.Document.Builder, + com.google.cloud.automl.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + if (!(payloadCase_ == 4)) { + payload_ = com.google.cloud.automl.v1.Document.getDefaultInstance(); + } + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.Document, + com.google.cloud.automl.v1.Document.Builder, + com.google.cloud.automl.v1.DocumentOrBuilder>( + (com.google.cloud.automl.v1.Document) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 4; + onChanged(); + ; + return documentBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java index d9f207ac1..f06d50c0d 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExamplePayloadOrBuilder.java @@ -23,6 +23,37 @@ public interface ExamplePayloadOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExamplePayload) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + boolean hasImage(); + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + com.google.cloud.automl.v1.Image getImage(); + /** + * + * + *
+   * Example image.
+   * 
+ * + * .google.cloud.automl.v1.Image image = 1; + */ + com.google.cloud.automl.v1.ImageOrBuilder getImageOrBuilder(); + /** * * @@ -54,5 +85,36 @@ public interface ExamplePayloadOrBuilder */ com.google.cloud.automl.v1.TextSnippetOrBuilder getTextSnippetOrBuilder(); + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + boolean hasDocument(); + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + com.google.cloud.automl.v1.Document getDocument(); + /** + * + * + *
+   * Example document.
+   * 
+ * + * .google.cloud.automl.v1.Document document = 4; + */ + com.google.cloud.automl.v1.DocumentOrBuilder getDocumentOrBuilder(); + public com.google.cloud.automl.v1.ExamplePayload.PayloadCase getPayloadCase(); } diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadata.java new file mode 100644 index 000000000..ca0eca47e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadata.java @@ -0,0 +1,1518 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Details of ExportData operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataOperationMetadata} + */ +public final class ExportDataOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportDataOperationMetadata) + ExportDataOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDataOperationMetadata.newBuilder() to construct. + private ExportDataOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDataOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDataOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder + subBuilder = null; + if (outputInfo_ != null) { + subBuilder = outputInfo_.toBuilder(); + } + outputInfo_ = + input.readMessage( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputInfo_); + outputInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataOperationMetadata.class, + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder.class); + } + + public interface ExportDataOutputInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the exported data is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + java.lang.String getGcsOutputDirectory(); + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the exported data is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + com.google.protobuf.ByteString getGcsOutputDirectoryBytes(); + + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .OutputLocationCase + getOutputLocationCase(); + } + /** + * + * + *
+   * Further describes this export data's output.
+   * Supplements
+   * [OutputConfig][google.cloud.automl.v1.OutputConfig].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} + */ + public static final class ExportDataOutputInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + ExportDataOutputInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDataOutputInfo.newBuilder() to construct. + private ExportDataOutputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDataOutputInfo() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDataOutputInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + outputLocationCase_ = 1; + outputLocation_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.class, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder + .class); + } + + private int outputLocationCase_ = 0; + private java.lang.Object outputLocation_; + + public enum OutputLocationCase implements com.google.protobuf.Internal.EnumLite { + GCS_OUTPUT_DIRECTORY(1), + OUTPUTLOCATION_NOT_SET(0); + private final int value; + + private OutputLocationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static OutputLocationCase valueOf(int value) { + return forNumber(value); + } + + public static OutputLocationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_OUTPUT_DIRECTORY; + case 0: + return OUTPUTLOCATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OutputLocationCase getOutputLocationCase() { + return OutputLocationCase.forNumber(outputLocationCase_); + } + + public static final int GCS_OUTPUT_DIRECTORY_FIELD_NUMBER = 1; + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the exported data is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + 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(); + if (outputLocationCase_ == 1) { + outputLocation_ = s; + } + return s; + } + } + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the exported data is written.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (outputLocationCase_ == 1) { + outputLocation_ = 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 (outputLocationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputLocation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputLocationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputLocation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo other = + (com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) obj; + + if (!getOutputLocationCase().equals(other.getOutputLocationCase())) return false; + switch (outputLocationCase_) { + case 1: + if (!getGcsOutputDirectory().equals(other.getGcsOutputDirectory())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (outputLocationCase_) { + case 1: + hash = (37 * hash) + GCS_OUTPUT_DIRECTORY_FIELD_NUMBER; + hash = (53 * hash) + getGcsOutputDirectory().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo 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; + } + /** + * + * + *
+     * Further describes this export data's output.
+     * Supplements
+     * [OutputConfig][google.cloud.automl.v1.OutputConfig].
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.class, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + outputLocationCase_ = 0; + outputLocation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo build() { + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + buildPartial() { + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo result = + new com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(this); + if (outputLocationCase_ == 1) { + result.outputLocation_ = outputLocation_; + } + result.outputLocationCase_ = outputLocationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) { + return mergeFrom( + (com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo other) { + if (other + == com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .getDefaultInstance()) return this; + switch (other.getOutputLocationCase()) { + case GCS_OUTPUT_DIRECTORY: + { + outputLocationCase_ = 1; + outputLocation_ = other.outputLocation_; + onChanged(); + break; + } + case OUTPUTLOCATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int outputLocationCase_ = 0; + private java.lang.Object outputLocation_; + + public OutputLocationCase getOutputLocationCase() { + return OutputLocationCase.forNumber(outputLocationCase_); + } + + public Builder clearOutputLocation() { + outputLocationCase_ = 0; + outputLocation_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the exported data is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputLocationCase_ == 1) { + outputLocation_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the exported data is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = ""; + if (outputLocationCase_ == 1) { + ref = outputLocation_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (outputLocationCase_ == 1) { + outputLocation_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the exported data is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputLocationCase_ = 1; + outputLocation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the exported data is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder clearGcsOutputDirectory() { + if (outputLocationCase_ == 1) { + outputLocationCase_ = 0; + outputLocation_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the exported data is written.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputLocationCase_ = 1; + outputLocation_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + private static final com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDataOutputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDataOutputInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int OUTPUT_INFO_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo outputInfo_; + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public boolean hasOutputInfo() { + return outputInfo_ != null; + } + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + getOutputInfo() { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .getDefaultInstance() + : outputInfo_; + } + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder + getOutputInfoOrBuilder() { + return getOutputInfo(); + } + + 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 (outputInfo_ != null) { + output.writeMessage(1, getOutputInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOutputInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ExportDataOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportDataOperationMetadata other = + (com.google.cloud.automl.v1.ExportDataOperationMetadata) obj; + + if (hasOutputInfo() != other.hasOutputInfo()) return false; + if (hasOutputInfo()) { + if (!getOutputInfo().equals(other.getOutputInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOutputInfo()) { + hash = (37 * hash) + OUTPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOutputInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata 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.automl.v1.ExportDataOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata 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.automl.v1.ExportDataOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata 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.automl.v1.ExportDataOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata 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.automl.v1.ExportDataOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata 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.automl.v1.ExportDataOperationMetadata 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; + } + /** + * + * + *
+   * Details of ExportData operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportDataOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportDataOperationMetadata) + com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportDataOperationMetadata.class, + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ExportDataOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata build() { + com.google.cloud.automl.v1.ExportDataOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata buildPartial() { + com.google.cloud.automl.v1.ExportDataOperationMetadata result = + new com.google.cloud.automl.v1.ExportDataOperationMetadata(this); + if (outputInfoBuilder_ == null) { + result.outputInfo_ = outputInfo_; + } else { + result.outputInfo_ = outputInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ExportDataOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ExportDataOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ExportDataOperationMetadata other) { + if (other == com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance()) + return this; + if (other.hasOutputInfo()) { + mergeOutputInfo(other.getOutputInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ExportDataOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ExportDataOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo outputInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder> + outputInfoBuilder_; + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public boolean hasOutputInfo() { + return outputInfoBuilder_ != null || outputInfo_ != null; + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + getOutputInfo() { + if (outputInfoBuilder_ == null) { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .getDefaultInstance() + : outputInfo_; + } else { + return outputInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputInfo_ = value; + onChanged(); + } else { + outputInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder + builderForValue) { + if (outputInfoBuilder_ == null) { + outputInfo_ = builderForValue.build(); + onChanged(); + } else { + outputInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public Builder mergeOutputInfo( + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (outputInfo_ != null) { + outputInfo_ = + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .newBuilder(outputInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + outputInfo_ = value; + } + onChanged(); + } else { + outputInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public Builder clearOutputInfo() { + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + onChanged(); + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder + getOutputInfoBuilder() { + + onChanged(); + return getOutputInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder + getOutputInfoOrBuilder() { + if (outputInfoBuilder_ != null) { + return outputInfoBuilder_.getMessageOrBuilder(); + } else { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + .getDefaultInstance() + : outputInfo_; + } + } + /** + * + * + *
+     * Output only. Information further describing this export data's output.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder> + getOutputInfoFieldBuilder() { + if (outputInfoBuilder_ == null) { + outputInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadata + .ExportDataOutputInfoOrBuilder>( + getOutputInfo(), getParentForChildren(), isClean()); + outputInfo_ = null; + } + return outputInfoBuilder_; + } + + @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.automl.v1.ExportDataOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportDataOperationMetadata) + private static final com.google.cloud.automl.v1.ExportDataOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ExportDataOperationMetadata(); + } + + public static com.google.cloud.automl.v1.ExportDataOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDataOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDataOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportDataOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadataOrBuilder.java new file mode 100644 index 000000000..1d0d693c6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportDataOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface ExportDataOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportDataOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + boolean hasOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo getOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing this export data's output.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * + */ + com.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfoOrBuilder + getOutputInfoOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadata.java new file mode 100644 index 000000000..1889cc437 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadata.java @@ -0,0 +1,1441 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Details of ExportModel operation.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportModelOperationMetadata} + */ +public final class ExportModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportModelOperationMetadata) + ExportModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportModelOperationMetadata.newBuilder() to construct. + private ExportModelOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportModelOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportModelOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder + subBuilder = null; + if (outputInfo_ != null) { + subBuilder = outputInfo_.toBuilder(); + } + outputInfo_ = + input.readMessage( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputInfo_); + outputInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelOperationMetadata.class, + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder.class); + } + + public interface ExportModelOutputInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the model will be exported.
+     * 
+ * + * string gcs_output_directory = 1; + */ + java.lang.String getGcsOutputDirectory(); + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the model will be exported.
+     * 
+ * + * string gcs_output_directory = 1; + */ + com.google.protobuf.ByteString getGcsOutputDirectoryBytes(); + } + /** + * + * + *
+   * Further describes the output of model export.
+   * Supplements
+   * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} + */ + public static final class ExportModelOutputInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + ExportModelOutputInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportModelOutputInfo.newBuilder() to construct. + private ExportModelOutputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportModelOutputInfo() { + gcsOutputDirectory_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportModelOutputInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + gcsOutputDirectory_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.class, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder + .class); + } + + public static final int GCS_OUTPUT_DIRECTORY_FIELD_NUMBER = 1; + private volatile java.lang.Object gcsOutputDirectory_; + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the model will be exported.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = gcsOutputDirectory_; + 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(); + gcsOutputDirectory_ = s; + return s; + } + } + /** + * + * + *
+     * The full path of the Google Cloud Storage directory created, into which
+     * the model will be exported.
+     * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = gcsOutputDirectory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsOutputDirectory_ = 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 (!getGcsOutputDirectoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gcsOutputDirectory_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getGcsOutputDirectoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gcsOutputDirectory_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo other = + (com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) obj; + + if (!getGcsOutputDirectory().equals(other.getGcsOutputDirectory())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GCS_OUTPUT_DIRECTORY_FIELD_NUMBER; + hash = (53 * hash) + getGcsOutputDirectory().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo 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; + } + /** + * + * + *
+     * Further describes the output of model export.
+     * Supplements
+     * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].
+     * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.class, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + gcsOutputDirectory_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo build() { + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + buildPartial() { + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo result = + new com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(this); + result.gcsOutputDirectory_ = gcsOutputDirectory_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) { + return mergeFrom( + (com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo other) { + if (other + == com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .getDefaultInstance()) return this; + if (!other.getGcsOutputDirectory().isEmpty()) { + gcsOutputDirectory_ = other.gcsOutputDirectory_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object gcsOutputDirectory_ = ""; + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the model will be exported.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public java.lang.String getGcsOutputDirectory() { + java.lang.Object ref = gcsOutputDirectory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsOutputDirectory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the model will be exported.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public com.google.protobuf.ByteString getGcsOutputDirectoryBytes() { + java.lang.Object ref = gcsOutputDirectory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsOutputDirectory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the model will be exported.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsOutputDirectory_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the model will be exported.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder clearGcsOutputDirectory() { + + gcsOutputDirectory_ = getDefaultInstance().getGcsOutputDirectory(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full path of the Google Cloud Storage directory created, into which
+       * the model will be exported.
+       * 
+ * + * string gcs_output_directory = 1; + */ + public Builder setGcsOutputDirectoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsOutputDirectory_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + private static final com.google.cloud.automl.v1.ExportModelOperationMetadata + .ExportModelOutputInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportModelOutputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportModelOutputInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int OUTPUT_INFO_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo outputInfo_; + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public boolean hasOutputInfo() { + return outputInfo_ != null; + } + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + getOutputInfo() { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .getDefaultInstance() + : outputInfo_; + } + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder + getOutputInfoOrBuilder() { + return getOutputInfo(); + } + + 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 (outputInfo_ != null) { + output.writeMessage(2, getOutputInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ExportModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportModelOperationMetadata other = + (com.google.cloud.automl.v1.ExportModelOperationMetadata) obj; + + if (hasOutputInfo() != other.hasOutputInfo()) return false; + if (hasOutputInfo()) { + if (!getOutputInfo().equals(other.getOutputInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOutputInfo()) { + hash = (37 * hash) + OUTPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOutputInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata 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.automl.v1.ExportModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata 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.automl.v1.ExportModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata 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.automl.v1.ExportModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata 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.automl.v1.ExportModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata 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.automl.v1.ExportModelOperationMetadata 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; + } + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportModelOperationMetadata) + com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelOperationMetadata.class, + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ExportModelOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata build() { + com.google.cloud.automl.v1.ExportModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata buildPartial() { + com.google.cloud.automl.v1.ExportModelOperationMetadata result = + new com.google.cloud.automl.v1.ExportModelOperationMetadata(this); + if (outputInfoBuilder_ == null) { + result.outputInfo_ = outputInfo_; + } else { + result.outputInfo_ = outputInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ExportModelOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ExportModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ExportModelOperationMetadata other) { + if (other == com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance()) + return this; + if (other.hasOutputInfo()) { + mergeOutputInfo(other.getOutputInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ExportModelOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ExportModelOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + outputInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder> + outputInfoBuilder_; + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public boolean hasOutputInfo() { + return outputInfoBuilder_ != null || outputInfo_ != null; + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + getOutputInfo() { + if (outputInfoBuilder_ == null) { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .getDefaultInstance() + : outputInfo_; + } else { + return outputInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputInfo_ = value; + onChanged(); + } else { + outputInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public Builder setOutputInfo( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder + builderForValue) { + if (outputInfoBuilder_ == null) { + outputInfo_ = builderForValue.build(); + onChanged(); + } else { + outputInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public Builder mergeOutputInfo( + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo value) { + if (outputInfoBuilder_ == null) { + if (outputInfo_ != null) { + outputInfo_ = + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .newBuilder(outputInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + outputInfo_ = value; + } + onChanged(); + } else { + outputInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public Builder clearOutputInfo() { + if (outputInfoBuilder_ == null) { + outputInfo_ = null; + onChanged(); + } else { + outputInfo_ = null; + outputInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder + getOutputInfoBuilder() { + + onChanged(); + return getOutputInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder + getOutputInfoOrBuilder() { + if (outputInfoBuilder_ != null) { + return outputInfoBuilder_.getMessageOrBuilder(); + } else { + return outputInfo_ == null + ? com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .getDefaultInstance() + : outputInfo_; + } + } + /** + * + * + *
+     * Output only. Information further describing the output of this model
+     * export.
+     * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder> + getOutputInfoFieldBuilder() { + if (outputInfoBuilder_ == null) { + outputInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + .Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadata + .ExportModelOutputInfoOrBuilder>( + getOutputInfo(), getParentForChildren(), isClean()); + outputInfo_ = null; + } + return outputInfoBuilder_; + } + + @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.automl.v1.ExportModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportModelOperationMetadata) + private static final com.google.cloud.automl.v1.ExportModelOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ExportModelOperationMetadata(); + } + + public static com.google.cloud.automl.v1.ExportModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportModelOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000..c4e610a7c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelOperationMetadataOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface ExportModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportModelOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + boolean hasOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo getOutputInfo(); + /** + * + * + *
+   * Output only. Information further describing the output of this model
+   * export.
+   * 
+ * + * + * .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * + */ + com.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfoOrBuilder + getOutputInfoOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequest.java new file mode 100644 index 000000000..d777a61ca --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequest.java @@ -0,0 +1,883 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Request message for
+ * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models need
+ * to be enabled for exporting, otherwise an error code will be returned.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportModelRequest} + */ +public final class ExportModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ExportModelRequest) + ExportModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportModelRequest.newBuilder() to construct. + private ExportModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: + { + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.automl.v1.ModelExportOutputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelRequest.class, + com.google.cloud.automl.v1.ExportModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the model to export.
+   * 
+ * + * string name = 1; + */ + 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 model to export.
+   * 
+ * + * string name = 1; + */ + 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 OUTPUT_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1.ModelExportOutputConfig outputConfig_; + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.ModelExportOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.automl.v1.ModelExportOutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (outputConfig_ != null) { + output.writeMessage(3, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ExportModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ExportModelRequest other = + (com.google.cloud.automl.v1.ExportModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ExportModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelRequest 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.automl.v1.ExportModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelRequest 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.automl.v1.ExportModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ExportModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ExportModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelRequest 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.automl.v1.ExportModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelRequest 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.automl.v1.ExportModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ExportModelRequest 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.automl.v1.ExportModelRequest 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
+   * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models need
+   * to be enabled for exporting, otherwise an error code will be returned.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ExportModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ExportModelRequest) + com.google.cloud.automl.v1.ExportModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ExportModelRequest.class, + com.google.cloud.automl.v1.ExportModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ExportModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_ExportModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ExportModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelRequest build() { + com.google.cloud.automl.v1.ExportModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelRequest buildPartial() { + com.google.cloud.automl.v1.ExportModelRequest result = + new com.google.cloud.automl.v1.ExportModelRequest(this); + result.name_ = name_; + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ExportModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.ExportModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ExportModelRequest other) { + if (other == com.google.cloud.automl.v1.ExportModelRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ExportModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ExportModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the model to export.
+     * 
+ * + * string name = 1; + */ + 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 model to export.
+     * 
+ * + * string name = 1; + */ + 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 model to export.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the model to export.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the model to export.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.ModelExportOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ModelExportOutputConfig, + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder, + com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.ModelExportOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.automl.v1.ModelExportOutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public Builder setOutputConfig(com.google.cloud.automl.v1.ModelExportOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public Builder setOutputConfig( + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public Builder mergeOutputConfig(com.google.cloud.automl.v1.ModelExportOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.automl.v1.ModelExportOutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.ModelExportOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + public com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.automl.v1.ModelExportOutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The desired output location and configuration.
+     * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ModelExportOutputConfig, + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder, + com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ModelExportOutputConfig, + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder, + com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @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.automl.v1.ExportModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportModelRequest) + private static final com.google.cloud.automl.v1.ExportModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ExportModelRequest(); + } + + public static com.google.cloud.automl.v1.ExportModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportModelRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ExportModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequestOrBuilder.java new file mode 100644 index 000000000..59867996d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ExportModelRequestOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +public interface ExportModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ExportModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the model to export.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the model to export.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + com.google.cloud.automl.v1.ModelExportOutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The desired output location and configuration.
+   * 
+ * + * .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3; + */ + com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java index 39a56bef1..52dae2d4a 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestination.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getOutputUriPrefix() { java.lang.Object ref = outputUriPrefix_; @@ -145,7 +145,7 @@ public java.lang.String getOutputUriPrefix() { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { java.lang.Object ref = outputUriPrefix_; @@ -488,7 +488,7 @@ public Builder mergeFrom( * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getOutputUriPrefix() { java.lang.Object ref = outputUriPrefix_; @@ -513,7 +513,7 @@ public java.lang.String getOutputUriPrefix() { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { java.lang.Object ref = outputUriPrefix_; @@ -538,7 +538,7 @@ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setOutputUriPrefix(java.lang.String value) { if (value == null) { @@ -561,7 +561,7 @@ public Builder setOutputUriPrefix(java.lang.String value) { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearOutputUriPrefix() { @@ -581,7 +581,7 @@ public Builder clearOutputUriPrefix() { * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java index b09adc6b1..41e4c64ab 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsDestinationOrBuilder.java @@ -35,7 +35,7 @@ public interface GcsDestinationOrBuilder * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ java.lang.String getOutputUriPrefix(); /** @@ -50,7 +50,7 @@ public interface GcsDestinationOrBuilder * The directory is created if it doesn't exist. * * - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ com.google.protobuf.ByteString getOutputUriPrefixBytes(); } diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java index 2d1bd829f..b8df91667 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSource.java @@ -118,12 +118,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ProtocolStringList getInputUrisList() { return inputUris_; @@ -132,12 +132,12 @@ public com.google.protobuf.ProtocolStringList getInputUrisList() { * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public int getInputUrisCount() { return inputUris_.size(); @@ -146,12 +146,12 @@ public int getInputUrisCount() { * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getInputUris(int index) { return inputUris_.get(index); @@ -160,12 +160,12 @@ public java.lang.String getInputUris(int index) { * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getInputUrisBytes(int index) { return inputUris_.getByteString(index); @@ -517,12 +517,12 @@ private void ensureInputUrisIsMutable() { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ProtocolStringList getInputUrisList() { return inputUris_.getUnmodifiableView(); @@ -531,12 +531,12 @@ public com.google.protobuf.ProtocolStringList getInputUrisList() { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public int getInputUrisCount() { return inputUris_.size(); @@ -545,12 +545,12 @@ public int getInputUrisCount() { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getInputUris(int index) { return inputUris_.get(index); @@ -559,12 +559,12 @@ public java.lang.String getInputUris(int index) { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getInputUrisBytes(int index) { return inputUris_.getByteString(index); @@ -573,12 +573,12 @@ public com.google.protobuf.ByteString getInputUrisBytes(int index) { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setInputUris(int index, java.lang.String value) { if (value == null) { @@ -593,12 +593,12 @@ public Builder setInputUris(int index, java.lang.String value) { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder addInputUris(java.lang.String value) { if (value == null) { @@ -613,12 +613,12 @@ public Builder addInputUris(java.lang.String value) { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder addAllInputUris(java.lang.Iterable values) { ensureInputUrisIsMutable(); @@ -630,12 +630,12 @@ public Builder addAllInputUris(java.lang.Iterable values) { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearInputUris() { inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; @@ -647,12 +647,12 @@ public Builder clearInputUris() { * * *
-     * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-     * long. Accepted forms:
+     * Required. Google Cloud Storage URIs to input files, up to 2000
+     * characters long. Accepted forms:
      * * Full object path, e.g. gs://bucket/directory/object.csv
      * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java index 9861792ca..627795f4b 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GcsSourceOrBuilder.java @@ -27,48 +27,48 @@ public interface GcsSourceOrBuilder * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ java.util.List getInputUrisList(); /** * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ int getInputUrisCount(); /** * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ java.lang.String getInputUris(int index); /** * * *
-   * Required. Google Cloud Storage URIs to input files, up to 2000 characters
-   * long. Accepted forms:
+   * Required. Google Cloud Storage URIs to input files, up to 2000
+   * characters long. Accepted forms:
    * * Full object path, e.g. gs://bucket/directory/object.csv
    * 
* - * repeated string input_uris = 1; + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; */ com.google.protobuf.ByteString getInputUrisBytes(int index); } diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Geometry.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Geometry.java new file mode 100644 index 000000000..da52994e2 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Geometry.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/geometry.proto + +package com.google.cloud.automl.v1; + +public final class Geometry { + private Geometry() {} + + 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_automl_v1_NormalizedVertex_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_NormalizedVertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BoundingPoly_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BoundingPoly_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/automl/v1/geometry.proto\022" + + "\026google.cloud.automl.v1\032\034google/api/anno" + + "tations.proto\"(\n\020NormalizedVertex\022\t\n\001x\030\001" + + " \001(\002\022\t\n\001y\030\002 \001(\002\"U\n\014BoundingPoly\022E\n\023norma" + + "lized_vertices\030\002 \003(\0132(.google.cloud.auto" + + "ml.v1.NormalizedVertexB\252\001\n\032com.google.cl" + + "oud.automl.v1P\001Z + * Request message for + * [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. + * + * + * Protobuf type {@code google.cloud.automl.v1.GetAnnotationSpecRequest} + */ +public final class GetAnnotationSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.GetAnnotationSpecRequest) + GetAnnotationSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAnnotationSpecRequest.newBuilder() to construct. + private GetAnnotationSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAnnotationSpecRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAnnotationSpecRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetAnnotationSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetAnnotationSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetAnnotationSpecRequest.class, + com.google.cloud.automl.v1.GetAnnotationSpecRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the annotation spec to retrieve.
+   * 
+ * + * string name = 1; + */ + 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 annotation spec to retrieve.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.GetAnnotationSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.GetAnnotationSpecRequest other = + (com.google.cloud.automl.v1.GetAnnotationSpecRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest 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.automl.v1.GetAnnotationSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest 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.automl.v1.GetAnnotationSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest 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.automl.v1.GetAnnotationSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest 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.automl.v1.GetAnnotationSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest 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.automl.v1.GetAnnotationSpecRequest 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
+   * [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.GetAnnotationSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.GetAnnotationSpecRequest) + com.google.cloud.automl.v1.GetAnnotationSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetAnnotationSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetAnnotationSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.GetAnnotationSpecRequest.class, + com.google.cloud.automl.v1.GetAnnotationSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.GetAnnotationSpecRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_GetAnnotationSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetAnnotationSpecRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.GetAnnotationSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetAnnotationSpecRequest build() { + com.google.cloud.automl.v1.GetAnnotationSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetAnnotationSpecRequest buildPartial() { + com.google.cloud.automl.v1.GetAnnotationSpecRequest result = + new com.google.cloud.automl.v1.GetAnnotationSpecRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.GetAnnotationSpecRequest) { + return mergeFrom((com.google.cloud.automl.v1.GetAnnotationSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.GetAnnotationSpecRequest other) { + if (other == com.google.cloud.automl.v1.GetAnnotationSpecRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.GetAnnotationSpecRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.GetAnnotationSpecRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the annotation spec to retrieve.
+     * 
+ * + * string name = 1; + */ + 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 annotation spec to retrieve.
+     * 
+ * + * string name = 1; + */ + 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 annotation spec to retrieve.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the annotation spec to retrieve.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the annotation spec to retrieve.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.GetAnnotationSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetAnnotationSpecRequest) + private static final com.google.cloud.automl.v1.GetAnnotationSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.GetAnnotationSpecRequest(); + } + + public static com.google.cloud.automl.v1.GetAnnotationSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAnnotationSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAnnotationSpecRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.GetAnnotationSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetAnnotationSpecRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetAnnotationSpecRequestOrBuilder.java new file mode 100644 index 000000000..85a246cb5 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/GetAnnotationSpecRequestOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +public interface GetAnnotationSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.GetAnnotationSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the annotation spec to retrieve.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the annotation spec to retrieve.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Image.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Image.java new file mode 100644 index 000000000..f7e96c2ad --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Image.java @@ -0,0 +1,783 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/data_items.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * A representation of an image.
+ * Only images up to 30MB in size are supported.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Image} + */ +public final class Image extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Image() { + thumbnailUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Image( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + dataCase_ = 1; + data_ = input.readBytes(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + thumbnailUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Image.class, com.google.cloud.automl.v1.Image.Builder.class); + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public enum DataCase implements com.google.protobuf.Internal.EnumLite { + IMAGE_BYTES(1), + DATA_NOT_SET(0); + private final int value; + + private DataCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 1: + return IMAGE_BYTES; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public static final int IMAGE_BYTES_FIELD_NUMBER = 1; + /** + * + * + *
+   * Image content represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes image_bytes = 1; + */ + public com.google.protobuf.ByteString getImageBytes() { + if (dataCase_ == 1) { + return (com.google.protobuf.ByteString) data_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int THUMBNAIL_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object thumbnailUri_; + /** + * + * + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + public java.lang.String getThumbnailUri() { + java.lang.Object ref = thumbnailUri_; + 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(); + thumbnailUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + public com.google.protobuf.ByteString getThumbnailUriBytes() { + java.lang.Object ref = thumbnailUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + thumbnailUri_ = 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 (dataCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) data_); + } + if (!getThumbnailUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, thumbnailUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) data_); + } + if (!getThumbnailUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, thumbnailUri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.Image)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.Image other = (com.google.cloud.automl.v1.Image) obj; + + if (!getThumbnailUri().equals(other.getThumbnailUri())) return false; + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 1: + if (!getImageBytes().equals(other.getImageBytes())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + THUMBNAIL_URI_FIELD_NUMBER; + hash = (53 * hash) + getThumbnailUri().hashCode(); + switch (dataCase_) { + case 1: + hash = (37 * hash) + IMAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getImageBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.Image parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Image 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.automl.v1.Image parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Image 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.automl.v1.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.Image parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Image 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.automl.v1.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Image 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.automl.v1.Image parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.Image 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.automl.v1.Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A representation of an image.
+   * Only images up to 30MB in size are supported.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.Image} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Image) + com.google.cloud.automl.v1.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.Image.class, + com.google.cloud.automl.v1.Image.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.Image.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + thumbnailUri_ = ""; + + dataCase_ = 0; + data_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.DataItems + .internal_static_google_cloud_automl_v1_Image_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Image getDefaultInstanceForType() { + return com.google.cloud.automl.v1.Image.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.Image build() { + com.google.cloud.automl.v1.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Image buildPartial() { + com.google.cloud.automl.v1.Image result = new com.google.cloud.automl.v1.Image(this); + if (dataCase_ == 1) { + result.data_ = data_; + } + result.thumbnailUri_ = thumbnailUri_; + result.dataCase_ = dataCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.Image) { + return mergeFrom((com.google.cloud.automl.v1.Image) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.Image other) { + if (other == com.google.cloud.automl.v1.Image.getDefaultInstance()) return this; + if (!other.getThumbnailUri().isEmpty()) { + thumbnailUri_ = other.thumbnailUri_; + onChanged(); + } + switch (other.getDataCase()) { + case IMAGE_BYTES: + { + setImageBytes(other.getImageBytes()); + break; + } + case DATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public com.google.protobuf.ByteString getImageBytes() { + if (dataCase_ == 1) { + return (com.google.protobuf.ByteString) data_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public Builder setImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Image content represented as a stream of bytes.
+     * Note: As with all `bytes` fields, protobuffers use a pure binary
+     * representation, whereas JSON representations use base64.
+     * 
+ * + * bytes image_bytes = 1; + */ + public Builder clearImageBytes() { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + private java.lang.Object thumbnailUri_ = ""; + /** + * + * + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public java.lang.String getThumbnailUri() { + java.lang.Object ref = thumbnailUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + thumbnailUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public com.google.protobuf.ByteString getThumbnailUriBytes() { + java.lang.Object ref = thumbnailUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + thumbnailUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder setThumbnailUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + thumbnailUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder clearThumbnailUri() { + + thumbnailUri_ = getDefaultInstance().getThumbnailUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. HTTP URI to the thumbnail image.
+     * 
+ * + * string thumbnail_uri = 4; + */ + public Builder setThumbnailUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + thumbnailUri_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Image) + private static final com.google.cloud.automl.v1.Image DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Image(); + } + + public static com.google.cloud.automl.v1.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadata.java new file mode 100644 index 000000000..6f346cab3 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadata.java @@ -0,0 +1,591 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Dataset metadata that is specific to image classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationDatasetMetadata} + */ +public final class ImageClassificationDatasetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageClassificationDatasetMetadata) + ImageClassificationDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageClassificationDatasetMetadata.newBuilder() to construct. + private ImageClassificationDatasetMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageClassificationDatasetMetadata() { + classificationType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageClassificationDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.class, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder.class); + } + + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 1; + private int classificationType_; + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, classificationType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, classificationType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageClassificationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata other = + (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) obj; + + if (classificationType_ != other.classificationType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata 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.automl.v1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata 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.automl.v1.ImageClassificationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata 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.automl.v1.ImageClassificationDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata 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.automl.v1.ImageClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata 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.automl.v1.ImageClassificationDatasetMetadata 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; + } + /** + * + * + *
+   * Dataset metadata that is specific to image classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageClassificationDatasetMetadata) + com.google.cloud.automl.v1.ImageClassificationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.class, + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + classificationType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata build() { + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata result = + new com.google.cloud.automl.v1.ImageClassificationDatasetMetadata(this); + result.classificationType_ = classificationType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImageClassificationDatasetMetadata other) { + if (other + == com.google.cloud.automl.v1.ImageClassificationDatasetMetadata.getDefaultInstance()) + return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageClassificationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageClassificationDatasetMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int classificationType_ = 0; + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder setClassificationType(com.google.cloud.automl.v1.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder clearClassificationType() { + + classificationType_ = 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.automl.v1.ImageClassificationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageClassificationDatasetMetadata) + private static final com.google.cloud.automl.v1.ImageClassificationDatasetMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.ImageClassificationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageClassificationDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageClassificationDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadataOrBuilder.java new file mode 100644 index 000000000..2999ab1f8 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationDatasetMetadataOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageClassificationDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageClassificationDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + int getClassificationTypeValue(); + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + com.google.cloud.automl.v1.ClassificationType getClassificationType(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadata.java new file mode 100644 index 000000000..13b65d18f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadata.java @@ -0,0 +1,561 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model deployment metadata specific to Image Classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} + */ +public final class ImageClassificationModelDeploymentMetadata + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + ImageClassificationModelDeploymentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageClassificationModelDeploymentMetadata.newBuilder() to construct. + private ImageClassificationModelDeploymentMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageClassificationModelDeploymentMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageClassificationModelDeploymentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + nodeCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.class, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder.class); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private long nodeCount_; + /** + * + * + *
+   * Input only. The number of nodes to deploy the model on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the model's
+   * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps].
+   * Must be between 1 and 100, inclusive on both ends.
+   * 
+ * + * int64 node_count = 1; + */ + public long getNodeCount() { + return nodeCount_; + } + + 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 (nodeCount_ != 0L) { + output.writeInt64(1, nodeCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, nodeCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata other = + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) obj; + + if (getNodeCount() != other.getNodeCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNodeCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata 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.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata 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.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata 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.automl.v1.ImageClassificationModelDeploymentMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + 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.automl.v1.ImageClassificationModelDeploymentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata 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.automl.v1.ImageClassificationModelDeploymentMetadata 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; + } + /** + * + * + *
+   * Model deployment metadata specific to Image Classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.class, + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + nodeCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata build() { + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata buildPartial() { + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata result = + new com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(this); + result.nodeCount_ = nodeCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) { + return mergeFrom( + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata other) { + if (other + == com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + .getDefaultInstance()) return this; + if (other.getNodeCount() != 0L) { + setNodeCount(other.getNodeCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long nodeCount_; + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public long getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public Builder setNodeCount(long value) { + + nodeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public Builder clearNodeCount() { + + nodeCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + private static final com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageClassificationModelDeploymentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageClassificationModelDeploymentMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadataOrBuilder.java new file mode 100644 index 000000000..a41e8ea0a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelDeploymentMetadataOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageClassificationModelDeploymentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Input only. The number of nodes to deploy the model on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the model's
+   * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps].
+   * Must be between 1 and 100, inclusive on both ends.
+   * 
+ * + * int64 node_count = 1; + */ + long getNodeCount(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadata.java new file mode 100644 index 000000000..90e821d81 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadata.java @@ -0,0 +1,1617 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata for image classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationModelMetadata} + */ +public final class ImageClassificationModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageClassificationModelMetadata) + ImageClassificationModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageClassificationModelMetadata.newBuilder() to construct. + private ImageClassificationModelMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageClassificationModelMetadata() { + baseModelId_ = ""; + stopReason_ = ""; + modelType_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageClassificationModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + baseModelId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + stopReason_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + modelType_ = s; + break; + } + case 105: + { + nodeQps_ = input.readDouble(); + break; + } + case 112: + { + nodeCount_ = input.readInt64(); + break; + } + case 128: + { + trainBudgetMilliNodeHours_ = input.readInt64(); + break; + } + case 136: + { + trainCostMilliNodeHours_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationModelMetadata.class, + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder.class); + } + + public static final int BASE_MODEL_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object baseModelId_; + /** + * + * + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model must be in the same
+   * `project` and `location` as the new model to create, and have the same
+   * `model_type`.
+   * 
+ * + * string base_model_id = 1; + */ + public java.lang.String getBaseModelId() { + java.lang.Object ref = baseModelId_; + 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(); + baseModelId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model must be in the same
+   * `project` and `location` as the new model to create, and have the same
+   * `model_type`.
+   * 
+ * + * string base_model_id = 1; + */ + public com.google.protobuf.ByteString getBaseModelIdBytes() { + java.lang.Object ref = baseModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAIN_BUDGET_MILLI_NODE_HOURS_FIELD_NUMBER = 16; + private long trainBudgetMilliNodeHours_; + /** + * + * + *
+   * The train budget of creating this model, expressed in milli node
+   * hours i.e. 1,000 value in this field means 1 node hour. The actual
+   * `train_cost` will be equal or less than this value. If further model
+   * training ceases to provide any improvements, it will stop without using
+   * full budget and the stop_reason will be `MODEL_CONVERGED`.
+   * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+   * For model type `cloud`(default), the train budget must be between 8,000
+   * and 800,000 milli node hours, inclusive. The default value is 192, 000
+   * which represents one day in wall time. For model type
+   * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`,
+   * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`,
+   * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000
+   * and 100,000 milli node hours, inclusive. The default value is 24, 000 which
+   * represents one day in wall time.
+   * 
+ * + * int64 train_budget_milli_node_hours = 16; + */ + public long getTrainBudgetMilliNodeHours() { + return trainBudgetMilliNodeHours_; + } + + public static final int TRAIN_COST_MILLI_NODE_HOURS_FIELD_NUMBER = 17; + private long trainCostMilliNodeHours_; + /** + * + * + *
+   * Output only. The actual train cost of creating this model, expressed in
+   * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+   * Guaranteed to not exceed the train budget.
+   * 
+ * + * int64 train_cost_milli_node_hours = 17; + */ + public long getTrainCostMilliNodeHours() { + return trainCostMilliNodeHours_; + } + + public static final int STOP_REASON_FIELD_NUMBER = 5; + private volatile java.lang.Object stopReason_; + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + 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(); + stopReason_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_TYPE_FIELD_NUMBER = 7; + private volatile java.lang.Object modelType_; + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud` - Model to be used via prediction calls to AutoML API.
+   *               This is the default value.
+   * *   `mobile-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards. Expected to have low latency, but may have lower
+   *               prediction quality than other models.
+   * *   `mobile-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.
+   * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.  Expected to have a higher latency, but should
+   *               also have a higher prediction quality than other models.
+   * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have low latency, but may have lower prediction quality
+   *               than other models.
+   * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards.
+   * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+   *               providing prediction via AutoML API, can also be exported
+   *               (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have a higher latency, but should also have a higher
+   *               prediction quality than other models.
+   * 
+ * + * string model_type = 7; + */ + public java.lang.String getModelType() { + java.lang.Object ref = modelType_; + 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(); + modelType_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud` - Model to be used via prediction calls to AutoML API.
+   *               This is the default value.
+   * *   `mobile-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards. Expected to have low latency, but may have lower
+   *               prediction quality than other models.
+   * *   `mobile-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.
+   * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.  Expected to have a higher latency, but should
+   *               also have a higher prediction quality than other models.
+   * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have low latency, but may have lower prediction quality
+   *               than other models.
+   * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards.
+   * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+   *               providing prediction via AutoML API, can also be exported
+   *               (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have a higher latency, but should also have a higher
+   *               prediction quality than other models.
+   * 
+ * + * string model_type = 7; + */ + public com.google.protobuf.ByteString getModelTypeBytes() { + java.lang.Object ref = modelType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_QPS_FIELD_NUMBER = 13; + private double nodeQps_; + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 13; + */ + public double getNodeQps() { + return nodeQps_; + } + + public static final int NODE_COUNT_FIELD_NUMBER = 14; + private long nodeCount_; + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the node_qps field.
+   * 
+ * + * int64 node_count = 14; + */ + public long getNodeCount() { + return nodeCount_; + } + + 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 (!getBaseModelIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, baseModelId_); + } + if (!getStopReasonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, stopReason_); + } + if (!getModelTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, modelType_); + } + if (nodeQps_ != 0D) { + output.writeDouble(13, nodeQps_); + } + if (nodeCount_ != 0L) { + output.writeInt64(14, nodeCount_); + } + if (trainBudgetMilliNodeHours_ != 0L) { + output.writeInt64(16, trainBudgetMilliNodeHours_); + } + if (trainCostMilliNodeHours_ != 0L) { + output.writeInt64(17, trainCostMilliNodeHours_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBaseModelIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, baseModelId_); + } + if (!getStopReasonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, stopReason_); + } + if (!getModelTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, modelType_); + } + if (nodeQps_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(13, nodeQps_); + } + if (nodeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(14, nodeCount_); + } + if (trainBudgetMilliNodeHours_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size(16, trainBudgetMilliNodeHours_); + } + if (trainCostMilliNodeHours_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(17, trainCostMilliNodeHours_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageClassificationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageClassificationModelMetadata other = + (com.google.cloud.automl.v1.ImageClassificationModelMetadata) obj; + + if (!getBaseModelId().equals(other.getBaseModelId())) return false; + if (getTrainBudgetMilliNodeHours() != other.getTrainBudgetMilliNodeHours()) return false; + if (getTrainCostMilliNodeHours() != other.getTrainCostMilliNodeHours()) return false; + if (!getStopReason().equals(other.getStopReason())) return false; + if (!getModelType().equals(other.getModelType())) return false; + if (java.lang.Double.doubleToLongBits(getNodeQps()) + != java.lang.Double.doubleToLongBits(other.getNodeQps())) return false; + if (getNodeCount() != other.getNodeCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BASE_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getBaseModelId().hashCode(); + hash = (37 * hash) + TRAIN_BUDGET_MILLI_NODE_HOURS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrainBudgetMilliNodeHours()); + hash = (37 * hash) + TRAIN_COST_MILLI_NODE_HOURS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrainCostMilliNodeHours()); + hash = (37 * hash) + STOP_REASON_FIELD_NUMBER; + hash = (53 * hash) + getStopReason().hashCode(); + hash = (37 * hash) + MODEL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getModelType().hashCode(); + hash = (37 * hash) + NODE_QPS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getNodeQps())); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNodeCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata 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.automl.v1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata 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.automl.v1.ImageClassificationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata 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.automl.v1.ImageClassificationModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata 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.automl.v1.ImageClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata 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.automl.v1.ImageClassificationModelMetadata 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; + } + /** + * + * + *
+   * Model metadata for image classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageClassificationModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageClassificationModelMetadata) + com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageClassificationModelMetadata.class, + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageClassificationModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + baseModelId_ = ""; + + trainBudgetMilliNodeHours_ = 0L; + + trainCostMilliNodeHours_ = 0L; + + stopReason_ = ""; + + modelType_ = ""; + + nodeQps_ = 0D; + + nodeCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelMetadata build() { + com.google.cloud.automl.v1.ImageClassificationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelMetadata buildPartial() { + com.google.cloud.automl.v1.ImageClassificationModelMetadata result = + new com.google.cloud.automl.v1.ImageClassificationModelMetadata(this); + result.baseModelId_ = baseModelId_; + result.trainBudgetMilliNodeHours_ = trainBudgetMilliNodeHours_; + result.trainCostMilliNodeHours_ = trainCostMilliNodeHours_; + result.stopReason_ = stopReason_; + result.modelType_ = modelType_; + result.nodeQps_ = nodeQps_; + result.nodeCount_ = nodeCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageClassificationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ImageClassificationModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImageClassificationModelMetadata other) { + if (other == com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance()) + return this; + if (!other.getBaseModelId().isEmpty()) { + baseModelId_ = other.baseModelId_; + onChanged(); + } + if (other.getTrainBudgetMilliNodeHours() != 0L) { + setTrainBudgetMilliNodeHours(other.getTrainBudgetMilliNodeHours()); + } + if (other.getTrainCostMilliNodeHours() != 0L) { + setTrainCostMilliNodeHours(other.getTrainCostMilliNodeHours()); + } + if (!other.getStopReason().isEmpty()) { + stopReason_ = other.stopReason_; + onChanged(); + } + if (!other.getModelType().isEmpty()) { + modelType_ = other.modelType_; + onChanged(); + } + if (other.getNodeQps() != 0D) { + setNodeQps(other.getNodeQps()); + } + if (other.getNodeCount() != 0L) { + setNodeCount(other.getNodeCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageClassificationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageClassificationModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object baseModelId_ = ""; + /** + * + * + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model must be in the same
+     * `project` and `location` as the new model to create, and have the same
+     * `model_type`.
+     * 
+ * + * string base_model_id = 1; + */ + public java.lang.String getBaseModelId() { + java.lang.Object ref = baseModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model must be in the same
+     * `project` and `location` as the new model to create, and have the same
+     * `model_type`.
+     * 
+ * + * string base_model_id = 1; + */ + public com.google.protobuf.ByteString getBaseModelIdBytes() { + java.lang.Object ref = baseModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model must be in the same
+     * `project` and `location` as the new model to create, and have the same
+     * `model_type`.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder setBaseModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + baseModelId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model must be in the same
+     * `project` and `location` as the new model to create, and have the same
+     * `model_type`.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder clearBaseModelId() { + + baseModelId_ = getDefaultInstance().getBaseModelId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID of the `base` model. If it is specified, the new model
+     * will be created based on the `base` model. Otherwise, the new model will be
+     * created from scratch. The `base` model must be in the same
+     * `project` and `location` as the new model to create, and have the same
+     * `model_type`.
+     * 
+ * + * string base_model_id = 1; + */ + public Builder setBaseModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + baseModelId_ = value; + onChanged(); + return this; + } + + private long trainBudgetMilliNodeHours_; + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud`(default), the train budget must be between 8,000
+     * and 800,000 milli node hours, inclusive. The default value is 192, 000
+     * which represents one day in wall time. For model type
+     * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`,
+     * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`,
+     * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000
+     * and 100,000 milli node hours, inclusive. The default value is 24, 000 which
+     * represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 16; + */ + public long getTrainBudgetMilliNodeHours() { + return trainBudgetMilliNodeHours_; + } + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud`(default), the train budget must be between 8,000
+     * and 800,000 milli node hours, inclusive. The default value is 192, 000
+     * which represents one day in wall time. For model type
+     * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`,
+     * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`,
+     * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000
+     * and 100,000 milli node hours, inclusive. The default value is 24, 000 which
+     * represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 16; + */ + public Builder setTrainBudgetMilliNodeHours(long value) { + + trainBudgetMilliNodeHours_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud`(default), the train budget must be between 8,000
+     * and 800,000 milli node hours, inclusive. The default value is 192, 000
+     * which represents one day in wall time. For model type
+     * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`,
+     * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`,
+     * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000
+     * and 100,000 milli node hours, inclusive. The default value is 24, 000 which
+     * represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 16; + */ + public Builder clearTrainBudgetMilliNodeHours() { + + trainBudgetMilliNodeHours_ = 0L; + onChanged(); + return this; + } + + private long trainCostMilliNodeHours_; + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 17; + */ + public long getTrainCostMilliNodeHours() { + return trainCostMilliNodeHours_; + } + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 17; + */ + public Builder setTrainCostMilliNodeHours(long value) { + + trainCostMilliNodeHours_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 17; + */ + public Builder clearTrainCostMilliNodeHours() { + + trainCostMilliNodeHours_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stopReason_ = ""; + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + stopReason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder clearStopReason() { + + stopReason_ = getDefaultInstance().getStopReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stopReason_ = value; + onChanged(); + return this; + } + + private java.lang.Object modelType_ = ""; + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud` - Model to be used via prediction calls to AutoML API.
+     *               This is the default value.
+     * *   `mobile-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards. Expected to have low latency, but may have lower
+     *               prediction quality than other models.
+     * *   `mobile-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.
+     * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.  Expected to have a higher latency, but should
+     *               also have a higher prediction quality than other models.
+     * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have low latency, but may have lower prediction quality
+     *               than other models.
+     * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards.
+     * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+     *               providing prediction via AutoML API, can also be exported
+     *               (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have a higher latency, but should also have a higher
+     *               prediction quality than other models.
+     * 
+ * + * string model_type = 7; + */ + public java.lang.String getModelType() { + java.lang.Object ref = modelType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud` - Model to be used via prediction calls to AutoML API.
+     *               This is the default value.
+     * *   `mobile-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards. Expected to have low latency, but may have lower
+     *               prediction quality than other models.
+     * *   `mobile-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.
+     * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.  Expected to have a higher latency, but should
+     *               also have a higher prediction quality than other models.
+     * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have low latency, but may have lower prediction quality
+     *               than other models.
+     * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards.
+     * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+     *               providing prediction via AutoML API, can also be exported
+     *               (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have a higher latency, but should also have a higher
+     *               prediction quality than other models.
+     * 
+ * + * string model_type = 7; + */ + public com.google.protobuf.ByteString getModelTypeBytes() { + java.lang.Object ref = modelType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud` - Model to be used via prediction calls to AutoML API.
+     *               This is the default value.
+     * *   `mobile-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards. Expected to have low latency, but may have lower
+     *               prediction quality than other models.
+     * *   `mobile-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.
+     * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.  Expected to have a higher latency, but should
+     *               also have a higher prediction quality than other models.
+     * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have low latency, but may have lower prediction quality
+     *               than other models.
+     * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards.
+     * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+     *               providing prediction via AutoML API, can also be exported
+     *               (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have a higher latency, but should also have a higher
+     *               prediction quality than other models.
+     * 
+ * + * string model_type = 7; + */ + public Builder setModelType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + modelType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud` - Model to be used via prediction calls to AutoML API.
+     *               This is the default value.
+     * *   `mobile-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards. Expected to have low latency, but may have lower
+     *               prediction quality than other models.
+     * *   `mobile-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.
+     * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.  Expected to have a higher latency, but should
+     *               also have a higher prediction quality than other models.
+     * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have low latency, but may have lower prediction quality
+     *               than other models.
+     * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards.
+     * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+     *               providing prediction via AutoML API, can also be exported
+     *               (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have a higher latency, but should also have a higher
+     *               prediction quality than other models.
+     * 
+ * + * string model_type = 7; + */ + public Builder clearModelType() { + + modelType_ = getDefaultInstance().getModelType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud` - Model to be used via prediction calls to AutoML API.
+     *               This is the default value.
+     * *   `mobile-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards. Expected to have low latency, but may have lower
+     *               prediction quality than other models.
+     * *   `mobile-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.
+     * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile or edge device with TensorFlow
+     *               afterwards.  Expected to have a higher latency, but should
+     *               also have a higher prediction quality than other models.
+     * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have low latency, but may have lower prediction quality
+     *               than other models.
+     * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+     *               prediction via AutoML API, can also be exported (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards.
+     * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+     *               providing prediction via AutoML API, can also be exported
+     *               (see
+     *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+     *               and used on a mobile device with Core ML afterwards. Expected
+     *               to have a higher latency, but should also have a higher
+     *               prediction quality than other models.
+     * 
+ * + * string model_type = 7; + */ + public Builder setModelTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + modelType_ = value; + onChanged(); + return this; + } + + private double nodeQps_; + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public double getNodeQps() { + return nodeQps_; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public Builder setNodeQps(double value) { + + nodeQps_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public Builder clearNodeQps() { + + nodeQps_ = 0D; + onChanged(); + return this; + } + + private long nodeCount_; + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public long getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public Builder setNodeCount(long value) { + + nodeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public Builder clearNodeCount() { + + nodeCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImageClassificationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageClassificationModelMetadata) + private static final com.google.cloud.automl.v1.ImageClassificationModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageClassificationModelMetadata(); + } + + public static com.google.cloud.automl.v1.ImageClassificationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageClassificationModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageClassificationModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageClassificationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadataOrBuilder.java new file mode 100644 index 000000000..81604a289 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageClassificationModelMetadataOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageClassificationModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageClassificationModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model must be in the same
+   * `project` and `location` as the new model to create, and have the same
+   * `model_type`.
+   * 
+ * + * string base_model_id = 1; + */ + java.lang.String getBaseModelId(); + /** + * + * + *
+   * Optional. The ID of the `base` model. If it is specified, the new model
+   * will be created based on the `base` model. Otherwise, the new model will be
+   * created from scratch. The `base` model must be in the same
+   * `project` and `location` as the new model to create, and have the same
+   * `model_type`.
+   * 
+ * + * string base_model_id = 1; + */ + com.google.protobuf.ByteString getBaseModelIdBytes(); + + /** + * + * + *
+   * The train budget of creating this model, expressed in milli node
+   * hours i.e. 1,000 value in this field means 1 node hour. The actual
+   * `train_cost` will be equal or less than this value. If further model
+   * training ceases to provide any improvements, it will stop without using
+   * full budget and the stop_reason will be `MODEL_CONVERGED`.
+   * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+   * For model type `cloud`(default), the train budget must be between 8,000
+   * and 800,000 milli node hours, inclusive. The default value is 192, 000
+   * which represents one day in wall time. For model type
+   * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`,
+   * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`,
+   * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000
+   * and 100,000 milli node hours, inclusive. The default value is 24, 000 which
+   * represents one day in wall time.
+   * 
+ * + * int64 train_budget_milli_node_hours = 16; + */ + long getTrainBudgetMilliNodeHours(); + + /** + * + * + *
+   * Output only. The actual train cost of creating this model, expressed in
+   * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+   * Guaranteed to not exceed the train budget.
+   * 
+ * + * int64 train_cost_milli_node_hours = 17; + */ + long getTrainCostMilliNodeHours(); + + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + java.lang.String getStopReason(); + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + com.google.protobuf.ByteString getStopReasonBytes(); + + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud` - Model to be used via prediction calls to AutoML API.
+   *               This is the default value.
+   * *   `mobile-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards. Expected to have low latency, but may have lower
+   *               prediction quality than other models.
+   * *   `mobile-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.
+   * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.  Expected to have a higher latency, but should
+   *               also have a higher prediction quality than other models.
+   * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have low latency, but may have lower prediction quality
+   *               than other models.
+   * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards.
+   * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+   *               providing prediction via AutoML API, can also be exported
+   *               (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have a higher latency, but should also have a higher
+   *               prediction quality than other models.
+   * 
+ * + * string model_type = 7; + */ + java.lang.String getModelType(); + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud` - Model to be used via prediction calls to AutoML API.
+   *               This is the default value.
+   * *   `mobile-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards. Expected to have low latency, but may have lower
+   *               prediction quality than other models.
+   * *   `mobile-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.
+   * *   `mobile-high-accuracy-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile or edge device with TensorFlow
+   *               afterwards.  Expected to have a higher latency, but should
+   *               also have a higher prediction quality than other models.
+   * *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have low latency, but may have lower prediction quality
+   *               than other models.
+   * *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
+   *               prediction via AutoML API, can also be exported (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards.
+   * *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
+   *               providing prediction via AutoML API, can also be exported
+   *               (see
+   *               [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel])
+   *               and used on a mobile device with Core ML afterwards. Expected
+   *               to have a higher latency, but should also have a higher
+   *               prediction quality than other models.
+   * 
+ * + * string model_type = 7; + */ + com.google.protobuf.ByteString getModelTypeBytes(); + + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 13; + */ + double getNodeQps(); + + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the node_qps field.
+   * 
+ * + * int64 node_count = 14; + */ + long getNodeCount(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotation.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotation.java new file mode 100644 index 000000000..4b807178c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotation.java @@ -0,0 +1,803 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Annotation details for image object detection.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionAnnotation} + */ +public final class ImageObjectDetectionAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageObjectDetectionAnnotation) + ImageObjectDetectionAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageObjectDetectionAnnotation.newBuilder() to construct. + private ImageObjectDetectionAnnotation( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageObjectDetectionAnnotation() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageObjectDetectionAnnotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.BoundingPoly.Builder subBuilder = null; + if (boundingBox_ != null) { + subBuilder = boundingBox_.toBuilder(); + } + boundingBox_ = + input.readMessage( + com.google.cloud.automl.v1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingBox_); + boundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 21: + { + score_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.class, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder.class); + } + + public static final int BOUNDING_BOX_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1.BoundingPoly boundingBox_; + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public boolean hasBoundingBox() { + return boundingBox_ != null; + } + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public com.google.cloud.automl.v1.BoundingPoly getBoundingBox() { + return boundingBox_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingBox_; + } + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + return getBoundingBox(); + } + + public static final int SCORE_FIELD_NUMBER = 2; + private float score_; + /** + * + * + *
+   * Output only. The confidence that this annotation is positive for the parent
+   * example, value in [0, 1], higher means higher positivity confidence.
+   * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + + 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 (boundingBox_ != null) { + output.writeMessage(1, getBoundingBox()); + } + if (score_ != 0F) { + output.writeFloat(2, score_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (boundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBoundingBox()); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageObjectDetectionAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation other = + (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) obj; + + if (hasBoundingBox() != other.hasBoundingBox()) return false; + if (hasBoundingBox()) { + if (!getBoundingBox().equals(other.getBoundingBox())) return false; + } + if (java.lang.Float.floatToIntBits(getScore()) + != java.lang.Float.floatToIntBits(other.getScore())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBoundingBox()) { + hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBox().hashCode(); + } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation 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.automl.v1.ImageObjectDetectionAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation 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.automl.v1.ImageObjectDetectionAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation 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.automl.v1.ImageObjectDetectionAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation 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.automl.v1.ImageObjectDetectionAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation 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.automl.v1.ImageObjectDetectionAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Annotation details for image object detection.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageObjectDetectionAnnotation) + com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.class, + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + score_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation build() { + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation buildPartial() { + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation result = + new com.google.cloud.automl.v1.ImageObjectDetectionAnnotation(this); + if (boundingBoxBuilder_ == null) { + result.boundingBox_ = boundingBox_; + } else { + result.boundingBox_ = boundingBoxBuilder_.build(); + } + result.score_ = score_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) { + return mergeFrom((com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImageObjectDetectionAnnotation other) { + if (other == com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance()) + return this; + if (other.hasBoundingBox()) { + mergeBoundingBox(other.getBoundingBox()); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageObjectDetectionAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1.BoundingPoly boundingBox_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder> + boundingBoxBuilder_; + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public boolean hasBoundingBox() { + return boundingBoxBuilder_ != null || boundingBox_ != null; + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public com.google.cloud.automl.v1.BoundingPoly getBoundingBox() { + if (boundingBoxBuilder_ == null) { + return boundingBox_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingBox_; + } else { + return boundingBoxBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public Builder setBoundingBox(com.google.cloud.automl.v1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingBox_ = value; + onChanged(); + } else { + boundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public Builder setBoundingBox(com.google.cloud.automl.v1.BoundingPoly.Builder builderForValue) { + if (boundingBoxBuilder_ == null) { + boundingBox_ = builderForValue.build(); + onChanged(); + } else { + boundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public Builder mergeBoundingBox(com.google.cloud.automl.v1.BoundingPoly value) { + if (boundingBoxBuilder_ == null) { + if (boundingBox_ != null) { + boundingBox_ = + com.google.cloud.automl.v1.BoundingPoly.newBuilder(boundingBox_) + .mergeFrom(value) + .buildPartial(); + } else { + boundingBox_ = value; + } + onChanged(); + } else { + boundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public Builder clearBoundingBox() { + if (boundingBoxBuilder_ == null) { + boundingBox_ = null; + onChanged(); + } else { + boundingBox_ = null; + boundingBoxBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public com.google.cloud.automl.v1.BoundingPoly.Builder getBoundingBoxBuilder() { + + onChanged(); + return getBoundingBoxFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { + if (boundingBoxBuilder_ != null) { + return boundingBoxBuilder_.getMessageOrBuilder(); + } else { + return boundingBox_ == null + ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() + : boundingBox_; + } + } + /** + * + * + *
+     * Output only. The rectangle representing the object location.
+     * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder> + getBoundingBoxFieldBuilder() { + if (boundingBoxBuilder_ == null) { + boundingBoxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BoundingPoly, + com.google.cloud.automl.v1.BoundingPoly.Builder, + com.google.cloud.automl.v1.BoundingPolyOrBuilder>( + getBoundingBox(), getParentForChildren(), isClean()); + boundingBox_ = null; + } + return boundingBoxBuilder_; + } + + private float score_; + /** + * + * + *
+     * Output only. The confidence that this annotation is positive for the parent
+     * example, value in [0, 1], higher means higher positivity confidence.
+     * 
+ * + * float score = 2; + */ + public float getScore() { + return score_; + } + /** + * + * + *
+     * Output only. The confidence that this annotation is positive for the parent
+     * example, value in [0, 1], higher means higher positivity confidence.
+     * 
+ * + * float score = 2; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The confidence that this annotation is positive for the parent
+     * example, value in [0, 1], higher means higher positivity confidence.
+     * 
+ * + * float score = 2; + */ + public Builder clearScore() { + + score_ = 0F; + 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.automl.v1.ImageObjectDetectionAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageObjectDetectionAnnotation) + private static final com.google.cloud.automl.v1.ImageObjectDetectionAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageObjectDetectionAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageObjectDetectionAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotationOrBuilder.java new file mode 100644 index 000000000..6371c72ea --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionAnnotationOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +public interface ImageObjectDetectionAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageObjectDetectionAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + boolean hasBoundingBox(); + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + com.google.cloud.automl.v1.BoundingPoly getBoundingBox(); + /** + * + * + *
+   * Output only. The rectangle representing the object location.
+   * 
+ * + * .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingBoxOrBuilder(); + + /** + * + * + *
+   * Output only. The confidence that this annotation is positive for the parent
+   * example, value in [0, 1], higher means higher positivity confidence.
+   * 
+ * + * float score = 2; + */ + float getScore(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadata.java new file mode 100644 index 000000000..1312a80f9 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Dataset metadata specific to image object detection.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} + */ +public final class ImageObjectDetectionDatasetMetadata + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + ImageObjectDetectionDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageObjectDetectionDatasetMetadata.newBuilder() to construct. + private ImageObjectDetectionDatasetMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageObjectDetectionDatasetMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageObjectDetectionDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata other = + (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata 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.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata 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.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata 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.automl.v1.ImageObjectDetectionDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata 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.automl.v1.ImageObjectDetectionDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata 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.automl.v1.ImageObjectDetectionDatasetMetadata 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; + } + /** + * + * + *
+   * Dataset metadata specific to image object detection.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata build() { + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata result = + new com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata other) { + if (other + == com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + private static final com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageObjectDetectionDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageObjectDetectionDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadataOrBuilder.java new file mode 100644 index 000000000..31f81e547 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionDatasetMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageObjectDetectionDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetrics.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetrics.java new file mode 100644 index 000000000..209f74b65 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetrics.java @@ -0,0 +1,1264 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model evaluation metrics for image object detection problems.
+ * Evaluates prediction quality of labeled bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} + */ +public final class ImageObjectDetectionEvaluationMetrics + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + ImageObjectDetectionEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageObjectDetectionEvaluationMetrics.newBuilder() to construct. + private ImageObjectDetectionEvaluationMetrics( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageObjectDetectionEvaluationMetrics() { + boundingBoxMetricsEntries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageObjectDetectionEvaluationMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + evaluatedBoundingBoxCount_ = input.readInt32(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + boundingBoxMetricsEntries_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + boundingBoxMetricsEntries_.add( + input.readMessage( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.parser(), + extensionRegistry)); + break; + } + case 29: + { + boundingBoxMeanAveragePrecision_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + boundingBoxMetricsEntries_ = + java.util.Collections.unmodifiableList(boundingBoxMetricsEntries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.class, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder.class); + } + + private int bitField0_; + public static final int EVALUATED_BOUNDING_BOX_COUNT_FIELD_NUMBER = 1; + private int evaluatedBoundingBoxCount_; + /** + * + * + *
+   * Output only. The total number of bounding boxes (i.e. summed over all
+   * images) the ground truth used to create this evaluation had.
+   * 
+ * + * int32 evaluated_bounding_box_count = 1; + */ + public int getEvaluatedBoundingBoxCount() { + return evaluatedBoundingBoxCount_; + } + + public static final int BOUNDING_BOX_METRICS_ENTRIES_FIELD_NUMBER = 2; + private java.util.List + boundingBoxMetricsEntries_; + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public java.util.List + getBoundingBoxMetricsEntriesList() { + return boundingBoxMetricsEntries_; + } + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public java.util.List + getBoundingBoxMetricsEntriesOrBuilderList() { + return boundingBoxMetricsEntries_; + } + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public int getBoundingBoxMetricsEntriesCount() { + return boundingBoxMetricsEntries_.size(); + } + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry getBoundingBoxMetricsEntries( + int index) { + return boundingBoxMetricsEntries_.get(index); + } + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder + getBoundingBoxMetricsEntriesOrBuilder(int index) { + return boundingBoxMetricsEntries_.get(index); + } + + public static final int BOUNDING_BOX_MEAN_AVERAGE_PRECISION_FIELD_NUMBER = 3; + private float boundingBoxMeanAveragePrecision_; + /** + * + * + *
+   * Output only. The single metric for bounding boxes evaluation:
+   * the mean_average_precision averaged over all bounding_box_metrics_entries.
+   * 
+ * + * float bounding_box_mean_average_precision = 3; + */ + public float getBoundingBoxMeanAveragePrecision() { + return boundingBoxMeanAveragePrecision_; + } + + 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 (evaluatedBoundingBoxCount_ != 0) { + output.writeInt32(1, evaluatedBoundingBoxCount_); + } + for (int i = 0; i < boundingBoxMetricsEntries_.size(); i++) { + output.writeMessage(2, boundingBoxMetricsEntries_.get(i)); + } + if (boundingBoxMeanAveragePrecision_ != 0F) { + output.writeFloat(3, boundingBoxMeanAveragePrecision_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (evaluatedBoundingBoxCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, evaluatedBoundingBoxCount_); + } + for (int i = 0; i < boundingBoxMetricsEntries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, boundingBoxMetricsEntries_.get(i)); + } + if (boundingBoxMeanAveragePrecision_ != 0F) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 3, boundingBoxMeanAveragePrecision_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics other = + (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) obj; + + if (getEvaluatedBoundingBoxCount() != other.getEvaluatedBoundingBoxCount()) return false; + if (!getBoundingBoxMetricsEntriesList().equals(other.getBoundingBoxMetricsEntriesList())) + return false; + if (java.lang.Float.floatToIntBits(getBoundingBoxMeanAveragePrecision()) + != java.lang.Float.floatToIntBits(other.getBoundingBoxMeanAveragePrecision())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EVALUATED_BOUNDING_BOX_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getEvaluatedBoundingBoxCount(); + if (getBoundingBoxMetricsEntriesCount() > 0) { + hash = (37 * hash) + BOUNDING_BOX_METRICS_ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getBoundingBoxMetricsEntriesList().hashCode(); + } + hash = (37 * hash) + BOUNDING_BOX_MEAN_AVERAGE_PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoundingBoxMeanAveragePrecision()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics 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.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics 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.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics 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.automl.v1.ImageObjectDetectionEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics 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.automl.v1.ImageObjectDetectionEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics 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.automl.v1.ImageObjectDetectionEvaluationMetrics 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; + } + /** + * + * + *
+   * Model evaluation metrics for image object detection problems.
+   * Evaluates prediction quality of labeled bounding boxes.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.class, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBoundingBoxMetricsEntriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + evaluatedBoundingBoxCount_ = 0; + + if (boundingBoxMetricsEntriesBuilder_ == null) { + boundingBoxMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + boundingBoxMetricsEntriesBuilder_.clear(); + } + boundingBoxMeanAveragePrecision_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Detection + .internal_static_google_cloud_automl_v1_ImageObjectDetectionEvaluationMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics build() { + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics result = + new com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.evaluatedBoundingBoxCount_ = evaluatedBoundingBoxCount_; + if (boundingBoxMetricsEntriesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + boundingBoxMetricsEntries_ = + java.util.Collections.unmodifiableList(boundingBoxMetricsEntries_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.boundingBoxMetricsEntries_ = boundingBoxMetricsEntries_; + } else { + result.boundingBoxMetricsEntries_ = boundingBoxMetricsEntriesBuilder_.build(); + } + result.boundingBoxMeanAveragePrecision_ = boundingBoxMeanAveragePrecision_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics other) { + if (other + == com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.getDefaultInstance()) + return this; + if (other.getEvaluatedBoundingBoxCount() != 0) { + setEvaluatedBoundingBoxCount(other.getEvaluatedBoundingBoxCount()); + } + if (boundingBoxMetricsEntriesBuilder_ == null) { + if (!other.boundingBoxMetricsEntries_.isEmpty()) { + if (boundingBoxMetricsEntries_.isEmpty()) { + boundingBoxMetricsEntries_ = other.boundingBoxMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.addAll(other.boundingBoxMetricsEntries_); + } + onChanged(); + } + } else { + if (!other.boundingBoxMetricsEntries_.isEmpty()) { + if (boundingBoxMetricsEntriesBuilder_.isEmpty()) { + boundingBoxMetricsEntriesBuilder_.dispose(); + boundingBoxMetricsEntriesBuilder_ = null; + boundingBoxMetricsEntries_ = other.boundingBoxMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000002); + boundingBoxMetricsEntriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBoundingBoxMetricsEntriesFieldBuilder() + : null; + } else { + boundingBoxMetricsEntriesBuilder_.addAllMessages(other.boundingBoxMetricsEntries_); + } + } + } + if (other.getBoundingBoxMeanAveragePrecision() != 0F) { + setBoundingBoxMeanAveragePrecision(other.getBoundingBoxMeanAveragePrecision()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int evaluatedBoundingBoxCount_; + /** + * + * + *
+     * Output only. The total number of bounding boxes (i.e. summed over all
+     * images) the ground truth used to create this evaluation had.
+     * 
+ * + * int32 evaluated_bounding_box_count = 1; + */ + public int getEvaluatedBoundingBoxCount() { + return evaluatedBoundingBoxCount_; + } + /** + * + * + *
+     * Output only. The total number of bounding boxes (i.e. summed over all
+     * images) the ground truth used to create this evaluation had.
+     * 
+ * + * int32 evaluated_bounding_box_count = 1; + */ + public Builder setEvaluatedBoundingBoxCount(int value) { + + evaluatedBoundingBoxCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The total number of bounding boxes (i.e. summed over all
+     * images) the ground truth used to create this evaluation had.
+     * 
+ * + * int32 evaluated_bounding_box_count = 1; + */ + public Builder clearEvaluatedBoundingBoxCount() { + + evaluatedBoundingBoxCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + boundingBoxMetricsEntries_ = java.util.Collections.emptyList(); + + private void ensureBoundingBoxMetricsEntriesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + boundingBoxMetricsEntries_ = + new java.util.ArrayList( + boundingBoxMetricsEntries_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder> + boundingBoxMetricsEntriesBuilder_; + + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public java.util.List + getBoundingBoxMetricsEntriesList() { + if (boundingBoxMetricsEntriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(boundingBoxMetricsEntries_); + } else { + return boundingBoxMetricsEntriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public int getBoundingBoxMetricsEntriesCount() { + if (boundingBoxMetricsEntriesBuilder_ == null) { + return boundingBoxMetricsEntries_.size(); + } else { + return boundingBoxMetricsEntriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry getBoundingBoxMetricsEntries( + int index) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + return boundingBoxMetricsEntries_.get(index); + } else { + return boundingBoxMetricsEntriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder setBoundingBoxMetricsEntries( + int index, com.google.cloud.automl.v1.BoundingBoxMetricsEntry value) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.set(index, value); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder setBoundingBoxMetricsEntries( + int index, com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder builderForValue) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.set(index, builderForValue.build()); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder addBoundingBoxMetricsEntries( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry value) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.add(value); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder addBoundingBoxMetricsEntries( + int index, com.google.cloud.automl.v1.BoundingBoxMetricsEntry value) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.add(index, value); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder addBoundingBoxMetricsEntries( + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder builderForValue) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.add(builderForValue.build()); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder addBoundingBoxMetricsEntries( + int index, com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder builderForValue) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.add(index, builderForValue.build()); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder addAllBoundingBoxMetricsEntries( + java.lang.Iterable values) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + ensureBoundingBoxMetricsEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, boundingBoxMetricsEntries_); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder clearBoundingBoxMetricsEntries() { + if (boundingBoxMetricsEntriesBuilder_ == null) { + boundingBoxMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public Builder removeBoundingBoxMetricsEntries(int index) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + ensureBoundingBoxMetricsEntriesIsMutable(); + boundingBoxMetricsEntries_.remove(index); + onChanged(); + } else { + boundingBoxMetricsEntriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder + getBoundingBoxMetricsEntriesBuilder(int index) { + return getBoundingBoxMetricsEntriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder + getBoundingBoxMetricsEntriesOrBuilder(int index) { + if (boundingBoxMetricsEntriesBuilder_ == null) { + return boundingBoxMetricsEntries_.get(index); + } else { + return boundingBoxMetricsEntriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public java.util.List + getBoundingBoxMetricsEntriesOrBuilderList() { + if (boundingBoxMetricsEntriesBuilder_ != null) { + return boundingBoxMetricsEntriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(boundingBoxMetricsEntries_); + } + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder + addBoundingBoxMetricsEntriesBuilder() { + return getBoundingBoxMetricsEntriesFieldBuilder() + .addBuilder(com.google.cloud.automl.v1.BoundingBoxMetricsEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder + addBoundingBoxMetricsEntriesBuilder(int index) { + return getBoundingBoxMetricsEntriesFieldBuilder() + .addBuilder( + index, com.google.cloud.automl.v1.BoundingBoxMetricsEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The bounding boxes match metrics for each
+     * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+     * pair.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + public java.util.List + getBoundingBoxMetricsEntriesBuilderList() { + return getBoundingBoxMetricsEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder> + getBoundingBoxMetricsEntriesFieldBuilder() { + if (boundingBoxMetricsEntriesBuilder_ == null) { + boundingBoxMetricsEntriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.BoundingBoxMetricsEntry, + com.google.cloud.automl.v1.BoundingBoxMetricsEntry.Builder, + com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder>( + boundingBoxMetricsEntries_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + boundingBoxMetricsEntries_ = null; + } + return boundingBoxMetricsEntriesBuilder_; + } + + private float boundingBoxMeanAveragePrecision_; + /** + * + * + *
+     * Output only. The single metric for bounding boxes evaluation:
+     * the mean_average_precision averaged over all bounding_box_metrics_entries.
+     * 
+ * + * float bounding_box_mean_average_precision = 3; + */ + public float getBoundingBoxMeanAveragePrecision() { + return boundingBoxMeanAveragePrecision_; + } + /** + * + * + *
+     * Output only. The single metric for bounding boxes evaluation:
+     * the mean_average_precision averaged over all bounding_box_metrics_entries.
+     * 
+ * + * float bounding_box_mean_average_precision = 3; + */ + public Builder setBoundingBoxMeanAveragePrecision(float value) { + + boundingBoxMeanAveragePrecision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The single metric for bounding boxes evaluation:
+     * the mean_average_precision averaged over all bounding_box_metrics_entries.
+     * 
+ * + * float bounding_box_mean_average_precision = 3; + */ + public Builder clearBoundingBoxMeanAveragePrecision() { + + boundingBoxMeanAveragePrecision_ = 0F; + 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.automl.v1.ImageObjectDetectionEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + private static final com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageObjectDetectionEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageObjectDetectionEvaluationMetrics(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetricsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000..d0690505a --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionEvaluationMetricsOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/detection.proto + +package com.google.cloud.automl.v1; + +public interface ImageObjectDetectionEvaluationMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The total number of bounding boxes (i.e. summed over all
+   * images) the ground truth used to create this evaluation had.
+   * 
+ * + * int32 evaluated_bounding_box_count = 1; + */ + int getEvaluatedBoundingBoxCount(); + + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + java.util.List + getBoundingBoxMetricsEntriesList(); + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + com.google.cloud.automl.v1.BoundingBoxMetricsEntry getBoundingBoxMetricsEntries(int index); + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + int getBoundingBoxMetricsEntriesCount(); + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + java.util.List + getBoundingBoxMetricsEntriesOrBuilderList(); + /** + * + * + *
+   * Output only. The bounding boxes match metrics for each
+   * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
+   * pair.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * + */ + com.google.cloud.automl.v1.BoundingBoxMetricsEntryOrBuilder getBoundingBoxMetricsEntriesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The single metric for bounding boxes evaluation:
+   * the mean_average_precision averaged over all bounding_box_metrics_entries.
+   * 
+ * + * float bounding_box_mean_average_precision = 3; + */ + float getBoundingBoxMeanAveragePrecision(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadata.java new file mode 100644 index 000000000..cfe337f12 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadata.java @@ -0,0 +1,563 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model deployment metadata specific to Image Object Detection.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} + */ +public final class ImageObjectDetectionModelDeploymentMetadata + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + ImageObjectDetectionModelDeploymentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageObjectDetectionModelDeploymentMetadata.newBuilder() to construct. + private ImageObjectDetectionModelDeploymentMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageObjectDetectionModelDeploymentMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageObjectDetectionModelDeploymentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + nodeCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder.class); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private long nodeCount_; + /** + * + * + *
+   * Input only. The number of nodes to deploy the model on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the model's
+   * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node].
+   * Must be between 1 and 100, inclusive on both ends.
+   * 
+ * + * int64 node_count = 1; + */ + public long getNodeCount() { + return nodeCount_; + } + + 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 (nodeCount_ != 0L) { + output.writeInt64(1, nodeCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, nodeCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata other = + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) obj; + + if (getNodeCount() != other.getNodeCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNodeCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata 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; + } + /** + * + * + *
+   * Model deployment metadata specific to Image Object Detection.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + nodeCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata build() { + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata buildPartial() { + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata result = + new com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(this); + result.nodeCount_ = nodeCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) { + return mergeFrom( + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata other) { + if (other + == com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + .getDefaultInstance()) return this; + if (other.getNodeCount() != 0L) { + setNodeCount(other.getNodeCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long nodeCount_; + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public long getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public Builder setNodeCount(long value) { + + nodeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. The number of nodes to deploy the model on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the model's
+     * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node].
+     * Must be between 1 and 100, inclusive on both ends.
+     * 
+ * + * int64 node_count = 1; + */ + public Builder clearNodeCount() { + + nodeCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + private static final com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageObjectDetectionModelDeploymentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageObjectDetectionModelDeploymentMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadataOrBuilder.java new file mode 100644 index 000000000..06887e249 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelDeploymentMetadataOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageObjectDetectionModelDeploymentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Input only. The number of nodes to deploy the model on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the model's
+   * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node].
+   * Must be between 1 and 100, inclusive on both ends.
+   * 
+ * + * int64 node_count = 1; + */ + long getNodeCount(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadata.java new file mode 100644 index 000000000..b7557784d --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadata.java @@ -0,0 +1,1231 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata specific to image object detection.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionModelMetadata} + */ +public final class ImageObjectDetectionModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + ImageObjectDetectionModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageObjectDetectionModelMetadata.newBuilder() to construct. + private ImageObjectDetectionModelMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageObjectDetectionModelMetadata() { + modelType_ = ""; + stopReason_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImageObjectDetectionModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + modelType_ = s; + break; + } + case 24: + { + nodeCount_ = input.readInt64(); + break; + } + case 33: + { + nodeQps_ = input.readDouble(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + stopReason_ = s; + break; + } + case 48: + { + trainBudgetMilliNodeHours_ = input.readInt64(); + break; + } + case 56: + { + trainCostMilliNodeHours_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder.class); + } + + public static final int MODEL_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object modelType_; + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+   *               calls to AutoML API. Expected to have a higher latency, but
+   *               should also have a higher prediction quality than other
+   *               models.
+   * *   `cloud-low-latency-1` -  A model to be used via prediction
+   *               calls to AutoML API. Expected to have low latency, but may
+   *               have lower prediction quality than other models.
+   * 
+ * + * string model_type = 1; + */ + public java.lang.String getModelType() { + java.lang.Object ref = modelType_; + 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(); + modelType_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+   *               calls to AutoML API. Expected to have a higher latency, but
+   *               should also have a higher prediction quality than other
+   *               models.
+   * *   `cloud-low-latency-1` -  A model to be used via prediction
+   *               calls to AutoML API. Expected to have low latency, but may
+   *               have lower prediction quality than other models.
+   * 
+ * + * string model_type = 1; + */ + public com.google.protobuf.ByteString getModelTypeBytes() { + java.lang.Object ref = modelType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_COUNT_FIELD_NUMBER = 3; + private long nodeCount_; + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the qps_per_node field.
+   * 
+ * + * int64 node_count = 3; + */ + public long getNodeCount() { + return nodeCount_; + } + + public static final int NODE_QPS_FIELD_NUMBER = 4; + private double nodeQps_; + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 4; + */ + public double getNodeQps() { + return nodeQps_; + } + + public static final int STOP_REASON_FIELD_NUMBER = 5; + private volatile java.lang.Object stopReason_; + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + 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(); + stopReason_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAIN_BUDGET_MILLI_NODE_HOURS_FIELD_NUMBER = 6; + private long trainBudgetMilliNodeHours_; + /** + * + * + *
+   * The train budget of creating this model, expressed in milli node
+   * hours i.e. 1,000 value in this field means 1 node hour. The actual
+   * `train_cost` will be equal or less than this value. If further model
+   * training ceases to provide any improvements, it will stop without using
+   * full budget and the stop_reason will be `MODEL_CONVERGED`.
+   * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+   * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
+   * the train budget must be between 20,000 and 900,000 milli node hours,
+   * inclusive. The default value is 216, 000 which represents one day in
+   * wall time.
+   * For model type `mobile-low-latency-1`, `mobile-versatile-1`,
+   * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
+   * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
+   * budget must be between 1,000 and 100,000 milli node hours, inclusive.
+   * The default value is 24, 000 which represents one day in wall time.
+   * 
+ * + * int64 train_budget_milli_node_hours = 6; + */ + public long getTrainBudgetMilliNodeHours() { + return trainBudgetMilliNodeHours_; + } + + public static final int TRAIN_COST_MILLI_NODE_HOURS_FIELD_NUMBER = 7; + private long trainCostMilliNodeHours_; + /** + * + * + *
+   * Output only. The actual train cost of creating this model, expressed in
+   * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+   * Guaranteed to not exceed the train budget.
+   * 
+ * + * int64 train_cost_milli_node_hours = 7; + */ + public long getTrainCostMilliNodeHours() { + return trainCostMilliNodeHours_; + } + + 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 (!getModelTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, modelType_); + } + if (nodeCount_ != 0L) { + output.writeInt64(3, nodeCount_); + } + if (nodeQps_ != 0D) { + output.writeDouble(4, nodeQps_); + } + if (!getStopReasonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, stopReason_); + } + if (trainBudgetMilliNodeHours_ != 0L) { + output.writeInt64(6, trainBudgetMilliNodeHours_); + } + if (trainCostMilliNodeHours_ != 0L) { + output.writeInt64(7, trainCostMilliNodeHours_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getModelTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, modelType_); + } + if (nodeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, nodeCount_); + } + if (nodeQps_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, nodeQps_); + } + if (!getStopReasonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, stopReason_); + } + if (trainBudgetMilliNodeHours_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, trainBudgetMilliNodeHours_); + } + if (trainCostMilliNodeHours_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, trainCostMilliNodeHours_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata other = + (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) obj; + + if (!getModelType().equals(other.getModelType())) return false; + if (getNodeCount() != other.getNodeCount()) return false; + if (java.lang.Double.doubleToLongBits(getNodeQps()) + != java.lang.Double.doubleToLongBits(other.getNodeQps())) return false; + if (!getStopReason().equals(other.getStopReason())) return false; + if (getTrainBudgetMilliNodeHours() != other.getTrainBudgetMilliNodeHours()) return false; + if (getTrainCostMilliNodeHours() != other.getTrainCostMilliNodeHours()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODEL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getModelType().hashCode(); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNodeCount()); + hash = (37 * hash) + NODE_QPS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getNodeQps())); + hash = (37 * hash) + STOP_REASON_FIELD_NUMBER; + hash = (53 * hash) + getStopReason().hashCode(); + hash = (37 * hash) + TRAIN_BUDGET_MILLI_NODE_HOURS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrainBudgetMilliNodeHours()); + hash = (37 * hash) + TRAIN_COST_MILLI_NODE_HOURS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrainCostMilliNodeHours()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata 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.automl.v1.ImageObjectDetectionModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata 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.automl.v1.ImageObjectDetectionModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata 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.automl.v1.ImageObjectDetectionModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata 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.automl.v1.ImageObjectDetectionModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata 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.automl.v1.ImageObjectDetectionModelMetadata 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; + } + /** + * + * + *
+   * Model metadata specific to image object detection.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImageObjectDetectionModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.class, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + modelType_ = ""; + + nodeCount_ = 0L; + + nodeQps_ = 0D; + + stopReason_ = ""; + + trainBudgetMilliNodeHours_ = 0L; + + trainCostMilliNodeHours_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.ImageProto + .internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata build() { + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata buildPartial() { + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata result = + new com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(this); + result.modelType_ = modelType_; + result.nodeCount_ = nodeCount_; + result.nodeQps_ = nodeQps_; + result.stopReason_ = stopReason_; + result.trainBudgetMilliNodeHours_ = trainBudgetMilliNodeHours_; + result.trainCostMilliNodeHours_ = trainCostMilliNodeHours_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata other) { + if (other + == com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance()) + return this; + if (!other.getModelType().isEmpty()) { + modelType_ = other.modelType_; + onChanged(); + } + if (other.getNodeCount() != 0L) { + setNodeCount(other.getNodeCount()); + } + if (other.getNodeQps() != 0D) { + setNodeQps(other.getNodeQps()); + } + if (!other.getStopReason().isEmpty()) { + stopReason_ = other.stopReason_; + onChanged(); + } + if (other.getTrainBudgetMilliNodeHours() != 0L) { + setTrainBudgetMilliNodeHours(other.getTrainBudgetMilliNodeHours()); + } + if (other.getTrainCostMilliNodeHours() != 0L) { + setTrainCostMilliNodeHours(other.getTrainCostMilliNodeHours()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object modelType_ = ""; + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+     *               calls to AutoML API. Expected to have a higher latency, but
+     *               should also have a higher prediction quality than other
+     *               models.
+     * *   `cloud-low-latency-1` -  A model to be used via prediction
+     *               calls to AutoML API. Expected to have low latency, but may
+     *               have lower prediction quality than other models.
+     * 
+ * + * string model_type = 1; + */ + public java.lang.String getModelType() { + java.lang.Object ref = modelType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+     *               calls to AutoML API. Expected to have a higher latency, but
+     *               should also have a higher prediction quality than other
+     *               models.
+     * *   `cloud-low-latency-1` -  A model to be used via prediction
+     *               calls to AutoML API. Expected to have low latency, but may
+     *               have lower prediction quality than other models.
+     * 
+ * + * string model_type = 1; + */ + public com.google.protobuf.ByteString getModelTypeBytes() { + java.lang.Object ref = modelType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+     *               calls to AutoML API. Expected to have a higher latency, but
+     *               should also have a higher prediction quality than other
+     *               models.
+     * *   `cloud-low-latency-1` -  A model to be used via prediction
+     *               calls to AutoML API. Expected to have low latency, but may
+     *               have lower prediction quality than other models.
+     * 
+ * + * string model_type = 1; + */ + public Builder setModelType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + modelType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+     *               calls to AutoML API. Expected to have a higher latency, but
+     *               should also have a higher prediction quality than other
+     *               models.
+     * *   `cloud-low-latency-1` -  A model to be used via prediction
+     *               calls to AutoML API. Expected to have low latency, but may
+     *               have lower prediction quality than other models.
+     * 
+ * + * string model_type = 1; + */ + public Builder clearModelType() { + + modelType_ = getDefaultInstance().getModelType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of the model. The available values are:
+     * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+     *               calls to AutoML API. Expected to have a higher latency, but
+     *               should also have a higher prediction quality than other
+     *               models.
+     * *   `cloud-low-latency-1` -  A model to be used via prediction
+     *               calls to AutoML API. Expected to have low latency, but may
+     *               have lower prediction quality than other models.
+     * 
+ * + * string model_type = 1; + */ + public Builder setModelTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + modelType_ = value; + onChanged(); + return this; + } + + private long nodeCount_; + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the qps_per_node field.
+     * 
+ * + * int64 node_count = 3; + */ + public long getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the qps_per_node field.
+     * 
+ * + * int64 node_count = 3; + */ + public Builder setNodeCount(long value) { + + nodeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the qps_per_node field.
+     * 
+ * + * int64 node_count = 3; + */ + public Builder clearNodeCount() { + + nodeCount_ = 0L; + onChanged(); + return this; + } + + private double nodeQps_; + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 4; + */ + public double getNodeQps() { + return nodeQps_; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 4; + */ + public Builder setNodeQps(double value) { + + nodeQps_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 4; + */ + public Builder clearNodeQps() { + + nodeQps_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object stopReason_ = ""; + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public java.lang.String getStopReason() { + java.lang.Object ref = stopReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public com.google.protobuf.ByteString getStopReasonBytes() { + java.lang.Object ref = stopReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + stopReason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder clearStopReason() { + + stopReason_ = getDefaultInstance().getStopReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason that this create model operation stopped,
+     * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+     * 
+ * + * string stop_reason = 5; + */ + public Builder setStopReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stopReason_ = value; + onChanged(); + return this; + } + + private long trainBudgetMilliNodeHours_; + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
+     * the train budget must be between 20,000 and 900,000 milli node hours,
+     * inclusive. The default value is 216, 000 which represents one day in
+     * wall time.
+     * For model type `mobile-low-latency-1`, `mobile-versatile-1`,
+     * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
+     * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
+     * budget must be between 1,000 and 100,000 milli node hours, inclusive.
+     * The default value is 24, 000 which represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 6; + */ + public long getTrainBudgetMilliNodeHours() { + return trainBudgetMilliNodeHours_; + } + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
+     * the train budget must be between 20,000 and 900,000 milli node hours,
+     * inclusive. The default value is 216, 000 which represents one day in
+     * wall time.
+     * For model type `mobile-low-latency-1`, `mobile-versatile-1`,
+     * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
+     * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
+     * budget must be between 1,000 and 100,000 milli node hours, inclusive.
+     * The default value is 24, 000 which represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 6; + */ + public Builder setTrainBudgetMilliNodeHours(long value) { + + trainBudgetMilliNodeHours_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The train budget of creating this model, expressed in milli node
+     * hours i.e. 1,000 value in this field means 1 node hour. The actual
+     * `train_cost` will be equal or less than this value. If further model
+     * training ceases to provide any improvements, it will stop without using
+     * full budget and the stop_reason will be `MODEL_CONVERGED`.
+     * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+     * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
+     * the train budget must be between 20,000 and 900,000 milli node hours,
+     * inclusive. The default value is 216, 000 which represents one day in
+     * wall time.
+     * For model type `mobile-low-latency-1`, `mobile-versatile-1`,
+     * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
+     * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
+     * budget must be between 1,000 and 100,000 milli node hours, inclusive.
+     * The default value is 24, 000 which represents one day in wall time.
+     * 
+ * + * int64 train_budget_milli_node_hours = 6; + */ + public Builder clearTrainBudgetMilliNodeHours() { + + trainBudgetMilliNodeHours_ = 0L; + onChanged(); + return this; + } + + private long trainCostMilliNodeHours_; + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 7; + */ + public long getTrainCostMilliNodeHours() { + return trainCostMilliNodeHours_; + } + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 7; + */ + public Builder setTrainCostMilliNodeHours(long value) { + + trainCostMilliNodeHours_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The actual train cost of creating this model, expressed in
+     * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+     * Guaranteed to not exceed the train budget.
+     * 
+ * + * int64 train_cost_milli_node_hours = 7; + */ + public Builder clearTrainCostMilliNodeHours() { + + trainCostMilliNodeHours_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + private static final com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + } + + public static com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageObjectDetectionModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImageObjectDetectionModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadataOrBuilder.java new file mode 100644 index 000000000..de8903792 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageObjectDetectionModelMetadataOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public interface ImageObjectDetectionModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+   *               calls to AutoML API. Expected to have a higher latency, but
+   *               should also have a higher prediction quality than other
+   *               models.
+   * *   `cloud-low-latency-1` -  A model to be used via prediction
+   *               calls to AutoML API. Expected to have low latency, but may
+   *               have lower prediction quality than other models.
+   * 
+ * + * string model_type = 1; + */ + java.lang.String getModelType(); + /** + * + * + *
+   * Optional. Type of the model. The available values are:
+   * *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
+   *               calls to AutoML API. Expected to have a higher latency, but
+   *               should also have a higher prediction quality than other
+   *               models.
+   * *   `cloud-low-latency-1` -  A model to be used via prediction
+   *               calls to AutoML API. Expected to have low latency, but may
+   *               have lower prediction quality than other models.
+   * 
+ * + * string model_type = 1; + */ + com.google.protobuf.ByteString getModelTypeBytes(); + + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the qps_per_node field.
+   * 
+ * + * int64 node_count = 3; + */ + long getNodeCount(); + + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 4; + */ + double getNodeQps(); + + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + java.lang.String getStopReason(); + /** + * + * + *
+   * Output only. The reason that this create model operation stopped,
+   * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
+   * 
+ * + * string stop_reason = 5; + */ + com.google.protobuf.ByteString getStopReasonBytes(); + + /** + * + * + *
+   * The train budget of creating this model, expressed in milli node
+   * hours i.e. 1,000 value in this field means 1 node hour. The actual
+   * `train_cost` will be equal or less than this value. If further model
+   * training ceases to provide any improvements, it will stop without using
+   * full budget and the stop_reason will be `MODEL_CONVERGED`.
+   * Note, node_hour  = actual_hour * number_of_nodes_invovled.
+   * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
+   * the train budget must be between 20,000 and 900,000 milli node hours,
+   * inclusive. The default value is 216, 000 which represents one day in
+   * wall time.
+   * For model type `mobile-low-latency-1`, `mobile-versatile-1`,
+   * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
+   * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
+   * budget must be between 1,000 and 100,000 milli node hours, inclusive.
+   * The default value is 24, 000 which represents one day in wall time.
+   * 
+ * + * int64 train_budget_milli_node_hours = 6; + */ + long getTrainBudgetMilliNodeHours(); + + /** + * + * + *
+   * Output only. The actual train cost of creating this model, expressed in
+   * milli node hours, i.e. 1,000 value in this field means 1 node hour.
+   * Guaranteed to not exceed the train budget.
+   * 
+ * + * int64 train_cost_milli_node_hours = 7; + */ + long getTrainCostMilliNodeHours(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageOrBuilder.java new file mode 100644 index 000000000..094a2bf3e --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/data_items.proto + +package com.google.cloud.automl.v1; + +public interface ImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Image) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Image content represented as a stream of bytes.
+   * Note: As with all `bytes` fields, protobuffers use a pure binary
+   * representation, whereas JSON representations use base64.
+   * 
+ * + * bytes image_bytes = 1; + */ + com.google.protobuf.ByteString getImageBytes(); + + /** + * + * + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + java.lang.String getThumbnailUri(); + /** + * + * + *
+   * Output only. HTTP URI to the thumbnail image.
+   * 
+ * + * string thumbnail_uri = 4; + */ + com.google.protobuf.ByteString getThumbnailUriBytes(); + + public com.google.cloud.automl.v1.Image.DataCase getDataCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageProto.java new file mode 100644 index 000000000..376950cd6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImageProto.java @@ -0,0 +1,176 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/image.proto + +package com.google.cloud.automl.v1; + +public final class ImageProto { + private ImageProto() {} + + 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_automl_v1_ImageClassificationDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageClassificationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageObjectDetectionDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageClassificationModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageObjectDetectionModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageClassificationModelDeploymentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImageObjectDetectionModelDeploymentMetadata_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/automl/v1/image.proto\022\026go" + + "ogle.cloud.automl.v1\032\034google/api/annotat" + + "ions.proto\032\031google/api/resource.proto\032,g" + + "oogle/cloud/automl/v1/annotation_spec.pr" + + "oto\032+google/cloud/automl/v1/classificati" + + "on.proto\032\037google/protobuf/timestamp.prot" + + "o\"m\n\"ImageClassificationDatasetMetadata\022" + + "G\n\023classification_type\030\001 \001(\0162*.google.cl" + + "oud.automl.v1.ClassificationType\"%\n#Imag" + + "eObjectDetectionDatasetMetadata\"\324\001\n Imag" + + "eClassificationModelMetadata\022\025\n\rbase_mod" + + "el_id\030\001 \001(\t\022%\n\035train_budget_milli_node_h" + + "ours\030\020 \001(\003\022#\n\033train_cost_milli_node_hour" + + "s\030\021 \001(\003\022\023\n\013stop_reason\030\005 \001(\t\022\022\n\nmodel_ty" + + "pe\030\007 \001(\t\022\020\n\010node_qps\030\r \001(\001\022\022\n\nnode_count" + + "\030\016 \001(\003\"\276\001\n!ImageObjectDetectionModelMeta" + + "data\022\022\n\nmodel_type\030\001 \001(\t\022\022\n\nnode_count\030\003" + + " \001(\003\022\020\n\010node_qps\030\004 \001(\001\022\023\n\013stop_reason\030\005 " + + "\001(\t\022%\n\035train_budget_milli_node_hours\030\006 \001" + + "(\003\022#\n\033train_cost_milli_node_hours\030\007 \001(\003\"" + + "@\n*ImageClassificationModelDeploymentMet" + + "adata\022\022\n\nnode_count\030\001 \001(\003\"A\n+ImageObject" + + "DetectionModelDeploymentMetadata\022\022\n\nnode" + + "_count\030\001 \001(\003B\266\001\n\032com.google.cloud.automl" + + ".v1B\nImageProtoP\001Z + * Details of ImportData operation. + * + * + * Protobuf type {@code google.cloud.automl.v1.ImportDataOperationMetadata} + */ +public final class ImportDataOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ImportDataOperationMetadata) + ImportDataOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDataOperationMetadata.newBuilder() to construct. + private ImportDataOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDataOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportDataOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImportDataOperationMetadata.class, + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ImportDataOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ImportDataOperationMetadata other = + (com.google.cloud.automl.v1.ImportDataOperationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata 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.automl.v1.ImportDataOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata 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.automl.v1.ImportDataOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata 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.automl.v1.ImportDataOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata 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.automl.v1.ImportDataOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata 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.automl.v1.ImportDataOperationMetadata 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; + } + /** + * + * + *
+   * Details of ImportData operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ImportDataOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ImportDataOperationMetadata) + com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ImportDataOperationMetadata.class, + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ImportDataOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataOperationMetadata build() { + com.google.cloud.automl.v1.ImportDataOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataOperationMetadata buildPartial() { + com.google.cloud.automl.v1.ImportDataOperationMetadata result = + new com.google.cloud.automl.v1.ImportDataOperationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ImportDataOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.ImportDataOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ImportDataOperationMetadata other) { + if (other == com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ImportDataOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ImportDataOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ImportDataOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImportDataOperationMetadata) + private static final com.google.cloud.automl.v1.ImportDataOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ImportDataOperationMetadata(); + } + + public static com.google.cloud.automl.v1.ImportDataOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDataOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportDataOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ImportDataOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataOperationMetadataOrBuilder.java new file mode 100644 index 000000000..dcd416ce1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ImportDataOperationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface ImportDataOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ImportDataOperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java index 76b8f0b50..49a558be7 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfig.java @@ -22,18 +22,353 @@ * * *
- * Input configuration for ImportData Action.
+ * Input configuration for
+ * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action.
  * The format of input depends on dataset_metadata the Dataset into which
  * the import is happening has. As input source the
- * [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source]
+ * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source]
  * is expected, unless specified otherwise. Additionally any input .CSV file
  * by itself must be 100MB or smaller, unless specified otherwise.
  * If an "example" file (that is, image, video etc.) with identical content
- * (even if it had different GCS_FILE_PATH) is mentioned multiple times, then
+ * (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then
  * its label, bounding boxes etc. are appended. The same file should be always
- * provided with the same ML_USE and GCS_FILE_PATH, if it is not, then
+ * provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then
  * these values are nondeterministically selected from the given ones.
- *  Errors:
+ * The formats are represented in EBNF with commas being literal and with
+ * non-terminal symbols defined near the end of this comment. The formats are:
+ * <h4>AutoML Vision</h4>
+ * <div class="ds-selector-tabs"><section><h5>Classification</h5>
+ * See [Preparing your training
+ * data](https://cloud.google.com/vision/automl/docs/prepare) for more
+ * information.
+ * CSV file(s) with each line in format:
+ *     ML_USE,GCS_FILE_PATH,LABEL,LABEL,...
+ * *   `ML_USE` - Identifies the data set that the current row (file) applies
+ * to.
+ *     This value can be one of the following:
+ *     * `TRAIN` - Rows in this file are used to train the model.
+ *     * `TEST` - Rows in this file are used to test the model during training.
+ *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+ *        Automatically divided into train and test data. 80% for training and
+ *        20% for testing.
+ * *   `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to
+ *      30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP,
+ *      .TIFF, .ICO.
+ * *   `LABEL` - A label that identifies the object in the image.
+ * For the `MULTICLASS` classification type, at most one `LABEL` is allowed
+ * per image. If an image has not yet been labeled, then it should be
+ * mentioned just once with no `LABEL`.
+ * Some sample rows:
+ *     TRAIN,gs://folder/image1.jpg,daisy
+ *     TEST,gs://folder/image2.jpg,dandelion,tulip,rose
+ *     UNASSIGNED,gs://folder/image3.jpg,daisy
+ *     UNASSIGNED,gs://folder/image4.jpg
+ * </section><section><h5>Object Detection</h5>
+ * See [Preparing your training
+ * data](https://cloud.google.com/vision/automl/object-detection/docs/prepare)
+ * for more information.
+ * A CSV file(s) with each line in format:
+ *     ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,)
+ * *   `ML_USE` - Identifies the data set that the current row (file) applies
+ * to.
+ *     This value can be one of the following:
+ *     * `TRAIN` - Rows in this file are used to train the model.
+ *     * `TEST` - Rows in this file are used to test the model during training.
+ *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+ *        Automatically divided into train and test data. 80% for training and
+ *        20% for testing.
+ * *  `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to
+ *     30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image
+ *     is assumed to be exhaustively labeled.
+ * *  `LABEL` - A label that identifies the object in the image specified by the
+ *    `BOUNDING_BOX`.
+ * *  `BOUNDING BOX` - The vertices of an object in the example image.
+ *    The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than
+ *    500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX`
+ *    per line). If an image has no looked for objects then it should be
+ *    mentioned just once with no LABEL and the ",,,,,,," in place of the
+ *   `BOUNDING_BOX`.
+ * **Four sample rows:**
+ *     TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,,
+ *     TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,,
+ *     UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3
+ *     TEST,gs://folder/im3.png,,,,,,,,,
+ *   </section>
+ * </div>
+ * <h4>AutoML Natural Language</h4>
+ * <div class="ds-selector-tabs"><section><h5>Entity Extraction</h5>
+ * See [Preparing your training
+ * data](/natural-language/automl/entity-analysis/docs/prepare) for more
+ * information.
+ * One or more CSV file(s) with each line in the following format:
+ *     ML_USE,GCS_FILE_PATH
+ * *   `ML_USE` - Identifies the data set that the current row (file) applies
+ * to.
+ *     This value can be one of the following:
+ *     * `TRAIN` - Rows in this file are used to train the model.
+ *     * `TEST` - Rows in this file are used to test the model during training.
+ *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+ *        Automatically divided into train and test data. 80% for training and
+ *        20% for testing..
+ * *   `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in
+ *      Google Cloud Storage that contains in-line text in-line as documents
+ *      for model training.
+ * After the training data set has been determined from the `TRAIN` and
+ * `UNASSIGNED` CSV files, the training data is divided into train and
+ * validation data sets. 70% for training and 30% for validation.
+ * For example:
+ *     TRAIN,gs://folder/file1.jsonl
+ *     VALIDATE,gs://folder/file2.jsonl
+ *     TEST,gs://folder/file3.jsonl
+ * **In-line JSONL files**
+ * In-line .JSONL files contain, per line, a JSON document that wraps a
+ * [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by
+ * one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload]
+ * fields, which have `display_name` and `text_extraction` fields to describe
+ * the entity from the text snippet. Multiple JSON documents can be separated
+ * using line breaks (\n).
+ * The supplied text must be annotated exhaustively. For example, if you
+ * include the text "horse", but do not label it as "animal",
+ * then "horse" is assumed to not be an "animal".
+ * Any given text snippet content must have 30,000 characters or
+ * less, and also be UTF-8 NFC encoded. ASCII is accepted as it is
+ * UTF-8 NFC encoded.
+ * For example:
+ *     {
+ *       "text_snippet": {
+ *         "content": "dog car cat"
+ *       },
+ *       "annotations": [
+ *          {
+ *            "display_name": "animal",
+ *            "text_extraction": {
+ *              "text_segment": {"start_offset": 0, "end_offset": 2}
+ *           }
+ *          },
+ *          {
+ *           "display_name": "vehicle",
+ *            "text_extraction": {
+ *              "text_segment": {"start_offset": 4, "end_offset": 6}
+ *            }
+ *          },
+ *          {
+ *            "display_name": "animal",
+ *            "text_extraction": {
+ *              "text_segment": {"start_offset": 8, "end_offset": 10}
+ *            }
+ *          }
+ *      ]
+ *     }\n
+ *     {
+ *        "text_snippet": {
+ *          "content": "This dog is good."
+ *        },
+ *        "annotations": [
+ *           {
+ *             "display_name": "animal",
+ *             "text_extraction": {
+ *               "text_segment": {"start_offset": 5, "end_offset": 7}
+ *             }
+ *           }
+ *        ]
+ *     }
+ * **JSONL files that reference documents**
+ * .JSONL files contain, per line, a JSON document that wraps a
+ * `input_config` that contains the path to a source PDF document.
+ * Multiple JSON documents can be separated using line breaks (\n).
+ * For example:
+ *     {
+ *       "document": {
+ *         "input_config": {
+ *           "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ]
+ *           }
+ *         }
+ *       }
+ *     }\n
+ *     {
+ *       "document": {
+ *         "input_config": {
+ *           "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ]
+ *           }
+ *         }
+ *       }
+ *     }
+ * **In-line JSONL files with PDF layout information**
+ * **Note:** You can only annotate PDF files using the UI. The format described
+ * below applies to annotated PDF files exported using the UI or `exportData`.
+ * In-line .JSONL files for PDF documents contain, per line, a JSON document
+ * that wraps a `document` field that provides the textual content of the PDF
+ * document and the layout information.
+ * For example:
+ *     {
+ *       "document": {
+ *               "document_text": {
+ *                 "content": "dog car cat"
+ *               }
+ *               "layout": [
+ *                 {
+ *                   "text_segment": {
+ *                     "start_offset": 0,
+ *                     "end_offset": 11,
+ *                    },
+ *                    "page_number": 1,
+ *                    "bounding_poly": {
+ *                       "normalized_vertices": [
+ *                         {"x": 0.1, "y": 0.1},
+ *                         {"x": 0.1, "y": 0.3},
+ *                         {"x": 0.3, "y": 0.3},
+ *                         {"x": 0.3, "y": 0.1},
+ *                       ],
+ *                     },
+ *                     "text_segment_type": TOKEN,
+ *                 }
+ *               ],
+ *               "document_dimensions": {
+ *                 "width": 8.27,
+ *                 "height": 11.69,
+ *                 "unit": INCH,
+ *               }
+ *               "page_count": 3,
+ *             },
+ *             "annotations": [
+ *               {
+ *                 "display_name": "animal",
+ *                 "text_extraction": {
+ *                   "text_segment": {"start_offset": 0, "end_offset": 3}
+ *                 }
+ *               },
+ *               {
+ *                 "display_name": "vehicle",
+ *                 "text_extraction": {
+ *                   "text_segment": {"start_offset": 4, "end_offset": 7}
+ *                 }
+ *               },
+ *               {
+ *                 "display_name": "animal",
+ *                 "text_extraction": {
+ *                   "text_segment": {"start_offset": 8, "end_offset": 11}
+ *                 }
+ *               },
+ *             ],
+ * </section><section><h5>Classification</h5>
+ * See [Preparing your training
+ * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more
+ * information.
+ * One or more CSV file(s) with each line in the following format:
+ *     ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,...
+ * *   `ML_USE` - Identifies the data set that the current row (file) applies
+ * to.
+ *     This value can be one of the following:
+ *     * `TRAIN` - Rows in this file are used to train the model.
+ *     * `TEST` - Rows in this file are used to test the model during training.
+ *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+ *        Automatically divided into train and test data. 80% for training and
+ *        20% for testing.
+ * *   `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If
+ *     the column content is a valid Google Cloud Storage file path, that is,
+ *     prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if
+ *     the content is enclosed in double quotes (""), it is treated as a
+ *     `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a
+ *     file with supported extension and UTF-8 encoding, for example,
+ *     "gs://folder/content.txt" AutoML imports the file content
+ *     as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content
+ *     excluding quotes. In both cases, size of the content must be 10MB or
+ *     less in size. For zip files, the size of each file inside the zip must be
+ *     10MB or less in size.
+ *     For the `MULTICLASS` classification type, at most one `LABEL` is allowed.
+ *     The `ML_USE` and `LABEL` columns are optional.
+ *     Supported file extensions: .TXT, .PDF, .ZIP
+ * A maximum of 100 unique labels are allowed per CSV row.
+ * Sample rows:
+ *     TRAIN,"They have bad food and very rude",RudeService,BadFood
+ *     gs://folder/content.txt,SlowService
+ *     TEST,gs://folder/document.pdf
+ *     VALIDATE,gs://folder/text_files.zip,BadFood
+ * </section><section><h5>Sentiment Analysis</h5>
+ * See [Preparing your training
+ * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more
+ * information.
+ * CSV file(s) with each line in format:
+ *     ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT
+ * *   `ML_USE` - Identifies the data set that the current row (file) applies
+ * to.
+ *     This value can be one of the following:
+ *     * `TRAIN` - Rows in this file are used to train the model.
+ *     * `TEST` - Rows in this file are used to test the model during training.
+ *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+ *        Automatically divided into train and test data. 80% for training and
+ *        20% for testing.
+ * *   `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If
+ *     the column content is a valid  Google Cloud Storage file path, that is,
+ *     prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if
+ *     the content is enclosed in double quotes (""), it is treated as a
+ *     `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a
+ *     file with supported extension and UTF-8 encoding, for example,
+ *     "gs://folder/content.txt" AutoML imports the file content
+ *     as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content
+ *     excluding quotes. In both cases, size of the content must be 128kB or
+ *     less in size. For zip files, the size of each file inside the zip must be
+ *     128kB or less in size.
+ *     The `ML_USE` and `SENTIMENT` columns are optional.
+ *     Supported file extensions: .TXT, .PDF, .ZIP
+ * *  `SENTIMENT` - An integer between 0 and
+ *     Dataset.text_sentiment_dataset_metadata.sentiment_max
+ *     (inclusive). Describes the ordinal of the sentiment - higher
+ *     value means a more positive sentiment. All the values are
+ *     completely relative, i.e. neither 0 needs to mean a negative or
+ *     neutral sentiment nor sentiment_max needs to mean a positive one -
+ *     it is just required that 0 is the least positive sentiment
+ *     in the data, and sentiment_max is the  most positive one.
+ *     The SENTIMENT shouldn't be confused with "score" or "magnitude"
+ *     from the previous Natural Language Sentiment Analysis API.
+ *     All SENTIMENT values between 0 and sentiment_max must be
+ *     represented in the imported data. On prediction the same 0 to
+ *     sentiment_max range will be used. The difference between
+ *     neighboring sentiment values needs not to be uniform, e.g. 1 and
+ *     2 may be similar whereas the difference between 2 and 3 may be
+ *     large.
+ * Sample rows:
+ *     TRAIN,"@freewrytin this is way too good for your product",2
+ *     gs://folder/content.txt,3
+ *     TEST,gs://folder/document.pdf
+ *     VALIDATE,gs://folder/text_files.zip,2
+ *   </section>
+ * </div>
+ * **Input field definitions:**
+ * `ML_USE`
+ * : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED")
+ *   Describes how the given example (file) should be used for model
+ *   training. "UNASSIGNED" can be used when user has no preference.
+ * `GCS_FILE_PATH`
+ * : The path to a file on Google Cloud Storage. For example,
+ *   "gs://folder/image1.png".
+ * `LABEL`
+ * : A display name of an object on an image, video etc., e.g. "dog".
+ *   Must be up to 32 characters long and can consist only of ASCII
+ *   Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9.
+ *   For each label an AnnotationSpec is created which display_name
+ *   becomes the label; AnnotationSpecs are given back in predictions.
+ * `BOUNDING_BOX`
+ * : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`)
+ *   A rectangle parallel to the frame of the example (image,
+ *   video). If 4 vertices are given they are connected by edges
+ *   in the order provided, if 2 are given they are recognized
+ *   as diagonally opposite vertices of the rectangle.
+ * `VERTEX`
+ * : (`COORDINATE,COORDINATE`)
+ *   First coordinate is horizontal (x), the second is vertical (y).
+ * `COORDINATE`
+ * : A float in 0 to 1 range, relative to total length of
+ *   image or video in given dimension. For fractions the
+ *   leading non-decimal 0 can be omitted (i.e. 0.3 = .3).
+ *   Point 0,0 is in top left.
+ * `TEXT_SNIPPET`
+ * : The content of a text snippet, UTF-8 encoded, enclosed within
+ *   double quotes ("").
+ * `DOCUMENT`
+ * : A field that provides the textual content with document and the layout
+ *   information.
+ *  **Errors:**
  *  If any of the provided CSV files can't be parsed or if more than certain
  *  percent of CSV rows cannot be processed then the operation fails and
  *  nothing is imported. Regardless of overall success or failure the per-row
@@ -197,8 +532,9 @@ public SourceCase getSourceCase() {
    *
    * 
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -211,8 +547,9 @@ public boolean hasGcsSource() { * *
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -228,8 +565,9 @@ public com.google.cloud.automl.v1.GcsSource getGcsSource() { * *
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -536,18 +874,353 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Input configuration for ImportData Action.
+   * Input configuration for
+   * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action.
    * The format of input depends on dataset_metadata the Dataset into which
    * the import is happening has. As input source the
-   * [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source]
+   * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source]
    * is expected, unless specified otherwise. Additionally any input .CSV file
    * by itself must be 100MB or smaller, unless specified otherwise.
    * If an "example" file (that is, image, video etc.) with identical content
-   * (even if it had different GCS_FILE_PATH) is mentioned multiple times, then
+   * (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then
    * its label, bounding boxes etc. are appended. The same file should be always
-   * provided with the same ML_USE and GCS_FILE_PATH, if it is not, then
+   * provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then
    * these values are nondeterministically selected from the given ones.
-   *  Errors:
+   * The formats are represented in EBNF with commas being literal and with
+   * non-terminal symbols defined near the end of this comment. The formats are:
+   * <h4>AutoML Vision</h4>
+   * <div class="ds-selector-tabs"><section><h5>Classification</h5>
+   * See [Preparing your training
+   * data](https://cloud.google.com/vision/automl/docs/prepare) for more
+   * information.
+   * CSV file(s) with each line in format:
+   *     ML_USE,GCS_FILE_PATH,LABEL,LABEL,...
+   * *   `ML_USE` - Identifies the data set that the current row (file) applies
+   * to.
+   *     This value can be one of the following:
+   *     * `TRAIN` - Rows in this file are used to train the model.
+   *     * `TEST` - Rows in this file are used to test the model during training.
+   *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+   *        Automatically divided into train and test data. 80% for training and
+   *        20% for testing.
+   * *   `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to
+   *      30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP,
+   *      .TIFF, .ICO.
+   * *   `LABEL` - A label that identifies the object in the image.
+   * For the `MULTICLASS` classification type, at most one `LABEL` is allowed
+   * per image. If an image has not yet been labeled, then it should be
+   * mentioned just once with no `LABEL`.
+   * Some sample rows:
+   *     TRAIN,gs://folder/image1.jpg,daisy
+   *     TEST,gs://folder/image2.jpg,dandelion,tulip,rose
+   *     UNASSIGNED,gs://folder/image3.jpg,daisy
+   *     UNASSIGNED,gs://folder/image4.jpg
+   * </section><section><h5>Object Detection</h5>
+   * See [Preparing your training
+   * data](https://cloud.google.com/vision/automl/object-detection/docs/prepare)
+   * for more information.
+   * A CSV file(s) with each line in format:
+   *     ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,)
+   * *   `ML_USE` - Identifies the data set that the current row (file) applies
+   * to.
+   *     This value can be one of the following:
+   *     * `TRAIN` - Rows in this file are used to train the model.
+   *     * `TEST` - Rows in this file are used to test the model during training.
+   *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+   *        Automatically divided into train and test data. 80% for training and
+   *        20% for testing.
+   * *  `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to
+   *     30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image
+   *     is assumed to be exhaustively labeled.
+   * *  `LABEL` - A label that identifies the object in the image specified by the
+   *    `BOUNDING_BOX`.
+   * *  `BOUNDING BOX` - The vertices of an object in the example image.
+   *    The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than
+   *    500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX`
+   *    per line). If an image has no looked for objects then it should be
+   *    mentioned just once with no LABEL and the ",,,,,,," in place of the
+   *   `BOUNDING_BOX`.
+   * **Four sample rows:**
+   *     TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,,
+   *     TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,,
+   *     UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3
+   *     TEST,gs://folder/im3.png,,,,,,,,,
+   *   </section>
+   * </div>
+   * <h4>AutoML Natural Language</h4>
+   * <div class="ds-selector-tabs"><section><h5>Entity Extraction</h5>
+   * See [Preparing your training
+   * data](/natural-language/automl/entity-analysis/docs/prepare) for more
+   * information.
+   * One or more CSV file(s) with each line in the following format:
+   *     ML_USE,GCS_FILE_PATH
+   * *   `ML_USE` - Identifies the data set that the current row (file) applies
+   * to.
+   *     This value can be one of the following:
+   *     * `TRAIN` - Rows in this file are used to train the model.
+   *     * `TEST` - Rows in this file are used to test the model during training.
+   *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+   *        Automatically divided into train and test data. 80% for training and
+   *        20% for testing..
+   * *   `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in
+   *      Google Cloud Storage that contains in-line text in-line as documents
+   *      for model training.
+   * After the training data set has been determined from the `TRAIN` and
+   * `UNASSIGNED` CSV files, the training data is divided into train and
+   * validation data sets. 70% for training and 30% for validation.
+   * For example:
+   *     TRAIN,gs://folder/file1.jsonl
+   *     VALIDATE,gs://folder/file2.jsonl
+   *     TEST,gs://folder/file3.jsonl
+   * **In-line JSONL files**
+   * In-line .JSONL files contain, per line, a JSON document that wraps a
+   * [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by
+   * one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload]
+   * fields, which have `display_name` and `text_extraction` fields to describe
+   * the entity from the text snippet. Multiple JSON documents can be separated
+   * using line breaks (\n).
+   * The supplied text must be annotated exhaustively. For example, if you
+   * include the text "horse", but do not label it as "animal",
+   * then "horse" is assumed to not be an "animal".
+   * Any given text snippet content must have 30,000 characters or
+   * less, and also be UTF-8 NFC encoded. ASCII is accepted as it is
+   * UTF-8 NFC encoded.
+   * For example:
+   *     {
+   *       "text_snippet": {
+   *         "content": "dog car cat"
+   *       },
+   *       "annotations": [
+   *          {
+   *            "display_name": "animal",
+   *            "text_extraction": {
+   *              "text_segment": {"start_offset": 0, "end_offset": 2}
+   *           }
+   *          },
+   *          {
+   *           "display_name": "vehicle",
+   *            "text_extraction": {
+   *              "text_segment": {"start_offset": 4, "end_offset": 6}
+   *            }
+   *          },
+   *          {
+   *            "display_name": "animal",
+   *            "text_extraction": {
+   *              "text_segment": {"start_offset": 8, "end_offset": 10}
+   *            }
+   *          }
+   *      ]
+   *     }\n
+   *     {
+   *        "text_snippet": {
+   *          "content": "This dog is good."
+   *        },
+   *        "annotations": [
+   *           {
+   *             "display_name": "animal",
+   *             "text_extraction": {
+   *               "text_segment": {"start_offset": 5, "end_offset": 7}
+   *             }
+   *           }
+   *        ]
+   *     }
+   * **JSONL files that reference documents**
+   * .JSONL files contain, per line, a JSON document that wraps a
+   * `input_config` that contains the path to a source PDF document.
+   * Multiple JSON documents can be separated using line breaks (\n).
+   * For example:
+   *     {
+   *       "document": {
+   *         "input_config": {
+   *           "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ]
+   *           }
+   *         }
+   *       }
+   *     }\n
+   *     {
+   *       "document": {
+   *         "input_config": {
+   *           "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ]
+   *           }
+   *         }
+   *       }
+   *     }
+   * **In-line JSONL files with PDF layout information**
+   * **Note:** You can only annotate PDF files using the UI. The format described
+   * below applies to annotated PDF files exported using the UI or `exportData`.
+   * In-line .JSONL files for PDF documents contain, per line, a JSON document
+   * that wraps a `document` field that provides the textual content of the PDF
+   * document and the layout information.
+   * For example:
+   *     {
+   *       "document": {
+   *               "document_text": {
+   *                 "content": "dog car cat"
+   *               }
+   *               "layout": [
+   *                 {
+   *                   "text_segment": {
+   *                     "start_offset": 0,
+   *                     "end_offset": 11,
+   *                    },
+   *                    "page_number": 1,
+   *                    "bounding_poly": {
+   *                       "normalized_vertices": [
+   *                         {"x": 0.1, "y": 0.1},
+   *                         {"x": 0.1, "y": 0.3},
+   *                         {"x": 0.3, "y": 0.3},
+   *                         {"x": 0.3, "y": 0.1},
+   *                       ],
+   *                     },
+   *                     "text_segment_type": TOKEN,
+   *                 }
+   *               ],
+   *               "document_dimensions": {
+   *                 "width": 8.27,
+   *                 "height": 11.69,
+   *                 "unit": INCH,
+   *               }
+   *               "page_count": 3,
+   *             },
+   *             "annotations": [
+   *               {
+   *                 "display_name": "animal",
+   *                 "text_extraction": {
+   *                   "text_segment": {"start_offset": 0, "end_offset": 3}
+   *                 }
+   *               },
+   *               {
+   *                 "display_name": "vehicle",
+   *                 "text_extraction": {
+   *                   "text_segment": {"start_offset": 4, "end_offset": 7}
+   *                 }
+   *               },
+   *               {
+   *                 "display_name": "animal",
+   *                 "text_extraction": {
+   *                   "text_segment": {"start_offset": 8, "end_offset": 11}
+   *                 }
+   *               },
+   *             ],
+   * </section><section><h5>Classification</h5>
+   * See [Preparing your training
+   * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more
+   * information.
+   * One or more CSV file(s) with each line in the following format:
+   *     ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,...
+   * *   `ML_USE` - Identifies the data set that the current row (file) applies
+   * to.
+   *     This value can be one of the following:
+   *     * `TRAIN` - Rows in this file are used to train the model.
+   *     * `TEST` - Rows in this file are used to test the model during training.
+   *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+   *        Automatically divided into train and test data. 80% for training and
+   *        20% for testing.
+   * *   `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If
+   *     the column content is a valid Google Cloud Storage file path, that is,
+   *     prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if
+   *     the content is enclosed in double quotes (""), it is treated as a
+   *     `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a
+   *     file with supported extension and UTF-8 encoding, for example,
+   *     "gs://folder/content.txt" AutoML imports the file content
+   *     as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content
+   *     excluding quotes. In both cases, size of the content must be 10MB or
+   *     less in size. For zip files, the size of each file inside the zip must be
+   *     10MB or less in size.
+   *     For the `MULTICLASS` classification type, at most one `LABEL` is allowed.
+   *     The `ML_USE` and `LABEL` columns are optional.
+   *     Supported file extensions: .TXT, .PDF, .ZIP
+   * A maximum of 100 unique labels are allowed per CSV row.
+   * Sample rows:
+   *     TRAIN,"They have bad food and very rude",RudeService,BadFood
+   *     gs://folder/content.txt,SlowService
+   *     TEST,gs://folder/document.pdf
+   *     VALIDATE,gs://folder/text_files.zip,BadFood
+   * </section><section><h5>Sentiment Analysis</h5>
+   * See [Preparing your training
+   * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more
+   * information.
+   * CSV file(s) with each line in format:
+   *     ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT
+   * *   `ML_USE` - Identifies the data set that the current row (file) applies
+   * to.
+   *     This value can be one of the following:
+   *     * `TRAIN` - Rows in this file are used to train the model.
+   *     * `TEST` - Rows in this file are used to test the model during training.
+   *     * `UNASSIGNED` - Rows in this file are not categorized. They are
+   *        Automatically divided into train and test data. 80% for training and
+   *        20% for testing.
+   * *   `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If
+   *     the column content is a valid  Google Cloud Storage file path, that is,
+   *     prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if
+   *     the content is enclosed in double quotes (""), it is treated as a
+   *     `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a
+   *     file with supported extension and UTF-8 encoding, for example,
+   *     "gs://folder/content.txt" AutoML imports the file content
+   *     as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content
+   *     excluding quotes. In both cases, size of the content must be 128kB or
+   *     less in size. For zip files, the size of each file inside the zip must be
+   *     128kB or less in size.
+   *     The `ML_USE` and `SENTIMENT` columns are optional.
+   *     Supported file extensions: .TXT, .PDF, .ZIP
+   * *  `SENTIMENT` - An integer between 0 and
+   *     Dataset.text_sentiment_dataset_metadata.sentiment_max
+   *     (inclusive). Describes the ordinal of the sentiment - higher
+   *     value means a more positive sentiment. All the values are
+   *     completely relative, i.e. neither 0 needs to mean a negative or
+   *     neutral sentiment nor sentiment_max needs to mean a positive one -
+   *     it is just required that 0 is the least positive sentiment
+   *     in the data, and sentiment_max is the  most positive one.
+   *     The SENTIMENT shouldn't be confused with "score" or "magnitude"
+   *     from the previous Natural Language Sentiment Analysis API.
+   *     All SENTIMENT values between 0 and sentiment_max must be
+   *     represented in the imported data. On prediction the same 0 to
+   *     sentiment_max range will be used. The difference between
+   *     neighboring sentiment values needs not to be uniform, e.g. 1 and
+   *     2 may be similar whereas the difference between 2 and 3 may be
+   *     large.
+   * Sample rows:
+   *     TRAIN,"@freewrytin this is way too good for your product",2
+   *     gs://folder/content.txt,3
+   *     TEST,gs://folder/document.pdf
+   *     VALIDATE,gs://folder/text_files.zip,2
+   *   </section>
+   * </div>
+   * **Input field definitions:**
+   * `ML_USE`
+   * : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED")
+   *   Describes how the given example (file) should be used for model
+   *   training. "UNASSIGNED" can be used when user has no preference.
+   * `GCS_FILE_PATH`
+   * : The path to a file on Google Cloud Storage. For example,
+   *   "gs://folder/image1.png".
+   * `LABEL`
+   * : A display name of an object on an image, video etc., e.g. "dog".
+   *   Must be up to 32 characters long and can consist only of ASCII
+   *   Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9.
+   *   For each label an AnnotationSpec is created which display_name
+   *   becomes the label; AnnotationSpecs are given back in predictions.
+   * `BOUNDING_BOX`
+   * : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`)
+   *   A rectangle parallel to the frame of the example (image,
+   *   video). If 4 vertices are given they are connected by edges
+   *   in the order provided, if 2 are given they are recognized
+   *   as diagonally opposite vertices of the rectangle.
+   * `VERTEX`
+   * : (`COORDINATE,COORDINATE`)
+   *   First coordinate is horizontal (x), the second is vertical (y).
+   * `COORDINATE`
+   * : A float in 0 to 1 range, relative to total length of
+   *   image or video in given dimension. For fractions the
+   *   leading non-decimal 0 can be omitted (i.e. 0.3 = .3).
+   *   Point 0,0 is in top left.
+   * `TEXT_SNIPPET`
+   * : The content of a text snippet, UTF-8 encoded, enclosed within
+   *   double quotes ("").
+   * `DOCUMENT`
+   * : A field that provides the textual content with document and the layout
+   *   information.
+   *  **Errors:**
    *  If any of the provided CSV files can't be parsed or if more than certain
    *  percent of CSV rows cannot be processed then the operation fails and
    *  nothing is imported. Regardless of overall success or failure the per-row
@@ -772,8 +1445,9 @@ public Builder clearSource() {
      *
      * 
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -786,8 +1460,9 @@ public boolean hasGcsSource() { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -810,8 +1485,9 @@ public com.google.cloud.automl.v1.GcsSource getGcsSource() { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -834,8 +1510,9 @@ public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource value) { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -855,8 +1532,9 @@ public Builder setGcsSource(com.google.cloud.automl.v1.GcsSource.Builder builder * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -888,8 +1566,9 @@ public Builder mergeGcsSource(com.google.cloud.automl.v1.GcsSource value) { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -915,8 +1594,9 @@ public Builder clearGcsSource() { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -929,8 +1609,9 @@ public com.google.cloud.automl.v1.GcsSource.Builder getGcsSourceBuilder() { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -950,8 +1631,9 @@ public com.google.cloud.automl.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { * *
      * The Google Cloud Storage location for the input content.
-     * In ImportData, the gcs_source points to a csv with structure described in
-     * the comment.
+     * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+     * `gcs_source` points to a CSV file with a structure described in
+     * [InputConfig][google.cloud.automl.v1.InputConfig].
      * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.java index cf38adeaf..75facc0a0 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/InputConfigOrBuilder.java @@ -28,8 +28,9 @@ public interface InputConfigOrBuilder * *
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -40,8 +41,9 @@ public interface InputConfigOrBuilder * *
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; @@ -52,8 +54,9 @@ public interface InputConfigOrBuilder * *
    * The Google Cloud Storage location for the input content.
-   * In ImportData, the gcs_source points to a csv with structure described in
-   * the comment.
+   * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData],
+   * `gcs_source` points to a CSV file with a structure described in
+   * [InputConfig][google.cloud.automl.v1.InputConfig].
    * 
* * .google.cloud.automl.v1.GcsSource gcs_source = 1; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java index 0f6b74819..9e0ba5234 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Io.java @@ -35,10 +35,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_automl_v1_InputConfig_ParamsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_InputConfig_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_DocumentInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_DocumentInputConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1_OutputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ModelExportOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ModelExportOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ModelExportOutputConfig_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ModelExportOutputConfig_ParamsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1_GcsSource_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -58,20 +78,35 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n\037google/cloud/automl/v1/io.proto\022\026googl" + "e.cloud.automl.v1\032\034google/api/annotation" - + "s.proto\"\300\001\n\013InputConfig\0227\n\ngcs_source\030\001 " - + "\001(\0132!.google.cloud.automl.v1.GcsSourceH\000" - + "\022?\n\006params\030\002 \003(\0132/.google.cloud.automl.v" - + "1.InputConfig.ParamsEntry\032-\n\013ParamsEntry" - + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\010\n\006sour" - + "ce\"`\n\014OutputConfig\022A\n\017gcs_destination\030\001 " + + "s.proto\032\037google/api/field_behavior.proto" + + "\"\300\001\n\013InputConfig\0227\n\ngcs_source\030\001 \001(\0132!.g" + + "oogle.cloud.automl.v1.GcsSourceH\000\022?\n\006par" + + "ams\030\002 \003(\0132/.google.cloud.automl.v1.Input" + + "Config.ParamsEntry\032-\n\013ParamsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\010\n\006source\"a\n\027B" + + "atchPredictInputConfig\022<\n\ngcs_source\030\001 \001" + + "(\0132!.google.cloud.automl.v1.GcsSourceB\003\340" + + "A\002H\000B\010\n\006source\"L\n\023DocumentInputConfig\0225\n" + + "\ngcs_source\030\001 \001(\0132!.google.cloud.automl." + + "v1.GcsSource\"e\n\014OutputConfig\022F\n\017gcs_dest" + + "ination\030\001 \001(\0132&.google.cloud.automl.v1.G" + + "csDestinationB\003\340A\002H\000B\r\n\013destination\"q\n\030B" + + "atchPredictOutputConfig\022F\n\017gcs_destinati" + + "on\030\001 \001(\0132&.google.cloud.automl.v1.GcsDes" + + "tinationB\003\340A\002H\000B\r\n\013destination\"\202\002\n\027Model" + + "ExportOutputConfig\022F\n\017gcs_destination\030\001 " + "\001(\0132&.google.cloud.automl.v1.GcsDestinat" - + "ionH\000B\r\n\013destination\"\037\n\tGcsSource\022\022\n\ninp" - + "ut_uris\030\001 \003(\t\"+\n\016GcsDestination\022\031\n\021outpu" - + "t_uri_prefix\030\001 \001(\tB\252\001\n\032com.google.cloud." - + "automl.v1P\001Z * An expression for filtering the results of the request. * * `dataset_metadata` - for existence of the case (e.g. - * image_classification_dataset_metadata:*). - * Some examples of using the filter are: + * image_classification_dataset_metadata:*). Some examples of + * using the filter are: * * `translation_dataset_metadata:*` --> The dataset has * translation_dataset_metadata. *
@@ -204,8 +204,8 @@ public java.lang.String getFilter() { *
    * An expression for filtering the results of the request.
    *   * `dataset_metadata` - for existence of the case (e.g.
-   *             image_classification_dataset_metadata:*).
-   * Some examples of using the filter are:
+   *             image_classification_dataset_metadata:*). Some examples of
+   *             using the filter are:
    *   * `translation_dataset_metadata:*` --> The dataset has
    *                                          translation_dataset_metadata.
    * 
@@ -756,8 +756,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { *
      * An expression for filtering the results of the request.
      *   * `dataset_metadata` - for existence of the case (e.g.
-     *             image_classification_dataset_metadata:*).
-     * Some examples of using the filter are:
+     *             image_classification_dataset_metadata:*). Some examples of
+     *             using the filter are:
      *   * `translation_dataset_metadata:*` --> The dataset has
      *                                          translation_dataset_metadata.
      * 
@@ -781,8 +781,8 @@ public java.lang.String getFilter() { *
      * An expression for filtering the results of the request.
      *   * `dataset_metadata` - for existence of the case (e.g.
-     *             image_classification_dataset_metadata:*).
-     * Some examples of using the filter are:
+     *             image_classification_dataset_metadata:*). Some examples of
+     *             using the filter are:
      *   * `translation_dataset_metadata:*` --> The dataset has
      *                                          translation_dataset_metadata.
      * 
@@ -806,8 +806,8 @@ public com.google.protobuf.ByteString getFilterBytes() { *
      * An expression for filtering the results of the request.
      *   * `dataset_metadata` - for existence of the case (e.g.
-     *             image_classification_dataset_metadata:*).
-     * Some examples of using the filter are:
+     *             image_classification_dataset_metadata:*). Some examples of
+     *             using the filter are:
      *   * `translation_dataset_metadata:*` --> The dataset has
      *                                          translation_dataset_metadata.
      * 
@@ -829,8 +829,8 @@ public Builder setFilter(java.lang.String value) { *
      * An expression for filtering the results of the request.
      *   * `dataset_metadata` - for existence of the case (e.g.
-     *             image_classification_dataset_metadata:*).
-     * Some examples of using the filter are:
+     *             image_classification_dataset_metadata:*). Some examples of
+     *             using the filter are:
      *   * `translation_dataset_metadata:*` --> The dataset has
      *                                          translation_dataset_metadata.
      * 
@@ -849,8 +849,8 @@ public Builder clearFilter() { *
      * An expression for filtering the results of the request.
      *   * `dataset_metadata` - for existence of the case (e.g.
-     *             image_classification_dataset_metadata:*).
-     * Some examples of using the filter are:
+     *             image_classification_dataset_metadata:*). Some examples of
+     *             using the filter are:
      *   * `translation_dataset_metadata:*` --> The dataset has
      *                                          translation_dataset_metadata.
      * 
diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.java index 84a150d17..2f85bb61c 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListDatasetsRequestOrBuilder.java @@ -50,8 +50,8 @@ public interface ListDatasetsRequestOrBuilder *
    * An expression for filtering the results of the request.
    *   * `dataset_metadata` - for existence of the case (e.g.
-   *             image_classification_dataset_metadata:*).
-   * Some examples of using the filter are:
+   *             image_classification_dataset_metadata:*). Some examples of
+   *             using the filter are:
    *   * `translation_dataset_metadata:*` --> The dataset has
    *                                          translation_dataset_metadata.
    * 
@@ -65,8 +65,8 @@ public interface ListDatasetsRequestOrBuilder *
    * An expression for filtering the results of the request.
    *   * `dataset_metadata` - for existence of the case (e.g.
-   *             image_classification_dataset_metadata:*).
-   * Some examples of using the filter are:
+   *             image_classification_dataset_metadata:*). Some examples of
+   *             using the filter are:
    *   * `translation_dataset_metadata:*` --> The dataset has
    *                                          translation_dataset_metadata.
    * 
diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java index d90b1a143..6afa71c66 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequest.java @@ -179,7 +179,7 @@ public com.google.protobuf.ByteString getParentBytes() { *
    * An expression for filtering the results of the request.
    *   * `model_metadata` - for existence of the case (e.g.
-   *             video_classification_model_metadata:*).
+   *             image_classification_model_metadata:*).
    *   * `dataset_id` - for = or !=. Some examples of using the filter are:
    *   * `image_classification_model_metadata:*` --> The model has
    *                                        image_classification_model_metadata.
@@ -205,7 +205,7 @@ public java.lang.String getFilter() {
    * 
    * An expression for filtering the results of the request.
    *   * `model_metadata` - for existence of the case (e.g.
-   *             video_classification_model_metadata:*).
+   *             image_classification_model_metadata:*).
    *   * `dataset_id` - for = or !=. Some examples of using the filter are:
    *   * `image_classification_model_metadata:*` --> The model has
    *                                        image_classification_model_metadata.
@@ -757,7 +757,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
      * 
      * An expression for filtering the results of the request.
      *   * `model_metadata` - for existence of the case (e.g.
-     *             video_classification_model_metadata:*).
+     *             image_classification_model_metadata:*).
      *   * `dataset_id` - for = or !=. Some examples of using the filter are:
      *   * `image_classification_model_metadata:*` --> The model has
      *                                        image_classification_model_metadata.
@@ -783,7 +783,7 @@ public java.lang.String getFilter() {
      * 
      * An expression for filtering the results of the request.
      *   * `model_metadata` - for existence of the case (e.g.
-     *             video_classification_model_metadata:*).
+     *             image_classification_model_metadata:*).
      *   * `dataset_id` - for = or !=. Some examples of using the filter are:
      *   * `image_classification_model_metadata:*` --> The model has
      *                                        image_classification_model_metadata.
@@ -809,7 +809,7 @@ public com.google.protobuf.ByteString getFilterBytes() {
      * 
      * An expression for filtering the results of the request.
      *   * `model_metadata` - for existence of the case (e.g.
-     *             video_classification_model_metadata:*).
+     *             image_classification_model_metadata:*).
      *   * `dataset_id` - for = or !=. Some examples of using the filter are:
      *   * `image_classification_model_metadata:*` --> The model has
      *                                        image_classification_model_metadata.
@@ -833,7 +833,7 @@ public Builder setFilter(java.lang.String value) {
      * 
      * An expression for filtering the results of the request.
      *   * `model_metadata` - for existence of the case (e.g.
-     *             video_classification_model_metadata:*).
+     *             image_classification_model_metadata:*).
      *   * `dataset_id` - for = or !=. Some examples of using the filter are:
      *   * `image_classification_model_metadata:*` --> The model has
      *                                        image_classification_model_metadata.
@@ -854,7 +854,7 @@ public Builder clearFilter() {
      * 
      * An expression for filtering the results of the request.
      *   * `model_metadata` - for existence of the case (e.g.
-     *             video_classification_model_metadata:*).
+     *             image_classification_model_metadata:*).
      *   * `dataset_id` - for = or !=. Some examples of using the filter are:
      *   * `image_classification_model_metadata:*` --> The model has
      *                                        image_classification_model_metadata.
diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java
index c1ebc9521..8acca8099 100644
--- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java
+++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ListModelsRequestOrBuilder.java
@@ -50,7 +50,7 @@ public interface ListModelsRequestOrBuilder
    * 
    * An expression for filtering the results of the request.
    *   * `model_metadata` - for existence of the case (e.g.
-   *             video_classification_model_metadata:*).
+   *             image_classification_model_metadata:*).
    *   * `dataset_id` - for = or !=. Some examples of using the filter are:
    *   * `image_classification_model_metadata:*` --> The model has
    *                                        image_classification_model_metadata.
@@ -66,7 +66,7 @@ public interface ListModelsRequestOrBuilder
    * 
    * An expression for filtering the results of the request.
    *   * `model_metadata` - for existence of the case (e.g.
-   *             video_classification_model_metadata:*).
+   *             image_classification_model_metadata:*).
    *   * `dataset_id` - for = or !=. Some examples of using the filter are:
    *   * `image_classification_model_metadata:*` --> The model has
    *                                        image_classification_model_metadata.
diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java
index 820395299..99f92af62 100644
--- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java
+++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Model.java
@@ -42,6 +42,7 @@ private Model() {
     displayName_ = "";
     datasetId_ = "";
     deploymentState_ = 0;
+    etag_ = "";
   }
 
   @java.lang.Override
@@ -111,6 +112,13 @@ private Model(
               deploymentState_ = rawValue;
               break;
             }
+          case 82:
+            {
+              java.lang.String s = input.readStringRequireUtf8();
+
+              etag_ = s;
+              break;
+            }
           case 90:
             {
               com.google.protobuf.Timestamp.Builder subBuilder = null;
@@ -124,6 +132,46 @@ private Model(
                 updateTime_ = subBuilder.buildPartial();
               }
 
+              break;
+            }
+          case 106:
+            {
+              com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder subBuilder = null;
+              if (modelMetadataCase_ == 13) {
+                subBuilder =
+                    ((com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_)
+                        .toBuilder();
+              }
+              modelMetadata_ =
+                  input.readMessage(
+                      com.google.cloud.automl.v1.ImageClassificationModelMetadata.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(
+                    (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_);
+                modelMetadata_ = subBuilder.buildPartial();
+              }
+              modelMetadataCase_ = 13;
+              break;
+            }
+          case 114:
+            {
+              com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder subBuilder = null;
+              if (modelMetadataCase_ == 14) {
+                subBuilder =
+                    ((com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_)
+                        .toBuilder();
+              }
+              modelMetadata_ =
+                  input.readMessage(
+                      com.google.cloud.automl.v1.TextClassificationModelMetadata.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(
+                    (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_);
+                modelMetadata_ = subBuilder.buildPartial();
+              }
+              modelMetadataCase_ = 14;
               break;
             }
           case 122:
@@ -146,12 +194,73 @@ private Model(
               modelMetadataCase_ = 15;
               break;
             }
+          case 154:
+            {
+              com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder subBuilder = null;
+              if (modelMetadataCase_ == 19) {
+                subBuilder =
+                    ((com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_)
+                        .toBuilder();
+              }
+              modelMetadata_ =
+                  input.readMessage(
+                      com.google.cloud.automl.v1.TextExtractionModelMetadata.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(
+                    (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_);
+                modelMetadata_ = subBuilder.buildPartial();
+              }
+              modelMetadataCase_ = 19;
+              break;
+            }
+          case 162:
+            {
+              com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder subBuilder =
+                  null;
+              if (modelMetadataCase_ == 20) {
+                subBuilder =
+                    ((com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_)
+                        .toBuilder();
+              }
+              modelMetadata_ =
+                  input.readMessage(
+                      com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(
+                    (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_);
+                modelMetadata_ = subBuilder.buildPartial();
+              }
+              modelMetadataCase_ = 20;
+              break;
+            }
+          case 178:
+            {
+              com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder subBuilder = null;
+              if (modelMetadataCase_ == 22) {
+                subBuilder =
+                    ((com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_)
+                        .toBuilder();
+              }
+              modelMetadata_ =
+                  input.readMessage(
+                      com.google.cloud.automl.v1.TextSentimentModelMetadata.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(
+                    (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_);
+                modelMetadata_ = subBuilder.buildPartial();
+              }
+              modelMetadataCase_ = 22;
+              break;
+            }
           case 274:
             {
-              if (!((mutable_bitField0_ & 0x00000080) != 0)) {
+              if (!((mutable_bitField0_ & 0x00002000) != 0)) {
                 labels_ =
                     com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
-                mutable_bitField0_ |= 0x00000080;
+                mutable_bitField0_ |= 0x00002000;
               }
               com.google.protobuf.MapEntry labels__ =
                   input.readMessage(
@@ -356,6 +465,11 @@ private DeploymentState(int value) {
 
   public enum ModelMetadataCase implements com.google.protobuf.Internal.EnumLite {
     TRANSLATION_MODEL_METADATA(15),
+    IMAGE_CLASSIFICATION_MODEL_METADATA(13),
+    TEXT_CLASSIFICATION_MODEL_METADATA(14),
+    IMAGE_OBJECT_DETECTION_MODEL_METADATA(20),
+    TEXT_EXTRACTION_MODEL_METADATA(19),
+    TEXT_SENTIMENT_MODEL_METADATA(22),
     MODELMETADATA_NOT_SET(0);
     private final int value;
 
@@ -372,6 +486,16 @@ public static ModelMetadataCase forNumber(int value) {
       switch (value) {
         case 15:
           return TRANSLATION_MODEL_METADATA;
+        case 13:
+          return IMAGE_CLASSIFICATION_MODEL_METADATA;
+        case 14:
+          return TEXT_CLASSIFICATION_MODEL_METADATA;
+        case 20:
+          return IMAGE_OBJECT_DETECTION_MODEL_METADATA;
+        case 19:
+          return TEXT_EXTRACTION_MODEL_METADATA;
+        case 22:
+          return TEXT_SENTIMENT_MODEL_METADATA;
         case 0:
           return MODELMETADATA_NOT_SET;
         default:
@@ -433,6 +557,258 @@ public com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMe
     return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
   }
 
+  public static final int IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 13;
+  /**
+   *
+   *
+   * 
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public boolean hasImageClassificationModelMetadata() { + return modelMetadataCase_ == 13; + } + /** + * + * + *
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelMetadata + getImageClassificationModelMetadata() { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder + getImageClassificationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + + public static final int TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 14; + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public boolean hasTextClassificationModelMetadata() { + return modelMetadataCase_ == 14; + } + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public com.google.cloud.automl.v1.TextClassificationModelMetadata + getTextClassificationModelMetadata() { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder + getTextClassificationModelMetadataOrBuilder() { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + + public static final int IMAGE_OBJECT_DETECTION_MODEL_METADATA_FIELD_NUMBER = 20; + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public boolean hasImageObjectDetectionModelMetadata() { + return modelMetadataCase_ == 20; + } + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + getImageObjectDetectionModelMetadata() { + if (modelMetadataCase_ == 20) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder + getImageObjectDetectionModelMetadataOrBuilder() { + if (modelMetadataCase_ == 20) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + + public static final int TEXT_EXTRACTION_MODEL_METADATA_FIELD_NUMBER = 19; + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public boolean hasTextExtractionModelMetadata() { + return modelMetadataCase_ == 19; + } + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public com.google.cloud.automl.v1.TextExtractionModelMetadata getTextExtractionModelMetadata() { + if (modelMetadataCase_ == 19) { + return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder + getTextExtractionModelMetadataOrBuilder() { + if (modelMetadataCase_ == 19) { + return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + + public static final int TEXT_SENTIMENT_MODEL_METADATA_FIELD_NUMBER = 22; + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + public boolean hasTextSentimentModelMetadata() { + return modelMetadataCase_ == 22; + } + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + public com.google.cloud.automl.v1.TextSentimentModelMetadata getTextSentimentModelMetadata() { + if (modelMetadataCase_ == 22) { + return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + public com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder + getTextSentimentModelMetadataOrBuilder() { + if (modelMetadataCase_ == 22) { + return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -682,6 +1058,51 @@ public com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState() { return result == null ? com.google.cloud.automl.v1.Model.DeploymentState.UNRECOGNIZED : result; } + public static final int ETAG_FIELD_NUMBER = 10; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Used to perform a consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 10; + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Used to perform a consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 10; + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int LABELS_FIELD_NUMBER = 34; private static final class LabelsDefaultEntryHolder { @@ -826,12 +1247,35 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(8, deploymentState_); } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, etag_); + } if (updateTime_ != null) { output.writeMessage(11, getUpdateTime()); } + if (modelMetadataCase_ == 13) { + output.writeMessage( + 13, (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 14) { + output.writeMessage( + 14, (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_); + } if (modelMetadataCase_ == 15) { output.writeMessage(15, (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_); } + if (modelMetadataCase_ == 19) { + output.writeMessage( + 19, (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 20) { + output.writeMessage( + 20, (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 22) { + output.writeMessage( + 22, (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_); + } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 34); unknownFields.writeTo(output); @@ -860,21 +1304,49 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, deploymentState_); } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, etag_); + } if (updateTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime()); } + if (modelMetadataCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_); + } if (modelMetadataCase_ == 15) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 15, (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_); } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) + if (modelMetadataCase_ == 19) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 20) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 20, (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_); + } + if (modelMetadataCase_ == 22) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 22, (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, labels__); } @@ -905,6 +1377,7 @@ public boolean equals(final java.lang.Object obj) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } if (deploymentState_ != other.deploymentState_) return false; + if (!getEtag().equals(other.getEtag())) return false; if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (!getModelMetadataCase().equals(other.getModelMetadataCase())) return false; switch (modelMetadataCase_) { @@ -912,6 +1385,26 @@ public boolean equals(final java.lang.Object obj) { if (!getTranslationModelMetadata().equals(other.getTranslationModelMetadata())) return false; break; + case 13: + if (!getImageClassificationModelMetadata() + .equals(other.getImageClassificationModelMetadata())) return false; + break; + case 14: + if (!getTextClassificationModelMetadata() + .equals(other.getTextClassificationModelMetadata())) return false; + break; + case 20: + if (!getImageObjectDetectionModelMetadata() + .equals(other.getImageObjectDetectionModelMetadata())) return false; + break; + case 19: + if (!getTextExtractionModelMetadata().equals(other.getTextExtractionModelMetadata())) + return false; + break; + case 22: + if (!getTextSentimentModelMetadata().equals(other.getTextSentimentModelMetadata())) + return false; + break; case 0: default: } @@ -942,6 +1435,8 @@ public int hashCode() { } hash = (37 * hash) + DEPLOYMENT_STATE_FIELD_NUMBER; hash = (53 * hash) + deploymentState_; + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); @@ -951,6 +1446,26 @@ public int hashCode() { hash = (37 * hash) + TRANSLATION_MODEL_METADATA_FIELD_NUMBER; hash = (53 * hash) + getTranslationModelMetadata().hashCode(); break; + case 13: + hash = (37 * hash) + IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageClassificationModelMetadata().hashCode(); + break; + case 14: + hash = (37 * hash) + TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextClassificationModelMetadata().hashCode(); + break; + case 20: + hash = (37 * hash) + IMAGE_OBJECT_DETECTION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getImageObjectDetectionModelMetadata().hashCode(); + break; + case 19: + hash = (37 * hash) + TEXT_EXTRACTION_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextExtractionModelMetadata().hashCode(); + break; + case 22: + hash = (37 * hash) + TEXT_SENTIMENT_MODEL_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTextSentimentModelMetadata().hashCode(); + break; case 0: default: } @@ -1138,6 +1653,8 @@ public Builder clear() { } deploymentState_ = 0; + etag_ = ""; + internalGetMutableLabels().clear(); modelMetadataCase_ = 0; modelMetadata_ = null; @@ -1176,6 +1693,41 @@ public com.google.cloud.automl.v1.Model buildPartial() { result.modelMetadata_ = translationModelMetadataBuilder_.build(); } } + if (modelMetadataCase_ == 13) { + if (imageClassificationModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = imageClassificationModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 14) { + if (textClassificationModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = textClassificationModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 20) { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = imageObjectDetectionModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 19) { + if (textExtractionModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = textExtractionModelMetadataBuilder_.build(); + } + } + if (modelMetadataCase_ == 22) { + if (textSentimentModelMetadataBuilder_ == null) { + result.modelMetadata_ = modelMetadata_; + } else { + result.modelMetadata_ = textSentimentModelMetadataBuilder_.build(); + } + } result.name_ = name_; result.displayName_ = displayName_; result.datasetId_ = datasetId_; @@ -1190,6 +1742,7 @@ public com.google.cloud.automl.v1.Model buildPartial() { result.updateTime_ = updateTimeBuilder_.build(); } result.deploymentState_ = deploymentState_; + result.etag_ = etag_; result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.bitField0_ = to_bitField0_; @@ -1264,6 +1817,10 @@ public Builder mergeFrom(com.google.cloud.automl.v1.Model other) { if (other.deploymentState_ != 0) { setDeploymentStateValue(other.getDeploymentStateValue()); } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); switch (other.getModelMetadataCase()) { case TRANSLATION_MODEL_METADATA: @@ -1271,161 +1828,1312 @@ public Builder mergeFrom(com.google.cloud.automl.v1.Model other) { mergeTranslationModelMetadata(other.getTranslationModelMetadata()); break; } + case IMAGE_CLASSIFICATION_MODEL_METADATA: + { + mergeImageClassificationModelMetadata(other.getImageClassificationModelMetadata()); + break; + } + case TEXT_CLASSIFICATION_MODEL_METADATA: + { + mergeTextClassificationModelMetadata(other.getTextClassificationModelMetadata()); + break; + } + case IMAGE_OBJECT_DETECTION_MODEL_METADATA: + { + mergeImageObjectDetectionModelMetadata(other.getImageObjectDetectionModelMetadata()); + break; + } + case TEXT_EXTRACTION_MODEL_METADATA: + { + mergeTextExtractionModelMetadata(other.getTextExtractionModelMetadata()); + break; + } + case TEXT_SENTIMENT_MODEL_METADATA: + { + mergeTextSentimentModelMetadata(other.getTextSentimentModelMetadata()); + break; + } case MODELMETADATA_NOT_SET: { break; } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelMetadataCase_ = 0; + private java.lang.Object modelMetadata_; + + public ModelMetadataCase getModelMetadataCase() { + return ModelMetadataCase.forNumber(modelMetadataCase_); + } + + public Builder clearModelMetadata() { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationModelMetadata, + com.google.cloud.automl.v1.TranslationModelMetadata.Builder, + com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder> + translationModelMetadataBuilder_; + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public boolean hasTranslationModelMetadata() { + return modelMetadataCase_ == 15; + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMetadata() { + if (translationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 15) { + return translationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public Builder setTranslationModelMetadata( + com.google.cloud.automl.v1.TranslationModelMetadata value) { + if (translationModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + translationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 15; + return this; + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public Builder setTranslationModelMetadata( + com.google.cloud.automl.v1.TranslationModelMetadata.Builder builderForValue) { + if (translationModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + translationModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 15; + return this; + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public Builder mergeTranslationModelMetadata( + com.google.cloud.automl.v1.TranslationModelMetadata value) { + if (translationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 15 + && modelMetadata_ + != com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance()) { + modelMetadata_ = + com.google.cloud.automl.v1.TranslationModelMetadata.newBuilder( + (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 15) { + translationModelMetadataBuilder_.mergeFrom(value); + } + translationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 15; + return this; + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public Builder clearTranslationModelMetadata() { + if (translationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 15) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 15) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + translationModelMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public com.google.cloud.automl.v1.TranslationModelMetadata.Builder + getTranslationModelMetadataBuilder() { + return getTranslationModelMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + public com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder + getTranslationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 15) && (translationModelMetadataBuilder_ != null)) { + return translationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 15) { + return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for translation models.
+     * 
+ * + * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationModelMetadata, + com.google.cloud.automl.v1.TranslationModelMetadata.Builder, + com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder> + getTranslationModelMetadataFieldBuilder() { + if (translationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 15)) { + modelMetadata_ = com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + } + translationModelMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationModelMetadata, + com.google.cloud.automl.v1.TranslationModelMetadata.Builder, + com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 15; + onChanged(); + ; + return translationModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelMetadata, + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder> + imageClassificationModelMetadataBuilder_; + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public boolean hasImageClassificationModelMetadata() { + return modelMetadataCase_ == 13; + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelMetadata + getImageClassificationModelMetadata() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 13) { + return imageClassificationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public Builder setImageClassificationModelMetadata( + com.google.cloud.automl.v1.ImageClassificationModelMetadata value) { + if (imageClassificationModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + imageClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 13; + return this; + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public Builder setImageClassificationModelMetadata( + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder builderForValue) { + if (imageClassificationModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageClassificationModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 13; + return this; + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public Builder mergeImageClassificationModelMetadata( + com.google.cloud.automl.v1.ImageClassificationModelMetadata value) { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13 + && modelMetadata_ + != com.google.cloud.automl.v1.ImageClassificationModelMetadata + .getDefaultInstance()) { + modelMetadata_ = + com.google.cloud.automl.v1.ImageClassificationModelMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 13) { + imageClassificationModelMetadataBuilder_.mergeFrom(value); + } + imageClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 13; + return this; + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public Builder clearImageClassificationModelMetadata() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 13) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 13) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + imageClassificationModelMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder + getImageClassificationModelMetadataBuilder() { + return getImageClassificationModelMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + public com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder + getImageClassificationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 13) && (imageClassificationModelMetadataBuilder_ != null)) { + return imageClassificationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 13) { + return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for image classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelMetadata, + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder> + getImageClassificationModelMetadataFieldBuilder() { + if (imageClassificationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 13)) { + modelMetadata_ = + com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance(); + } + imageClassificationModelMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageClassificationModelMetadata, + com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 13; + onChanged(); + ; + return imageClassificationModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationModelMetadata, + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder> + textClassificationModelMetadataBuilder_; + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public boolean hasTextClassificationModelMetadata() { + return modelMetadataCase_ == 14; + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public com.google.cloud.automl.v1.TextClassificationModelMetadata + getTextClassificationModelMetadata() { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 14) { + return textClassificationModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public Builder setTextClassificationModelMetadata( + com.google.cloud.automl.v1.TextClassificationModelMetadata value) { + if (textClassificationModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + textClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 14; + return this; + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public Builder setTextClassificationModelMetadata( + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder builderForValue) { + if (textClassificationModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + textClassificationModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 14; + return this; + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public Builder mergeTextClassificationModelMetadata( + com.google.cloud.automl.v1.TextClassificationModelMetadata value) { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14 + && modelMetadata_ + != com.google.cloud.automl.v1.TextClassificationModelMetadata + .getDefaultInstance()) { + modelMetadata_ = + com.google.cloud.automl.v1.TextClassificationModelMetadata.newBuilder( + (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 14) { + textClassificationModelMetadataBuilder_.mergeFrom(value); + } + textClassificationModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 14; + return this; + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public Builder clearTextClassificationModelMetadata() { + if (textClassificationModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 14) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 14) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + textClassificationModelMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder + getTextClassificationModelMetadataBuilder() { + return getTextClassificationModelMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + public com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder + getTextClassificationModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 14) && (textClassificationModelMetadataBuilder_ != null)) { + return textClassificationModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 14) { + return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for text classification models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationModelMetadata, + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder> + getTextClassificationModelMetadataFieldBuilder() { + if (textClassificationModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 14)) { + modelMetadata_ = + com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + textClassificationModelMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextClassificationModelMetadata, + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder, + com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 14; + onChanged(); + ; + return textClassificationModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder> + imageObjectDetectionModelMetadataBuilder_; + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public boolean hasImageObjectDetectionModelMetadata() { + return modelMetadataCase_ == 20; + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + getImageObjectDetectionModelMetadata() { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 20) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 20) { + return imageObjectDetectionModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public Builder setImageObjectDetectionModelMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata value) { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + imageObjectDetectionModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 20; + return this; + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public Builder setImageObjectDetectionModelMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder builderForValue) { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + imageObjectDetectionModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 20; + return this; + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public Builder mergeImageObjectDetectionModelMetadata( + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata value) { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 20 + && modelMetadata_ + != com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + .getDefaultInstance()) { + modelMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.newBuilder( + (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 20) { + imageObjectDetectionModelMetadataBuilder_.mergeFrom(value); + } + imageObjectDetectionModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 20; + return this; + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public Builder clearImageObjectDetectionModelMetadata() { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 20) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); + } + } else { + if (modelMetadataCase_ == 20) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + imageObjectDetectionModelMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder + getImageObjectDetectionModelMetadataBuilder() { + return getImageObjectDetectionModelMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder + getImageObjectDetectionModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 20) && (imageObjectDetectionModelMetadataBuilder_ != null)) { + return imageObjectDetectionModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 20) { + return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for image object detection models.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder> + getImageObjectDetectionModelMetadataFieldBuilder() { + if (imageObjectDetectionModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 20)) { + modelMetadata_ = + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance(); + } + imageObjectDetectionModelMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 20; + onChanged(); + ; + return imageObjectDetectionModelMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionModelMetadata, + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder> + textExtractionModelMetadataBuilder_; + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public boolean hasTextExtractionModelMetadata() { + return modelMetadataCase_ == 19; + } + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public com.google.cloud.automl.v1.TextExtractionModelMetadata getTextExtractionModelMetadata() { + if (textExtractionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 19) { + return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } else { + if (modelMetadataCase_ == 19) { + return textExtractionModelMetadataBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public Builder setTextExtractionModelMetadata( + com.google.cloud.automl.v1.TextExtractionModelMetadata value) { + if (textExtractionModelMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelMetadata_ = value; + onChanged(); + } else { + textExtractionModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 19; + return this; + } + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public Builder setTextExtractionModelMetadata( + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder builderForValue) { + if (textExtractionModelMetadataBuilder_ == null) { + modelMetadata_ = builderForValue.build(); + onChanged(); + } else { + textExtractionModelMetadataBuilder_.setMessage(builderForValue.build()); + } + modelMetadataCase_ = 19; + return this; + } + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public Builder mergeTextExtractionModelMetadata( + com.google.cloud.automl.v1.TextExtractionModelMetadata value) { + if (textExtractionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 19 + && modelMetadata_ + != com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance()) { + modelMetadata_ = + com.google.cloud.automl.v1.TextExtractionModelMetadata.newBuilder( + (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + modelMetadata_ = value; + } + onChanged(); + } else { + if (modelMetadataCase_ == 19) { + textExtractionModelMetadataBuilder_.mergeFrom(value); + } + textExtractionModelMetadataBuilder_.setMessage(value); + } + modelMetadataCase_ = 19; return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.automl.v1.Model parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.automl.v1.Model) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public Builder clearTextExtractionModelMetadata() { + if (textExtractionModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 19) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + onChanged(); } + } else { + if (modelMetadataCase_ == 19) { + modelMetadataCase_ = 0; + modelMetadata_ = null; + } + textExtractionModelMetadataBuilder_.clear(); } return this; } - - private int modelMetadataCase_ = 0; - private java.lang.Object modelMetadata_; - - public ModelMetadataCase getModelMetadataCase() { - return ModelMetadataCase.forNumber(modelMetadataCase_); + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder + getTextExtractionModelMetadataBuilder() { + return getTextExtractionModelMetadataFieldBuilder().getBuilder(); } - - public Builder clearModelMetadata() { - modelMetadataCase_ = 0; - modelMetadata_ = null; + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + public com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder + getTextExtractionModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 19) && (textExtractionModelMetadataBuilder_ != null)) { + return textExtractionModelMetadataBuilder_.getMessageOrBuilder(); + } else { + if (modelMetadataCase_ == 19) { + return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_; + } + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Metadata for text extraction models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionModelMetadata, + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder> + getTextExtractionModelMetadataFieldBuilder() { + if (textExtractionModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 19)) { + modelMetadata_ = + com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + textExtractionModelMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionModelMetadata, + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder, + com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_, + getParentForChildren(), + isClean()); + modelMetadata_ = null; + } + modelMetadataCase_ = 19; onChanged(); - return this; + ; + return textExtractionModelMetadataBuilder_; } - private int bitField0_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationModelMetadata, - com.google.cloud.automl.v1.TranslationModelMetadata.Builder, - com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder> - translationModelMetadataBuilder_; + com.google.cloud.automl.v1.TextSentimentModelMetadata, + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder> + textSentimentModelMetadataBuilder_; /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public boolean hasTranslationModelMetadata() { - return modelMetadataCase_ == 15; + public boolean hasTextSentimentModelMetadata() { + return modelMetadataCase_ == 22; } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMetadata() { - if (translationModelMetadataBuilder_ == null) { - if (modelMetadataCase_ == 15) { - return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_; + public com.google.cloud.automl.v1.TextSentimentModelMetadata getTextSentimentModelMetadata() { + if (textSentimentModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 22) { + return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_; } - return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); } else { - if (modelMetadataCase_ == 15) { - return translationModelMetadataBuilder_.getMessage(); + if (modelMetadataCase_ == 22) { + return textSentimentModelMetadataBuilder_.getMessage(); } - return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); } } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public Builder setTranslationModelMetadata( - com.google.cloud.automl.v1.TranslationModelMetadata value) { - if (translationModelMetadataBuilder_ == null) { + public Builder setTextSentimentModelMetadata( + com.google.cloud.automl.v1.TextSentimentModelMetadata value) { + if (textSentimentModelMetadataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } modelMetadata_ = value; onChanged(); } else { - translationModelMetadataBuilder_.setMessage(value); + textSentimentModelMetadataBuilder_.setMessage(value); } - modelMetadataCase_ = 15; + modelMetadataCase_ = 22; return this; } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public Builder setTranslationModelMetadata( - com.google.cloud.automl.v1.TranslationModelMetadata.Builder builderForValue) { - if (translationModelMetadataBuilder_ == null) { + public Builder setTextSentimentModelMetadata( + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder builderForValue) { + if (textSentimentModelMetadataBuilder_ == null) { modelMetadata_ = builderForValue.build(); onChanged(); } else { - translationModelMetadataBuilder_.setMessage(builderForValue.build()); + textSentimentModelMetadataBuilder_.setMessage(builderForValue.build()); } - modelMetadataCase_ = 15; + modelMetadataCase_ = 22; return this; } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public Builder mergeTranslationModelMetadata( - com.google.cloud.automl.v1.TranslationModelMetadata value) { - if (translationModelMetadataBuilder_ == null) { - if (modelMetadataCase_ == 15 + public Builder mergeTextSentimentModelMetadata( + com.google.cloud.automl.v1.TextSentimentModelMetadata value) { + if (textSentimentModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 22 && modelMetadata_ - != com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance()) { + != com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance()) { modelMetadata_ = - com.google.cloud.automl.v1.TranslationModelMetadata.newBuilder( - (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_) + com.google.cloud.automl.v1.TextSentimentModelMetadata.newBuilder( + (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_) .mergeFrom(value) .buildPartial(); } else { @@ -1433,37 +3141,37 @@ public Builder mergeTranslationModelMetadata( } onChanged(); } else { - if (modelMetadataCase_ == 15) { - translationModelMetadataBuilder_.mergeFrom(value); + if (modelMetadataCase_ == 22) { + textSentimentModelMetadataBuilder_.mergeFrom(value); } - translationModelMetadataBuilder_.setMessage(value); + textSentimentModelMetadataBuilder_.setMessage(value); } - modelMetadataCase_ = 15; + modelMetadataCase_ = 22; return this; } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public Builder clearTranslationModelMetadata() { - if (translationModelMetadataBuilder_ == null) { - if (modelMetadataCase_ == 15) { + public Builder clearTextSentimentModelMetadata() { + if (textSentimentModelMetadataBuilder_ == null) { + if (modelMetadataCase_ == 22) { modelMetadataCase_ = 0; modelMetadata_ = null; onChanged(); } } else { - if (modelMetadataCase_ == 15) { + if (modelMetadataCase_ == 22) { modelMetadataCase_ = 0; modelMetadata_ = null; } - translationModelMetadataBuilder_.clear(); + textSentimentModelMetadataBuilder_.clear(); } return this; } @@ -1471,70 +3179,71 @@ public Builder clearTranslationModelMetadata() { * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public com.google.cloud.automl.v1.TranslationModelMetadata.Builder - getTranslationModelMetadataBuilder() { - return getTranslationModelMetadataFieldBuilder().getBuilder(); + public com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder + getTextSentimentModelMetadataBuilder() { + return getTextSentimentModelMetadataFieldBuilder().getBuilder(); } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ - public com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder - getTranslationModelMetadataOrBuilder() { - if ((modelMetadataCase_ == 15) && (translationModelMetadataBuilder_ != null)) { - return translationModelMetadataBuilder_.getMessageOrBuilder(); + public com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder + getTextSentimentModelMetadataOrBuilder() { + if ((modelMetadataCase_ == 22) && (textSentimentModelMetadataBuilder_ != null)) { + return textSentimentModelMetadataBuilder_.getMessageOrBuilder(); } else { - if (modelMetadataCase_ == 15) { - return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_; + if (modelMetadataCase_ == 22) { + return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_; } - return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); } } /** * * *
-     * Metadata for translation models.
+     * Metadata for text sentiment models.
      * 
* - * .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; * */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationModelMetadata, - com.google.cloud.automl.v1.TranslationModelMetadata.Builder, - com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder> - getTranslationModelMetadataFieldBuilder() { - if (translationModelMetadataBuilder_ == null) { - if (!(modelMetadataCase_ == 15)) { - modelMetadata_ = com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance(); + com.google.cloud.automl.v1.TextSentimentModelMetadata, + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder> + getTextSentimentModelMetadataFieldBuilder() { + if (textSentimentModelMetadataBuilder_ == null) { + if (!(modelMetadataCase_ == 22)) { + modelMetadata_ = + com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); } - translationModelMetadataBuilder_ = + textSentimentModelMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationModelMetadata, - com.google.cloud.automl.v1.TranslationModelMetadata.Builder, - com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder>( - (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_, + com.google.cloud.automl.v1.TextSentimentModelMetadata, + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder, + com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder>( + (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_, getParentForChildren(), isClean()); modelMetadata_ = null; } - modelMetadataCase_ = 15; + modelMetadataCase_ = 22; onChanged(); ; - return translationModelMetadataBuilder_; + return textSentimentModelMetadataBuilder_; } private java.lang.Object name_ = ""; @@ -2285,6 +3994,105 @@ public Builder clearDeploymentState() { return this; } + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Used to perform a consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 10; + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Used to perform a consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 10; + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Used to perform a consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 10; + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform a consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 10; + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform a consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 10; + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java index a4fc52a03..e7c107481 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluation.java @@ -40,6 +40,7 @@ private ModelEvaluation(com.google.protobuf.GeneratedMessageV3.Builder builde private ModelEvaluation() { name_ = ""; annotationSpecId_ = ""; + displayName_ = ""; } @java.lang.Override @@ -100,6 +101,26 @@ private ModelEvaluation( evaluatedExampleCount_ = input.readInt32(); break; } + case 66: + { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 8) { + subBuilder = + ((com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_) + .toBuilder(); + } + metrics_ = + input.readMessage( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 8; + break; + } case 74: { com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder subBuilder = null; @@ -120,6 +141,74 @@ private ModelEvaluation( metricsCase_ = 9; break; } + case 90: + { + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 11) { + subBuilder = + ((com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_) + .toBuilder(); + } + metrics_ = + input.readMessage( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 11; + break; + } + case 98: + { + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder subBuilder = + null; + if (metricsCase_ == 12) { + subBuilder = + ((com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_) + .toBuilder(); + } + metrics_ = + input.readMessage( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 12; + break; + } + case 106: + { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder subBuilder = null; + if (metricsCase_ == 13) { + subBuilder = + ((com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_) + .toBuilder(); + } + metrics_ = + input.readMessage( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_); + metrics_ = subBuilder.buildPartial(); + } + metricsCase_ = 13; + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -158,7 +247,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { private java.lang.Object metrics_; public enum MetricsCase implements com.google.protobuf.Internal.EnumLite { + CLASSIFICATION_EVALUATION_METRICS(8), TRANSLATION_EVALUATION_METRICS(9), + IMAGE_OBJECT_DETECTION_EVALUATION_METRICS(12), + TEXT_SENTIMENT_EVALUATION_METRICS(11), + TEXT_EXTRACTION_EVALUATION_METRICS(13), METRICS_NOT_SET(0); private final int value; @@ -173,8 +266,16 @@ public static MetricsCase valueOf(int value) { public static MetricsCase forNumber(int value) { switch (value) { + case 8: + return CLASSIFICATION_EVALUATION_METRICS; case 9: return TRANSLATION_EVALUATION_METRICS; + case 12: + return IMAGE_OBJECT_DETECTION_EVALUATION_METRICS; + case 11: + return TEXT_SENTIMENT_EVALUATION_METRICS; + case 13: + return TEXT_EXTRACTION_EVALUATION_METRICS; case 0: return METRICS_NOT_SET; default: @@ -191,6 +292,58 @@ public MetricsCase getMetricsCase() { return MetricsCase.forNumber(metricsCase_); } + public static final int CLASSIFICATION_EVALUATION_METRICS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public boolean hasClassificationEvaluationMetrics() { + return metricsCase_ == 8; + } + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics + getClassificationEvaluationMetrics() { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder + getClassificationEvaluationMetricsOrBuilder() { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + public static final int TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER = 9; /** * @@ -239,6 +392,162 @@ public com.google.cloud.automl.v1.TranslationEvaluationMetrics getTranslationEva return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); } + public static final int IMAGE_OBJECT_DETECTION_EVALUATION_METRICS_FIELD_NUMBER = 12; + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public boolean hasImageObjectDetectionEvaluationMetrics() { + return metricsCase_ == 12; + } + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getImageObjectDetectionEvaluationMetrics() { + if (metricsCase_ == 12) { + return (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.getDefaultInstance(); + } + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder + getImageObjectDetectionEvaluationMetricsOrBuilder() { + if (metricsCase_ == 12) { + return (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.getDefaultInstance(); + } + + public static final int TEXT_SENTIMENT_EVALUATION_METRICS_FIELD_NUMBER = 11; + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public boolean hasTextSentimentEvaluationMetrics() { + return metricsCase_ == 11; + } + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics + getTextSentimentEvaluationMetrics() { + if (metricsCase_ == 11) { + return (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder + getTextSentimentEvaluationMetricsOrBuilder() { + if (metricsCase_ == 11) { + return (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + + public static final int TEXT_EXTRACTION_EVALUATION_METRICS_FIELD_NUMBER = 13; + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + public boolean hasTextExtractionEvaluationMetrics() { + return metricsCase_ == 13; + } + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + getTextExtractionEvaluationMetrics() { + if (metricsCase_ == 13) { + return (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); + } + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder + getTextExtractionEvaluationMetricsOrBuilder() { + if (metricsCase_ == 13) { + return (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -292,8 +601,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Output only. The ID of the annotation spec that the model evaluation applies to. The
-   * The ID is empty for the overall model evaluation.
+   * Output only. The ID of the annotation spec that the model evaluation
+   * applies to. The The ID is empty for the overall model evaluation.
    * 
* * string annotation_spec_id = 2; @@ -313,8 +622,8 @@ public java.lang.String getAnnotationSpecId() { * * *
-   * Output only. The ID of the annotation spec that the model evaluation applies to. The
-   * The ID is empty for the overall model evaluation.
+   * Output only. The ID of the annotation spec that the model evaluation
+   * applies to. The The ID is empty for the overall model evaluation.
    * 
* * string annotation_spec_id = 2; @@ -331,6 +640,59 @@ public com.google.protobuf.ByteString getAnnotationSpecIdBytes() { } } + public static final int DISPLAY_NAME_FIELD_NUMBER = 15; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * at the moment when the model was trained. Because this field returns a
+   * value at model training time, for different models trained from the same
+   * dataset, the values may differ, since display names could had been changed
+   * between the two model's trainings.
+   * 
+ * + * string display_name = 15; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * at the moment when the model was trained. Because this field returns a
+   * value at model training time, for different models trained from the same
+   * dataset, the values may differ, since display names could had been changed
+   * between the two model's trainings.
+   * 
+ * + * string display_name = 15; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int CREATE_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp createTime_; /** @@ -383,7 +745,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * the total number of all examples used for evaluation. * Otherwise, this is the count of examples that according to the ground * truth were annotated by the - * [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. *
* * int32 evaluated_example_count = 6; @@ -418,9 +780,26 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (evaluatedExampleCount_ != 0) { output.writeInt32(6, evaluatedExampleCount_); } + if (metricsCase_ == 8) { + output.writeMessage(8, (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_); + } if (metricsCase_ == 9) { output.writeMessage(9, (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_); } + if (metricsCase_ == 11) { + output.writeMessage(11, (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_); + } + if (metricsCase_ == 12) { + output.writeMessage( + 12, (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_); + } + if (metricsCase_ == 13) { + output.writeMessage( + 13, (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, displayName_); + } unknownFields.writeTo(output); } @@ -442,11 +821,34 @@ public int getSerializedSize() { if (evaluatedExampleCount_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, evaluatedExampleCount_); } + if (metricsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_); + } if (metricsCase_ == 9) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 9, (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_); } + if (metricsCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_); + } + if (metricsCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_); + } + if (metricsCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, displayName_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -465,6 +867,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getAnnotationSpecId().equals(other.getAnnotationSpecId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -472,10 +875,26 @@ public boolean equals(final java.lang.Object obj) { if (getEvaluatedExampleCount() != other.getEvaluatedExampleCount()) return false; if (!getMetricsCase().equals(other.getMetricsCase())) return false; switch (metricsCase_) { + case 8: + if (!getClassificationEvaluationMetrics() + .equals(other.getClassificationEvaluationMetrics())) return false; + break; case 9: if (!getTranslationEvaluationMetrics().equals(other.getTranslationEvaluationMetrics())) return false; break; + case 12: + if (!getImageObjectDetectionEvaluationMetrics() + .equals(other.getImageObjectDetectionEvaluationMetrics())) return false; + break; + case 11: + if (!getTextSentimentEvaluationMetrics().equals(other.getTextSentimentEvaluationMetrics())) + return false; + break; + case 13: + if (!getTextExtractionEvaluationMetrics() + .equals(other.getTextExtractionEvaluationMetrics())) return false; + break; case 0: default: } @@ -494,6 +913,8 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER; hash = (53 * hash) + getAnnotationSpecId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -501,10 +922,26 @@ public int hashCode() { hash = (37 * hash) + EVALUATED_EXAMPLE_COUNT_FIELD_NUMBER; hash = (53 * hash) + getEvaluatedExampleCount(); switch (metricsCase_) { + case 8: + hash = (37 * hash) + CLASSIFICATION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationEvaluationMetrics().hashCode(); + break; case 9: hash = (37 * hash) + TRANSLATION_EVALUATION_METRICS_FIELD_NUMBER; hash = (53 * hash) + getTranslationEvaluationMetrics().hashCode(); break; + case 12: + hash = (37 * hash) + IMAGE_OBJECT_DETECTION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getImageObjectDetectionEvaluationMetrics().hashCode(); + break; + case 11: + hash = (37 * hash) + TEXT_SENTIMENT_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTextSentimentEvaluationMetrics().hashCode(); + break; + case 13: + hash = (37 * hash) + TEXT_EXTRACTION_EVALUATION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTextExtractionEvaluationMetrics().hashCode(); + break; case 0: default: } @@ -657,6 +1094,8 @@ public Builder clear() { annotationSpecId_ = ""; + displayName_ = ""; + if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -694,6 +1133,13 @@ public com.google.cloud.automl.v1.ModelEvaluation build() { public com.google.cloud.automl.v1.ModelEvaluation buildPartial() { com.google.cloud.automl.v1.ModelEvaluation result = new com.google.cloud.automl.v1.ModelEvaluation(this); + if (metricsCase_ == 8) { + if (classificationEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = classificationEvaluationMetricsBuilder_.build(); + } + } if (metricsCase_ == 9) { if (translationEvaluationMetricsBuilder_ == null) { result.metrics_ = metrics_; @@ -701,8 +1147,30 @@ public com.google.cloud.automl.v1.ModelEvaluation buildPartial() { result.metrics_ = translationEvaluationMetricsBuilder_.build(); } } + if (metricsCase_ == 12) { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = imageObjectDetectionEvaluationMetricsBuilder_.build(); + } + } + if (metricsCase_ == 11) { + if (textSentimentEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = textSentimentEvaluationMetricsBuilder_.build(); + } + } + if (metricsCase_ == 13) { + if (textExtractionEvaluationMetricsBuilder_ == null) { + result.metrics_ = metrics_; + } else { + result.metrics_ = textExtractionEvaluationMetricsBuilder_.build(); + } + } result.name_ = name_; result.annotationSpecId_ = annotationSpecId_; + result.displayName_ = displayName_; if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { @@ -767,6 +1235,10 @@ public Builder mergeFrom(com.google.cloud.automl.v1.ModelEvaluation other) { annotationSpecId_ = other.annotationSpecId_; onChanged(); } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -774,9 +1246,30 @@ public Builder mergeFrom(com.google.cloud.automl.v1.ModelEvaluation other) { setEvaluatedExampleCount(other.getEvaluatedExampleCount()); } switch (other.getMetricsCase()) { - case TRANSLATION_EVALUATION_METRICS: + case CLASSIFICATION_EVALUATION_METRICS: { - mergeTranslationEvaluationMetrics(other.getTranslationEvaluationMetrics()); + mergeClassificationEvaluationMetrics(other.getClassificationEvaluationMetrics()); + break; + } + case TRANSLATION_EVALUATION_METRICS: + { + mergeTranslationEvaluationMetrics(other.getTranslationEvaluationMetrics()); + break; + } + case IMAGE_OBJECT_DETECTION_EVALUATION_METRICS: + { + mergeImageObjectDetectionEvaluationMetrics( + other.getImageObjectDetectionEvaluationMetrics()); + break; + } + case TEXT_SENTIMENT_EVALUATION_METRICS: + { + mergeTextSentimentEvaluationMetrics(other.getTextSentimentEvaluationMetrics()); + break; + } + case TEXT_EXTRACTION_EVALUATION_METRICS: + { + mergeTextExtractionEvaluationMetrics(other.getTextExtractionEvaluationMetrics()); break; } case METRICS_NOT_SET: @@ -784,160 +1277,1072 @@ public Builder mergeFrom(com.google.cloud.automl.v1.ModelEvaluation other) { break; } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ModelEvaluation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.ModelEvaluation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int metricsCase_ = 0; + private java.lang.Object metrics_; + + public MetricsCase getMetricsCase() { + return MetricsCase.forNumber(metricsCase_); + } + + public Builder clearMetrics() { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder> + classificationEvaluationMetricsBuilder_; + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public boolean hasClassificationEvaluationMetrics() { + return metricsCase_ == 8; + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics + getClassificationEvaluationMetrics() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } else { + if (metricsCase_ == 8) { + return classificationEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public Builder setClassificationEvaluationMetrics( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics value) { + if (classificationEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + classificationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 8; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public Builder setClassificationEvaluationMetrics( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder builderForValue) { + if (classificationEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + classificationEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 8; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public Builder mergeClassificationEvaluationMetrics( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics value) { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8 + && metrics_ + != com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .getDefaultInstance()) { + metrics_ = + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.newBuilder( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_) + .mergeFrom(value) + .buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 8) { + classificationEvaluationMetricsBuilder_.mergeFrom(value); + } + classificationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 8; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public Builder clearClassificationEvaluationMetrics() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 8) { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + } + } else { + if (metricsCase_ == 8) { + metricsCase_ = 0; + metrics_ = null; + } + classificationEvaluationMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder + getClassificationEvaluationMetricsBuilder() { + return getClassificationEvaluationMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder + getClassificationEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 8) && (classificationEvaluationMetricsBuilder_ != null)) { + return classificationEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 8) { + return (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for image, text classification.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder> + getClassificationEvaluationMetricsFieldBuilder() { + if (classificationEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 8)) { + metrics_ = + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance(); + } + classificationEvaluationMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) metrics_, + getParentForChildren(), + isClean()); + metrics_ = null; + } + metricsCase_ = 8; + onChanged(); + ; + return classificationEvaluationMetricsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationEvaluationMetrics, + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder> + translationEvaluationMetricsBuilder_; + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public boolean hasTranslationEvaluationMetrics() { + return metricsCase_ == 9; + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public com.google.cloud.automl.v1.TranslationEvaluationMetrics + getTranslationEvaluationMetrics() { + if (translationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } else { + if (metricsCase_ == 9) { + return translationEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public Builder setTranslationEvaluationMetrics( + com.google.cloud.automl.v1.TranslationEvaluationMetrics value) { + if (translationEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + translationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 9; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public Builder setTranslationEvaluationMetrics( + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder builderForValue) { + if (translationEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + translationEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 9; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public Builder mergeTranslationEvaluationMetrics( + com.google.cloud.automl.v1.TranslationEvaluationMetrics value) { + if (translationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 9 + && metrics_ + != com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance()) { + metrics_ = + com.google.cloud.automl.v1.TranslationEvaluationMetrics.newBuilder( + (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_) + .mergeFrom(value) + .buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 9) { + translationEvaluationMetricsBuilder_.mergeFrom(value); + } + translationEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 9; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public Builder clearTranslationEvaluationMetrics() { + if (translationEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 9) { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + } + } else { + if (metricsCase_ == 9) { + metricsCase_ = 0; + metrics_ = null; + } + translationEvaluationMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder + getTranslationEvaluationMetricsBuilder() { + return getTranslationEvaluationMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + public com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder + getTranslationEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 9) && (translationEvaluationMetricsBuilder_ != null)) { + return translationEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 9) { + return (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for translation.
+     * 
+ * + * + * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationEvaluationMetrics, + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder> + getTranslationEvaluationMetricsFieldBuilder() { + if (translationEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 9)) { + metrics_ = com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + } + translationEvaluationMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TranslationEvaluationMetrics, + com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_, + getParentForChildren(), + isClean()); + metrics_ = null; + } + metricsCase_ = 9; + onChanged(); + ; + return translationEvaluationMetricsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder> + imageObjectDetectionEvaluationMetricsBuilder_; + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public boolean hasImageObjectDetectionEvaluationMetrics() { + return metricsCase_ == 12; + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getImageObjectDetectionEvaluationMetrics() { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 12) { + return (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + .getDefaultInstance(); + } else { + if (metricsCase_ == 12) { + return imageObjectDetectionEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public Builder setImageObjectDetectionEvaluationMetrics( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics value) { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + imageObjectDetectionEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 12; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public Builder setImageObjectDetectionEvaluationMetrics( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder builderForValue) { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + imageObjectDetectionEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 12; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public Builder mergeImageObjectDetectionEvaluationMetrics( + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics value) { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 12 + && metrics_ + != com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + .getDefaultInstance()) { + metrics_ = + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.newBuilder( + (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_) + .mergeFrom(value) + .buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 12) { + imageObjectDetectionEvaluationMetricsBuilder_.mergeFrom(value); + } + imageObjectDetectionEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 12; + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public Builder clearImageObjectDetectionEvaluationMetrics() { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 12) { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + } + } else { + if (metricsCase_ == 12) { + metricsCase_ = 0; + metrics_ = null; + } + imageObjectDetectionEvaluationMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder + getImageObjectDetectionEvaluationMetricsBuilder() { + return getImageObjectDetectionEvaluationMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + public com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder + getImageObjectDetectionEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 12) && (imageObjectDetectionEvaluationMetricsBuilder_ != null)) { + return imageObjectDetectionEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 12) { + return (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Model evaluation metrics for image object detection.
+     * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder> + getImageObjectDetectionEvaluationMetricsFieldBuilder() { + if (imageObjectDetectionEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 12)) { + metrics_ = + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.getDefaultInstance(); + } + imageObjectDetectionEvaluationMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) metrics_, + getParentForChildren(), + isClean()); + metrics_ = null; + } + metricsCase_ = 12; + onChanged(); + ; + return imageObjectDetectionEvaluationMetricsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics, + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder> + textSentimentEvaluationMetricsBuilder_; + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public boolean hasTextSentimentEvaluationMetrics() { + return metricsCase_ == 11; + } + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics + getTextSentimentEvaluationMetrics() { + if (textSentimentEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 11) { + return (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } else { + if (metricsCase_ == 11) { + return textSentimentEvaluationMetricsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public Builder setTextSentimentEvaluationMetrics( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics value) { + if (textSentimentEvaluationMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + onChanged(); + } else { + textSentimentEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 11; + return this; + } + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public Builder setTextSentimentEvaluationMetrics( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder builderForValue) { + if (textSentimentEvaluationMetricsBuilder_ == null) { + metrics_ = builderForValue.build(); + onChanged(); + } else { + textSentimentEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + } + metricsCase_ = 11; + return this; + } + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public Builder mergeTextSentimentEvaluationMetrics( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics value) { + if (textSentimentEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 11 + && metrics_ + != com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance()) { + metrics_ = + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.newBuilder( + (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_) + .mergeFrom(value) + .buildPartial(); + } else { + metrics_ = value; + } + onChanged(); + } else { + if (metricsCase_ == 11) { + textSentimentEvaluationMetricsBuilder_.mergeFrom(value); + } + textSentimentEvaluationMetricsBuilder_.setMessage(value); + } + metricsCase_ = 11; return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.automl.v1.ModelEvaluation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.automl.v1.ModelEvaluation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public Builder clearTextSentimentEvaluationMetrics() { + if (textSentimentEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 11) { + metricsCase_ = 0; + metrics_ = null; + onChanged(); + } + } else { + if (metricsCase_ == 11) { + metricsCase_ = 0; + metrics_ = null; } + textSentimentEvaluationMetricsBuilder_.clear(); } return this; } - - private int metricsCase_ = 0; - private java.lang.Object metrics_; - - public MetricsCase getMetricsCase() { - return MetricsCase.forNumber(metricsCase_); + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder + getTextSentimentEvaluationMetricsBuilder() { + return getTextSentimentEvaluationMetricsFieldBuilder().getBuilder(); } - - public Builder clearMetrics() { - metricsCase_ = 0; - metrics_ = null; + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + public com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder + getTextSentimentEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 11) && (textSentimentEvaluationMetricsBuilder_ != null)) { + return textSentimentEvaluationMetricsBuilder_.getMessageOrBuilder(); + } else { + if (metricsCase_ == 11) { + return (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_; + } + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + } + /** + * + * + *
+     * Evaluation metrics for text sentiment models.
+     * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics, + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder> + getTextSentimentEvaluationMetricsFieldBuilder() { + if (textSentimentEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 11)) { + metrics_ = com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + textSentimentEvaluationMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics, + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) metrics_, + getParentForChildren(), + isClean()); + metrics_ = null; + } + metricsCase_ = 11; onChanged(); - return this; + ; + return textSentimentEvaluationMetricsBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationEvaluationMetrics, - com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, - com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder> - translationEvaluationMetricsBuilder_; + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder> + textExtractionEvaluationMetricsBuilder_; /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public boolean hasTranslationEvaluationMetrics() { - return metricsCase_ == 9; + public boolean hasTextExtractionEvaluationMetrics() { + return metricsCase_ == 13; } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public com.google.cloud.automl.v1.TranslationEvaluationMetrics - getTranslationEvaluationMetrics() { - if (translationEvaluationMetricsBuilder_ == null) { - if (metricsCase_ == 9) { - return (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_; + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + getTextExtractionEvaluationMetrics() { + if (textExtractionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 13) { + return (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_; } - return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); } else { - if (metricsCase_ == 9) { - return translationEvaluationMetricsBuilder_.getMessage(); + if (metricsCase_ == 13) { + return textExtractionEvaluationMetricsBuilder_.getMessage(); } - return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); } } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public Builder setTranslationEvaluationMetrics( - com.google.cloud.automl.v1.TranslationEvaluationMetrics value) { - if (translationEvaluationMetricsBuilder_ == null) { + public Builder setTextExtractionEvaluationMetrics( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics value) { + if (textExtractionEvaluationMetricsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } metrics_ = value; onChanged(); } else { - translationEvaluationMetricsBuilder_.setMessage(value); + textExtractionEvaluationMetricsBuilder_.setMessage(value); } - metricsCase_ = 9; + metricsCase_ = 13; return this; } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public Builder setTranslationEvaluationMetrics( - com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder builderForValue) { - if (translationEvaluationMetricsBuilder_ == null) { + public Builder setTextExtractionEvaluationMetrics( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder builderForValue) { + if (textExtractionEvaluationMetricsBuilder_ == null) { metrics_ = builderForValue.build(); onChanged(); } else { - translationEvaluationMetricsBuilder_.setMessage(builderForValue.build()); + textExtractionEvaluationMetricsBuilder_.setMessage(builderForValue.build()); } - metricsCase_ = 9; + metricsCase_ = 13; return this; } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public Builder mergeTranslationEvaluationMetrics( - com.google.cloud.automl.v1.TranslationEvaluationMetrics value) { - if (translationEvaluationMetricsBuilder_ == null) { - if (metricsCase_ == 9 + public Builder mergeTextExtractionEvaluationMetrics( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics value) { + if (textExtractionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 13 && metrics_ - != com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance()) { + != com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .getDefaultInstance()) { metrics_ = - com.google.cloud.automl.v1.TranslationEvaluationMetrics.newBuilder( - (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_) + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.newBuilder( + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_) .mergeFrom(value) .buildPartial(); } else { @@ -945,38 +2350,38 @@ public Builder mergeTranslationEvaluationMetrics( } onChanged(); } else { - if (metricsCase_ == 9) { - translationEvaluationMetricsBuilder_.mergeFrom(value); + if (metricsCase_ == 13) { + textExtractionEvaluationMetricsBuilder_.mergeFrom(value); } - translationEvaluationMetricsBuilder_.setMessage(value); + textExtractionEvaluationMetricsBuilder_.setMessage(value); } - metricsCase_ = 9; + metricsCase_ = 13; return this; } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public Builder clearTranslationEvaluationMetrics() { - if (translationEvaluationMetricsBuilder_ == null) { - if (metricsCase_ == 9) { + public Builder clearTextExtractionEvaluationMetrics() { + if (textExtractionEvaluationMetricsBuilder_ == null) { + if (metricsCase_ == 13) { metricsCase_ = 0; metrics_ = null; onChanged(); } } else { - if (metricsCase_ == 9) { + if (metricsCase_ == 13) { metricsCase_ = 0; metrics_ = null; } - translationEvaluationMetricsBuilder_.clear(); + textExtractionEvaluationMetricsBuilder_.clear(); } return this; } @@ -984,73 +2389,74 @@ public Builder clearTranslationEvaluationMetrics() { * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder - getTranslationEvaluationMetricsBuilder() { - return getTranslationEvaluationMetricsFieldBuilder().getBuilder(); + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder + getTextExtractionEvaluationMetricsBuilder() { + return getTextExtractionEvaluationMetricsFieldBuilder().getBuilder(); } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ - public com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder - getTranslationEvaluationMetricsOrBuilder() { - if ((metricsCase_ == 9) && (translationEvaluationMetricsBuilder_ != null)) { - return translationEvaluationMetricsBuilder_.getMessageOrBuilder(); + public com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder + getTextExtractionEvaluationMetricsOrBuilder() { + if ((metricsCase_ == 13) && (textExtractionEvaluationMetricsBuilder_ != null)) { + return textExtractionEvaluationMetricsBuilder_.getMessageOrBuilder(); } else { - if (metricsCase_ == 9) { - return (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_; + if (metricsCase_ == 13) { + return (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_; } - return com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); } } /** * * *
-     * Model evaluation metrics for translation.
+     * Evaluation metrics for text extraction models.
      * 
* * - * .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; * */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationEvaluationMetrics, - com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, - com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder> - getTranslationEvaluationMetricsFieldBuilder() { - if (translationEvaluationMetricsBuilder_ == null) { - if (!(metricsCase_ == 9)) { - metrics_ = com.google.cloud.automl.v1.TranslationEvaluationMetrics.getDefaultInstance(); + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder> + getTextExtractionEvaluationMetricsFieldBuilder() { + if (textExtractionEvaluationMetricsBuilder_ == null) { + if (!(metricsCase_ == 13)) { + metrics_ = + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); } - translationEvaluationMetricsBuilder_ = + textExtractionEvaluationMetricsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.TranslationEvaluationMetrics, - com.google.cloud.automl.v1.TranslationEvaluationMetrics.Builder, - com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder>( - (com.google.cloud.automl.v1.TranslationEvaluationMetrics) metrics_, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder>( + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) metrics_, getParentForChildren(), isClean()); metrics_ = null; } - metricsCase_ = 9; + metricsCase_ = 13; onChanged(); ; - return translationEvaluationMetricsBuilder_; + return textExtractionEvaluationMetricsBuilder_; } private java.lang.Object name_ = ""; @@ -1162,8 +2568,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The ID of the annotation spec that the model evaluation applies to. The
-     * The ID is empty for the overall model evaluation.
+     * Output only. The ID of the annotation spec that the model evaluation
+     * applies to. The The ID is empty for the overall model evaluation.
      * 
* * string annotation_spec_id = 2; @@ -1183,8 +2589,8 @@ public java.lang.String getAnnotationSpecId() { * * *
-     * Output only. The ID of the annotation spec that the model evaluation applies to. The
-     * The ID is empty for the overall model evaluation.
+     * Output only. The ID of the annotation spec that the model evaluation
+     * applies to. The The ID is empty for the overall model evaluation.
      * 
* * string annotation_spec_id = 2; @@ -1204,8 +2610,8 @@ public com.google.protobuf.ByteString getAnnotationSpecIdBytes() { * * *
-     * Output only. The ID of the annotation spec that the model evaluation applies to. The
-     * The ID is empty for the overall model evaluation.
+     * Output only. The ID of the annotation spec that the model evaluation
+     * applies to. The The ID is empty for the overall model evaluation.
      * 
* * string annotation_spec_id = 2; @@ -1223,8 +2629,8 @@ public Builder setAnnotationSpecId(java.lang.String value) { * * *
-     * Output only. The ID of the annotation spec that the model evaluation applies to. The
-     * The ID is empty for the overall model evaluation.
+     * Output only. The ID of the annotation spec that the model evaluation
+     * applies to. The The ID is empty for the overall model evaluation.
      * 
* * string annotation_spec_id = 2; @@ -1239,8 +2645,8 @@ public Builder clearAnnotationSpecId() { * * *
-     * Output only. The ID of the annotation spec that the model evaluation applies to. The
-     * The ID is empty for the overall model evaluation.
+     * Output only. The ID of the annotation spec that the model evaluation
+     * applies to. The The ID is empty for the overall model evaluation.
      * 
* * string annotation_spec_id = 2; @@ -1256,6 +2662,125 @@ public Builder setAnnotationSpecIdBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * at the moment when the model was trained. Because this field returns a
+     * value at model training time, for different models trained from the same
+     * dataset, the values may differ, since display names could had been changed
+     * between the two model's trainings.
+     * 
+ * + * string display_name = 15; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * at the moment when the model was trained. Because this field returns a
+     * value at model training time, for different models trained from the same
+     * dataset, the values may differ, since display names could had been changed
+     * between the two model's trainings.
+     * 
+ * + * string display_name = 15; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * at the moment when the model was trained. Because this field returns a
+     * value at model training time, for different models trained from the same
+     * dataset, the values may differ, since display names could had been changed
+     * between the two model's trainings.
+     * 
+ * + * string display_name = 15; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * at the moment when the model was trained. Because this field returns a
+     * value at model training time, for different models trained from the same
+     * dataset, the values may differ, since display names could had been changed
+     * between the two model's trainings.
+     * 
+ * + * string display_name = 15; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The value of
+     * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+     * at the moment when the model was trained. Because this field returns a
+     * value at model training time, for different models trained from the same
+     * dataset, the values may differ, since display names could had been changed
+     * between the two model's trainings.
+     * 
+ * + * string display_name = 15; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -1447,7 +2972,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * the total number of all examples used for evaluation. * Otherwise, this is the count of examples that according to the ground * truth were annotated by the - * [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. *
* * int32 evaluated_example_count = 6; @@ -1466,7 +2991,7 @@ public int getEvaluatedExampleCount() { * the total number of all examples used for evaluation. * Otherwise, this is the count of examples that according to the ground * truth were annotated by the - * [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. *
* * int32 evaluated_example_count = 6; @@ -1488,7 +3013,7 @@ public Builder setEvaluatedExampleCount(int value) { * the total number of all examples used for evaluation. * Otherwise, this is the count of examples that according to the ground * truth were annotated by the - * [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. *
* * int32 evaluated_example_count = 6; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java index 1d35478fa..a372f7a22 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOrBuilder.java @@ -23,6 +23,44 @@ public interface ModelEvaluationOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ModelEvaluation) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + boolean hasClassificationEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics getClassificationEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for image, text classification.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder + getClassificationEvaluationMetricsOrBuilder(); + /** * * @@ -58,6 +96,121 @@ public interface ModelEvaluationOrBuilder com.google.cloud.automl.v1.TranslationEvaluationMetricsOrBuilder getTranslationEvaluationMetricsOrBuilder(); + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + boolean hasImageObjectDetectionEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + getImageObjectDetectionEvaluationMetrics(); + /** + * + * + *
+   * Model evaluation metrics for image object detection.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetricsOrBuilder + getImageObjectDetectionEvaluationMetricsOrBuilder(); + + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + boolean hasTextSentimentEvaluationMetrics(); + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics getTextSentimentEvaluationMetrics(); + /** + * + * + *
+   * Evaluation metrics for text sentiment models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * + */ + com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder + getTextSentimentEvaluationMetricsOrBuilder(); + + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + boolean hasTextExtractionEvaluationMetrics(); + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics getTextExtractionEvaluationMetrics(); + /** + * + * + *
+   * Evaluation metrics for text extraction models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * + */ + com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder + getTextExtractionEvaluationMetricsOrBuilder(); + /** * * @@ -87,8 +240,8 @@ public interface ModelEvaluationOrBuilder * * *
-   * Output only. The ID of the annotation spec that the model evaluation applies to. The
-   * The ID is empty for the overall model evaluation.
+   * Output only. The ID of the annotation spec that the model evaluation
+   * applies to. The The ID is empty for the overall model evaluation.
    * 
* * string annotation_spec_id = 2; @@ -98,14 +251,45 @@ public interface ModelEvaluationOrBuilder * * *
-   * Output only. The ID of the annotation spec that the model evaluation applies to. The
-   * The ID is empty for the overall model evaluation.
+   * Output only. The ID of the annotation spec that the model evaluation
+   * applies to. The The ID is empty for the overall model evaluation.
    * 
* * string annotation_spec_id = 2; */ com.google.protobuf.ByteString getAnnotationSpecIdBytes(); + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * at the moment when the model was trained. Because this field returns a
+   * value at model training time, for different models trained from the same
+   * dataset, the values may differ, since display names could had been changed
+   * between the two model's trainings.
+   * 
+ * + * string display_name = 15; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. The value of
+   * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
+   * at the moment when the model was trained. Because this field returns a
+   * value at model training time, for different models trained from the same
+   * dataset, the values may differ, since display names could had been changed
+   * between the two model's trainings.
+   * 
+ * + * string display_name = 15; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + /** * * @@ -148,7 +332,7 @@ public interface ModelEvaluationOrBuilder * the total number of all examples used for evaluation. * Otherwise, this is the count of examples that according to the ground * truth were annotated by the - * [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. *
* * int32 evaluated_example_count = 6; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java index 3ff72783f..2567a7d12 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelEvaluationOuterClass.java @@ -41,21 +41,37 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n-google/cloud/automl/v1/model_evaluatio" - + "n.proto\022\026google.cloud.automl.v1\032(google/" - + "cloud/automl/v1/translation.proto\032\037googl" - + "e/protobuf/timestamp.proto\032\034google/api/a" - + "nnotations.proto\"\370\001\n\017ModelEvaluation\022^\n\036" - + "translation_evaluation_metrics\030\t \001(\01324.g" - + "oogle.cloud.automl.v1.TranslationEvaluat" - + "ionMetricsH\000\022\014\n\004name\030\001 \001(\t\022\032\n\022annotation" - + "_spec_id\030\002 \001(\t\022/\n\013create_time\030\005 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022\037\n\027evaluated_exa" - + "mple_count\030\006 \001(\005B\t\n\007metricsB\252\001\n\032com.goog" - + "le.cloud.automl.v1P\001Z + * Output configuration for ModelExport Action. + *
+ * + * Protobuf type {@code google.cloud.automl.v1.ModelExportOutputConfig} + */ +public final class ModelExportOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ModelExportOutputConfig) + ModelExportOutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ModelExportOutputConfig.newBuilder() to construct. + private ModelExportOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ModelExportOutputConfig() { + modelFormat_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ModelExportOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = ((com.google.cloud.automl.v1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.automl.v1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + params_.getMutableMap().put(params__.getKey(), params__.getValue()); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + modelFormat_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ModelExportOutputConfig.class, + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder.class); + } + + private int bitField0_; + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase implements com.google.protobuf.Internal.EnumLite { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + + public static final int MODEL_FORMAT_FIELD_NUMBER = 4; + private volatile java.lang.Object modelFormat_; + /** + * + * + *
+   * The format in which the model must be exported. The available, and default,
+   * formats depend on the problem and model type (if given problem and type
+   * combination doesn't have a format listed, it means its models are not
+   * exportable):
+   * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+   * *  For Image Classification mobile-core-ml-low-latency-1,
+   *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+   *      "core_ml" (default).
+   * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite", "tf_saved_model", "tf_js".
+   * Formats description:
+   * * tflite - Used for Android mobile devices.
+   * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+   *                    devices.
+   * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.x`
+   * * core_ml - Used for iOS mobile devices.
+   * 
+ * + * string model_format = 4; + */ + public java.lang.String getModelFormat() { + java.lang.Object ref = modelFormat_; + 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(); + modelFormat_ = s; + return s; + } + } + /** + * + * + *
+   * The format in which the model must be exported. The available, and default,
+   * formats depend on the problem and model type (if given problem and type
+   * combination doesn't have a format listed, it means its models are not
+   * exportable):
+   * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+   * *  For Image Classification mobile-core-ml-low-latency-1,
+   *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+   *      "core_ml" (default).
+   * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite", "tf_saved_model", "tf_js".
+   * Formats description:
+   * * tflite - Used for Android mobile devices.
+   * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+   *                    devices.
+   * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.x`
+   * * core_ml - Used for iOS mobile devices.
+   * 
+ * + * string model_format = 4; + */ + public com.google.protobuf.ByteString getModelFormatBytes() { + java.lang.Object ref = modelFormat_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMS_FIELD_NUMBER = 2; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + public java.lang.String getParamsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + public java.lang.String getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.automl.v1.GcsDestination) destination_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 2); + if (!getModelFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, modelFormat_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.automl.v1.GcsDestination) destination_); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, params__); + } + if (!getModelFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, modelFormat_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.ModelExportOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.ModelExportOutputConfig other = + (com.google.cloud.automl.v1.ModelExportOutputConfig) obj; + + if (!getModelFormat().equals(other.getModelFormat())) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODEL_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getModelFormat().hashCode(); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig 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.automl.v1.ModelExportOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig 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.automl.v1.ModelExportOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig 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.automl.v1.ModelExportOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig 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.automl.v1.ModelExportOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig 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.automl.v1.ModelExportOutputConfig 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; + } + /** + * + * + *
+   * Output configuration for ModelExport Action.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.ModelExportOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ModelExportOutputConfig) + com.google.cloud.automl.v1.ModelExportOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.ModelExportOutputConfig.class, + com.google.cloud.automl.v1.ModelExportOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.ModelExportOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + modelFormat_ = ""; + + internalGetMutableParams().clear(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Io + .internal_static_google_cloud_automl_v1_ModelExportOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelExportOutputConfig getDefaultInstanceForType() { + return com.google.cloud.automl.v1.ModelExportOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelExportOutputConfig build() { + com.google.cloud.automl.v1.ModelExportOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelExportOutputConfig buildPartial() { + com.google.cloud.automl.v1.ModelExportOutputConfig result = + new com.google.cloud.automl.v1.ModelExportOutputConfig(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + result.modelFormat_ = modelFormat_; + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.bitField0_ = to_bitField0_; + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.ModelExportOutputConfig) { + return mergeFrom((com.google.cloud.automl.v1.ModelExportOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.ModelExportOutputConfig other) { + if (other == com.google.cloud.automl.v1.ModelExportOutputConfig.getDefaultInstance()) + return this; + if (!other.getModelFormat().isEmpty()) { + modelFormat_ = other.modelFormat_; + onChanged(); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.ModelExportOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.ModelExportOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination( + com.google.cloud.automl.v1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ != com.google.cloud.automl.v1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.automl.v1.GcsDestination.newBuilder( + (com.google.cloud.automl.v1.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.automl.v1.GcsDestination) destination_; + } + return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Google Cloud Storage location where the model is to be
+     * written to. This location may only be set for the following model
+     * formats:
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+     *  Under the directory given as the destination a new one with name
+     *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+     *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+     *  will be created. Inside the model and any of its supporting files
+     *  will be written.
+     * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.automl.v1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.GcsDestination, + com.google.cloud.automl.v1.GcsDestination.Builder, + com.google.cloud.automl.v1.GcsDestinationOrBuilder>( + (com.google.cloud.automl.v1.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + ; + return gcsDestinationBuilder_; + } + + private java.lang.Object modelFormat_ = ""; + /** + * + * + *
+     * The format in which the model must be exported. The available, and default,
+     * formats depend on the problem and model type (if given problem and type
+     * combination doesn't have a format listed, it means its models are not
+     * exportable):
+     * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+     * *  For Image Classification mobile-core-ml-low-latency-1,
+     *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+     *      "core_ml" (default).
+     * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite", "tf_saved_model", "tf_js".
+     * Formats description:
+     * * tflite - Used for Android mobile devices.
+     * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+     *                    devices.
+     * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.x`
+     * * core_ml - Used for iOS mobile devices.
+     * 
+ * + * string model_format = 4; + */ + public java.lang.String getModelFormat() { + java.lang.Object ref = modelFormat_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelFormat_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The format in which the model must be exported. The available, and default,
+     * formats depend on the problem and model type (if given problem and type
+     * combination doesn't have a format listed, it means its models are not
+     * exportable):
+     * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+     * *  For Image Classification mobile-core-ml-low-latency-1,
+     *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+     *      "core_ml" (default).
+     * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite", "tf_saved_model", "tf_js".
+     * Formats description:
+     * * tflite - Used for Android mobile devices.
+     * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+     *                    devices.
+     * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.x`
+     * * core_ml - Used for iOS mobile devices.
+     * 
+ * + * string model_format = 4; + */ + public com.google.protobuf.ByteString getModelFormatBytes() { + java.lang.Object ref = modelFormat_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The format in which the model must be exported. The available, and default,
+     * formats depend on the problem and model type (if given problem and type
+     * combination doesn't have a format listed, it means its models are not
+     * exportable):
+     * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+     * *  For Image Classification mobile-core-ml-low-latency-1,
+     *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+     *      "core_ml" (default).
+     * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite", "tf_saved_model", "tf_js".
+     * Formats description:
+     * * tflite - Used for Android mobile devices.
+     * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+     *                    devices.
+     * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.x`
+     * * core_ml - Used for iOS mobile devices.
+     * 
+ * + * string model_format = 4; + */ + public Builder setModelFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + modelFormat_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The format in which the model must be exported. The available, and default,
+     * formats depend on the problem and model type (if given problem and type
+     * combination doesn't have a format listed, it means its models are not
+     * exportable):
+     * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+     * *  For Image Classification mobile-core-ml-low-latency-1,
+     *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+     *      "core_ml" (default).
+     * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite", "tf_saved_model", "tf_js".
+     * Formats description:
+     * * tflite - Used for Android mobile devices.
+     * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+     *                    devices.
+     * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.x`
+     * * core_ml - Used for iOS mobile devices.
+     * 
+ * + * string model_format = 4; + */ + public Builder clearModelFormat() { + + modelFormat_ = getDefaultInstance().getModelFormat(); + onChanged(); + return this; + } + /** + * + * + *
+     * The format in which the model must be exported. The available, and default,
+     * formats depend on the problem and model type (if given problem and type
+     * combination doesn't have a format listed, it means its models are not
+     * exportable):
+     * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+     * *  For Image Classification mobile-core-ml-low-latency-1,
+     *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+     *      "core_ml" (default).
+     * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+     *        mobile-high-accuracy-1:
+     *      "tflite", "tf_saved_model", "tf_js".
+     * Formats description:
+     * * tflite - Used for Android mobile devices.
+     * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+     *                    devices.
+     * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.x`
+     * * core_ml - Used for iOS mobile devices.
+     * 
+ * + * string model_format = 4; + */ + public Builder setModelFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + modelFormat_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + private com.google.protobuf.MapField + internalGetMutableParams() { + onChanged(); + ; + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public java.lang.String getParamsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public java.lang.String getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParams() { + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public Builder putParams(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional model-type and format specific parameters describing the
+     * requirements for the to be exported model files, any string must be up to
+     * 25000 characters long.
+     * 
+ * + * map<string, string> params = 2; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + 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.automl.v1.ModelExportOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ModelExportOutputConfig) + private static final com.google.cloud.automl.v1.ModelExportOutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ModelExportOutputConfig(); + } + + public static com.google.cloud.automl.v1.ModelExportOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModelExportOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ModelExportOutputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.ModelExportOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelExportOutputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelExportOutputConfigOrBuilder.java new file mode 100644 index 000000000..952aa5b7f --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelExportOutputConfigOrBuilder.java @@ -0,0 +1,213 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/io.proto + +package com.google.cloud.automl.v1; + +public interface ModelExportOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ModelExportOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Required. The Google Cloud Storage location where the model is to be
+   * written to. This location may only be set for the following model
+   * formats:
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
+   *  Under the directory given as the destination a new one with name
+   *  "model-export-<model-display-name>-<timestamp-of-export-call>",
+   *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
+   *  will be created. Inside the model and any of its supporting files
+   *  will be written.
+   * 
+ * + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * The format in which the model must be exported. The available, and default,
+   * formats depend on the problem and model type (if given problem and type
+   * combination doesn't have a format listed, it means its models are not
+   * exportable):
+   * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+   * *  For Image Classification mobile-core-ml-low-latency-1,
+   *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+   *      "core_ml" (default).
+   * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite", "tf_saved_model", "tf_js".
+   * Formats description:
+   * * tflite - Used for Android mobile devices.
+   * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+   *                    devices.
+   * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.x`
+   * * core_ml - Used for iOS mobile devices.
+   * 
+ * + * string model_format = 4; + */ + java.lang.String getModelFormat(); + /** + * + * + *
+   * The format in which the model must be exported. The available, and default,
+   * formats depend on the problem and model type (if given problem and type
+   * combination doesn't have a format listed, it means its models are not
+   * exportable):
+   * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js".
+   * *  For Image Classification mobile-core-ml-low-latency-1,
+   *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
+   *      "core_ml" (default).
+   * *  For Image Object Detection mobile-low-latency-1, mobile-versatile-1,
+   *        mobile-high-accuracy-1:
+   *      "tflite", "tf_saved_model", "tf_js".
+   * Formats description:
+   * * tflite - Used for Android mobile devices.
+   * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
+   *                    devices.
+   * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.x`
+   * * core_ml - Used for iOS mobile devices.
+   * 
+ * + * string model_format = 4; + */ + com.google.protobuf.ByteString getModelFormatBytes(); + + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + java.lang.String getParamsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Additional model-type and format specific parameters describing the
+   * requirements for the to be exported model files, any string must be up to
+   * 25000 characters long.
+   * 
+ * + * map<string, string> params = 2; + */ + java.lang.String getParamsOrThrow(java.lang.String key); + + public com.google.cloud.automl.v1.ModelExportOutputConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java index 4bd166f97..2dbc79179 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOrBuilder.java @@ -55,6 +55,191 @@ public interface ModelOrBuilder com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder getTranslationModelMetadataOrBuilder(); + /** + * + * + *
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + boolean hasImageClassificationModelMetadata(); + /** + * + * + *
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + com.google.cloud.automl.v1.ImageClassificationModelMetadata getImageClassificationModelMetadata(); + /** + * + * + *
+   * Metadata for image classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * + */ + com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder + getImageClassificationModelMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + boolean hasTextClassificationModelMetadata(); + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + com.google.cloud.automl.v1.TextClassificationModelMetadata getTextClassificationModelMetadata(); + /** + * + * + *
+   * Metadata for text classification models.
+   * 
+ * + * + * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * + */ + com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder + getTextClassificationModelMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + boolean hasImageObjectDetectionModelMetadata(); + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata + getImageObjectDetectionModelMetadata(); + /** + * + * + *
+   * Metadata for image object detection models.
+   * 
+ * + * + * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * + */ + com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder + getImageObjectDetectionModelMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + boolean hasTextExtractionModelMetadata(); + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + com.google.cloud.automl.v1.TextExtractionModelMetadata getTextExtractionModelMetadata(); + /** + * + * + *
+   * Metadata for text extraction models.
+   * 
+ * + * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * + */ + com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder + getTextExtractionModelMetadataOrBuilder(); + + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + boolean hasTextSentimentModelMetadata(); + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + com.google.cloud.automl.v1.TextSentimentModelMetadata getTextSentimentModelMetadata(); + /** + * + * + *
+   * Metadata for text sentiment models.
+   * 
+ * + * .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * + */ + com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder + getTextSentimentModelMetadataOrBuilder(); + /** * * @@ -213,6 +398,29 @@ public interface ModelOrBuilder */ com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState(); + /** + * + * + *
+   * Used to perform a consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 10; + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Used to perform a consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 10; + */ + com.google.protobuf.ByteString getEtagBytes(); + /** * * diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.java index e9c67bb40..a73259ebd 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/ModelOuterClass.java @@ -45,27 +45,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\"google/cloud/automl/v1/model.proto\022\026go" - + "ogle.cloud.automl.v1\032(google/cloud/autom" - + "l/v1/translation.proto\032\037google/protobuf/" - + "timestamp.proto\032\034google/api/annotations." - + "proto\"\221\004\n\005Model\022V\n\032translation_model_met" - + "adata\030\017 \001(\01320.google.cloud.automl.v1.Tra" - + "nslationModelMetadataH\000\022\014\n\004name\030\001 \001(\t\022\024\n" - + "\014display_name\030\002 \001(\t\022\022\n\ndataset_id\030\003 \001(\t\022" - + "/\n\013create_time\030\007 \001(\0132\032.google.protobuf.T" - + "imestamp\022/\n\013update_time\030\013 \001(\0132\032.google.p" - + "rotobuf.Timestamp\022G\n\020deployment_state\030\010 " - + "\001(\0162-.google.cloud.automl.v1.Model.Deplo" - + "ymentState\0229\n\006labels\030\" \003(\0132).google.clou" - + "d.automl.v1.Model.LabelsEntry\032-\n\013LabelsE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\017" - + "DeploymentState\022 \n\034DEPLOYMENT_STATE_UNSP" - + "ECIFIED\020\000\022\014\n\010DEPLOYED\020\001\022\016\n\nUNDEPLOYED\020\002B" - + "\020\n\016model_metadataB\252\001\n\032com.google.cloud.a" - + "utoml.v1P\001Z + * A vertex represents a 2D point in the image. + * The normalized vertex coordinates are between 0 to 1 fractions relative to + * the original plane (image, video). E.g. if the plane (e.g. whole image) would + * have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would + * be at the position (1, 6) on that plane. + *
+ * + * Protobuf type {@code google.cloud.automl.v1.NormalizedVertex} + */ +public final class NormalizedVertex extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.NormalizedVertex) + NormalizedVertexOrBuilder { + private static final long serialVersionUID = 0L; + // Use NormalizedVertex.newBuilder() to construct. + private NormalizedVertex(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NormalizedVertex() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NormalizedVertex( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + x_ = input.readFloat(); + break; + } + case 21: + { + y_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.NormalizedVertex.class, + com.google.cloud.automl.v1.NormalizedVertex.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_; + /** + * + * + *
+   * Required. Horizontal coordinate.
+   * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_; + /** + * + * + *
+   * Required. Vertical coordinate.
+   * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + + 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 (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, y_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.NormalizedVertex)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.NormalizedVertex other = + (com.google.cloud.automl.v1.NormalizedVertex) obj; + + if (java.lang.Float.floatToIntBits(getX()) != java.lang.Float.floatToIntBits(other.getX())) + return false; + if (java.lang.Float.floatToIntBits(getY()) != java.lang.Float.floatToIntBits(other.getY())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getY()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.NormalizedVertex parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.NormalizedVertex 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.automl.v1.NormalizedVertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.NormalizedVertex 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.automl.v1.NormalizedVertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.NormalizedVertex parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.NormalizedVertex parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.NormalizedVertex 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.automl.v1.NormalizedVertex parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.NormalizedVertex 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.automl.v1.NormalizedVertex parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.NormalizedVertex 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.automl.v1.NormalizedVertex prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A vertex represents a 2D point in the image.
+   * The normalized vertex coordinates are between 0 to 1 fractions relative to
+   * the original plane (image, video). E.g. if the plane (e.g. whole image) would
+   * have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would
+   * be at the position (1, 6) on that plane.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.NormalizedVertex} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.NormalizedVertex) + com.google.cloud.automl.v1.NormalizedVertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.NormalizedVertex.class, + com.google.cloud.automl.v1.NormalizedVertex.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.NormalizedVertex.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + x_ = 0F; + + y_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Geometry + .internal_static_google_cloud_automl_v1_NormalizedVertex_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.NormalizedVertex getDefaultInstanceForType() { + return com.google.cloud.automl.v1.NormalizedVertex.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.NormalizedVertex build() { + com.google.cloud.automl.v1.NormalizedVertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.NormalizedVertex buildPartial() { + com.google.cloud.automl.v1.NormalizedVertex result = + new com.google.cloud.automl.v1.NormalizedVertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.NormalizedVertex) { + return mergeFrom((com.google.cloud.automl.v1.NormalizedVertex) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.NormalizedVertex other) { + if (other == com.google.cloud.automl.v1.NormalizedVertex.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.NormalizedVertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.NormalizedVertex) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float x_; + /** + * + * + *
+     * Required. Horizontal coordinate.
+     * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + /** + * + * + *
+     * Required. Horizontal coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder setX(float value) { + + x_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Horizontal coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder clearX() { + + x_ = 0F; + onChanged(); + return this; + } + + private float y_; + /** + * + * + *
+     * Required. Vertical coordinate.
+     * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + /** + * + * + *
+     * Required. Vertical coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder setY(float value) { + + y_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Vertical coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder clearY() { + + y_ = 0F; + 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.automl.v1.NormalizedVertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.NormalizedVertex) + private static final com.google.cloud.automl.v1.NormalizedVertex DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.NormalizedVertex(); + } + + public static com.google.cloud.automl.v1.NormalizedVertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalizedVertex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedVertex(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.NormalizedVertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/NormalizedVertexOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/NormalizedVertexOrBuilder.java new file mode 100644 index 000000000..e9d457240 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/NormalizedVertexOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/geometry.proto + +package com.google.cloud.automl.v1; + +public interface NormalizedVertexOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.NormalizedVertex) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Horizontal coordinate.
+   * 
+ * + * float x = 1; + */ + float getX(); + + /** + * + * + *
+   * Required. Vertical coordinate.
+   * 
+ * + * float y = 2; + */ + float getY(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadata.java index 91f1979a3..9d88e3888 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadata.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadata.java @@ -67,9 +67,9 @@ private OperationMetadata( break; case 18: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000400) != 0)) { partialFailures_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000400; } partialFailures_.add( input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); @@ -148,6 +148,144 @@ private OperationMetadata( progressPercent_ = input.readInt32(); break; } + case 122: + { + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 15) { + subBuilder = + ((com.google.cloud.automl.v1.ImportDataOperationMetadata) details_).toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.ImportDataOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 15; + break; + } + case 130: + { + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 16) { + subBuilder = + ((com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 16; + break; + } + case 170: + { + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 21) { + subBuilder = + ((com.google.cloud.automl.v1.ExportDataOperationMetadata) details_).toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.ExportDataOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 21; + break; + } + case 178: + { + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 22) { + subBuilder = + ((com.google.cloud.automl.v1.ExportModelOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.ExportModelOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 22; + break; + } + case 194: + { + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 24) { + subBuilder = + ((com.google.cloud.automl.v1.DeployModelOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.DeployModelOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 24; + break; + } + case 202: + { + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 25) { + subBuilder = + ((com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.UndeployModelOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 25; + break; + } + case 242: + { + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder subBuilder = null; + if (detailsCase_ == 30) { + subBuilder = + ((com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_) + .toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 30; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -162,7 +300,7 @@ private OperationMetadata( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000400) != 0)) { partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); } this.unknownFields = unknownFields.build(); @@ -191,7 +329,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public enum DetailsCase implements com.google.protobuf.Internal.EnumLite { DELETE_DETAILS(8), + DEPLOY_MODEL_DETAILS(24), + UNDEPLOY_MODEL_DETAILS(25), CREATE_MODEL_DETAILS(10), + CREATE_DATASET_DETAILS(30), + IMPORT_DATA_DETAILS(15), + BATCH_PREDICT_DETAILS(16), + EXPORT_DATA_DETAILS(21), + EXPORT_MODEL_DETAILS(22), DETAILS_NOT_SET(0); private final int value; @@ -208,8 +353,22 @@ public static DetailsCase forNumber(int value) { switch (value) { case 8: return DELETE_DETAILS; + case 24: + return DEPLOY_MODEL_DETAILS; + case 25: + return UNDEPLOY_MODEL_DETAILS; case 10: return CREATE_MODEL_DETAILS; + case 30: + return CREATE_DATASET_DETAILS; + case 15: + return IMPORT_DATA_DETAILS; + case 16: + return BATCH_PREDICT_DETAILS; + case 21: + return EXPORT_DATA_DETAILS; + case 22: + return EXPORT_MODEL_DETAILS; case 0: return DETAILS_NOT_SET; default: @@ -270,6 +429,99 @@ public com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDeta return com.google.cloud.automl.v1.DeleteOperationMetadata.getDefaultInstance(); } + public static final int DEPLOY_MODEL_DETAILS_FIELD_NUMBER = 24; + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + public boolean hasDeployModelDetails() { + return detailsCase_ == 24; + } + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + public com.google.cloud.automl.v1.DeployModelOperationMetadata getDeployModelDetails() { + if (detailsCase_ == 24) { + return (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + public com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder + getDeployModelDetailsOrBuilder() { + if (detailsCase_ == 24) { + return (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); + } + + public static final int UNDEPLOY_MODEL_DETAILS_FIELD_NUMBER = 25; + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public boolean hasUndeployModelDetails() { + return detailsCase_ == 25; + } + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public com.google.cloud.automl.v1.UndeployModelOperationMetadata getUndeployModelDetails() { + if (detailsCase_ == 25) { + return (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder + getUndeployModelDetailsOrBuilder() { + if (detailsCase_ == 25) { + return (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + public static final int CREATE_MODEL_DETAILS_FIELD_NUMBER = 10; /** * @@ -315,197 +567,425 @@ public com.google.cloud.automl.v1.CreateModelOperationMetadata getCreateModelDet return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); } - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 13; - private int progressPercent_; + public static final int CREATE_DATASET_DETAILS_FIELD_NUMBER = 30; /** * * *
-   * Output only. Progress of operation. Range: [0, 100].
-   * Not used currently.
+   * Details of CreateDataset operation.
    * 
* - * int32 progress_percent = 13; + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * */ - public int getProgressPercent() { - return progressPercent_; + public boolean hasCreateDatasetDetails() { + return detailsCase_ == 30; } - - public static final int PARTIAL_FAILURES_FIELD_NUMBER = 2; - private java.util.List partialFailures_; /** * * *
-   * Output only. Partial failures encountered.
-   * E.g. single files that couldn't be read.
-   * This field should never exceed 20 entries.
-   * Status details field will contain standard GCP error details.
+   * Details of CreateDataset operation.
    * 
* - * repeated .google.rpc.Status partial_failures = 2; + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * */ - public java.util.List getPartialFailuresList() { - return partialFailures_; + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata getCreateDatasetDetails() { + if (detailsCase_ == 30) { + return (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); } /** * * *
-   * Output only. Partial failures encountered.
-   * E.g. single files that couldn't be read.
-   * This field should never exceed 20 entries.
-   * Status details field will contain standard GCP error details.
+   * Details of CreateDataset operation.
    * 
* - * repeated .google.rpc.Status partial_failures = 2; + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * */ - public java.util.List - getPartialFailuresOrBuilderList() { - return partialFailures_; + public com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder + getCreateDatasetDetailsOrBuilder() { + if (detailsCase_ == 30) { + return (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); } + + public static final int IMPORT_DATA_DETAILS_FIELD_NUMBER = 15; /** * * *
-   * Output only. Partial failures encountered.
-   * E.g. single files that couldn't be read.
-   * This field should never exceed 20 entries.
-   * Status details field will contain standard GCP error details.
+   * Details of ImportData operation.
    * 
* - * repeated .google.rpc.Status partial_failures = 2; + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; */ - public int getPartialFailuresCount() { - return partialFailures_.size(); + public boolean hasImportDataDetails() { + return detailsCase_ == 15; } /** * * *
-   * Output only. Partial failures encountered.
-   * E.g. single files that couldn't be read.
-   * This field should never exceed 20 entries.
-   * Status details field will contain standard GCP error details.
+   * Details of ImportData operation.
    * 
* - * repeated .google.rpc.Status partial_failures = 2; + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; */ - public com.google.rpc.Status getPartialFailures(int index) { - return partialFailures_.get(index); + public com.google.cloud.automl.v1.ImportDataOperationMetadata getImportDataDetails() { + if (detailsCase_ == 15) { + return (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); } /** * * *
-   * Output only. Partial failures encountered.
-   * E.g. single files that couldn't be read.
-   * This field should never exceed 20 entries.
-   * Status details field will contain standard GCP error details.
+   * Details of ImportData operation.
    * 
* - * repeated .google.rpc.Status partial_failures = 2; + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; */ - public com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index) { - return partialFailures_.get(index); + public com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder + getImportDataDetailsOrBuilder() { + if (detailsCase_ == 15) { + return (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); } - public static final int CREATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp createTime_; + public static final int BATCH_PREDICT_DETAILS_FIELD_NUMBER = 16; /** * * *
-   * Output only. Time when the operation was created.
+   * Details of BatchPredict operation.
    * 
* - * .google.protobuf.Timestamp create_time = 3; + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; */ - public boolean hasCreateTime() { - return createTime_ != null; + public boolean hasBatchPredictDetails() { + return detailsCase_ == 16; } /** * * *
-   * Output only. Time when the operation was created.
+   * Details of BatchPredict operation.
    * 
* - * .google.protobuf.Timestamp create_time = 3; + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; */ - public com.google.protobuf.Timestamp getCreateTime() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + public com.google.cloud.automl.v1.BatchPredictOperationMetadata getBatchPredictDetails() { + if (detailsCase_ == 16) { + return (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_; + } + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); } /** * * *
-   * Output only. Time when the operation was created.
+   * Details of BatchPredict operation.
    * 
* - * .google.protobuf.Timestamp create_time = 3; + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; */ - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + public com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder + getBatchPredictDetailsOrBuilder() { + if (detailsCase_ == 16) { + return (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_; + } + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); } - public static final int UPDATE_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Timestamp updateTime_; + public static final int EXPORT_DATA_DETAILS_FIELD_NUMBER = 21; /** * * *
-   * Output only. Time when the operation was updated for the last time.
+   * Details of ExportData operation.
    * 
* - * .google.protobuf.Timestamp update_time = 4; + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; */ - public boolean hasUpdateTime() { - return updateTime_ != null; + public boolean hasExportDataDetails() { + return detailsCase_ == 21; } /** * * *
-   * Output only. Time when the operation was updated for the last time.
+   * Details of ExportData operation.
    * 
* - * .google.protobuf.Timestamp update_time = 4; + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; */ - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + public com.google.cloud.automl.v1.ExportDataOperationMetadata getExportDataDetails() { + if (detailsCase_ == 21) { + return (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); } /** * * *
-   * Output only. Time when the operation was updated for the last time.
+   * Details of ExportData operation.
    * 
* - * .google.protobuf.Timestamp update_time = 4; + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); + public com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder + getExportDataDetailsOrBuilder() { + if (detailsCase_ == 21) { + return (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); } - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public static final int EXPORT_MODEL_DETAILS_FIELD_NUMBER = 22; + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public boolean hasExportModelDetails() { + return detailsCase_ == 22; } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < partialFailures_.size(); i++) { - output.writeMessage(2, partialFailures_.get(i)); + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata getExportModelDetails() { + if (detailsCase_ == 22) { + return (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_; } - if (createTime_ != null) { + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder + getExportModelDetailsOrBuilder() { + if (detailsCase_ == 22) { + return (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 13; + private int progressPercent_; + /** + * + * + *
+   * Output only. Progress of operation. Range: [0, 100].
+   * Not used currently.
+   * 
+ * + * int32 progress_percent = 13; + */ + public int getProgressPercent() { + return progressPercent_; + } + + public static final int PARTIAL_FAILURES_FIELD_NUMBER = 2; + private java.util.List partialFailures_; + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard GCP error details.
+   * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public java.util.List getPartialFailuresList() { + return partialFailures_; + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard GCP error details.
+   * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public java.util.List + getPartialFailuresOrBuilderList() { + return partialFailures_; + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard GCP error details.
+   * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public int getPartialFailuresCount() { + return partialFailures_.size(); + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard GCP error details.
+   * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public com.google.rpc.Status getPartialFailures(int index) { + return partialFailures_.get(index); + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard GCP error details.
+   * 
+ * + * repeated .google.rpc.Status partial_failures = 2; + */ + public com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index) { + return partialFailures_.get(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 < partialFailures_.size(); i++) { + output.writeMessage(2, partialFailures_.get(i)); + } + if (createTime_ != null) { output.writeMessage(3, getCreateTime()); } if (updateTime_ != null) { @@ -520,6 +1000,27 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (progressPercent_ != 0) { output.writeInt32(13, progressPercent_); } + if (detailsCase_ == 15) { + output.writeMessage(15, (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_); + } + if (detailsCase_ == 16) { + output.writeMessage(16, (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_); + } + if (detailsCase_ == 21) { + output.writeMessage(21, (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_); + } + if (detailsCase_ == 22) { + output.writeMessage(22, (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_); + } + if (detailsCase_ == 24) { + output.writeMessage(24, (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_); + } + if (detailsCase_ == 25) { + output.writeMessage(25, (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_); + } + if (detailsCase_ == 30) { + output.writeMessage(30, (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_); + } unknownFields.writeTo(output); } @@ -551,6 +1052,41 @@ public int getSerializedSize() { if (progressPercent_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(13, progressPercent_); } + if (detailsCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_); + } + if (detailsCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_); + } + if (detailsCase_ == 21) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 21, (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_); + } + if (detailsCase_ == 22) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 22, (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_); + } + if (detailsCase_ == 24) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_); + } + if (detailsCase_ == 25) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 25, (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_); + } + if (detailsCase_ == 30) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 30, (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -582,9 +1118,30 @@ public boolean equals(final java.lang.Object obj) { case 8: if (!getDeleteDetails().equals(other.getDeleteDetails())) return false; break; + case 24: + if (!getDeployModelDetails().equals(other.getDeployModelDetails())) return false; + break; + case 25: + if (!getUndeployModelDetails().equals(other.getUndeployModelDetails())) return false; + break; case 10: if (!getCreateModelDetails().equals(other.getCreateModelDetails())) return false; break; + case 30: + if (!getCreateDatasetDetails().equals(other.getCreateDatasetDetails())) return false; + break; + case 15: + if (!getImportDataDetails().equals(other.getImportDataDetails())) return false; + break; + case 16: + if (!getBatchPredictDetails().equals(other.getBatchPredictDetails())) return false; + break; + case 21: + if (!getExportDataDetails().equals(other.getExportDataDetails())) return false; + break; + case 22: + if (!getExportModelDetails().equals(other.getExportModelDetails())) return false; + break; case 0: default: } @@ -618,10 +1175,38 @@ public int hashCode() { hash = (37 * hash) + DELETE_DETAILS_FIELD_NUMBER; hash = (53 * hash) + getDeleteDetails().hashCode(); break; + case 24: + hash = (37 * hash) + DEPLOY_MODEL_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDeployModelDetails().hashCode(); + break; + case 25: + hash = (37 * hash) + UNDEPLOY_MODEL_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getUndeployModelDetails().hashCode(); + break; case 10: hash = (37 * hash) + CREATE_MODEL_DETAILS_FIELD_NUMBER; hash = (53 * hash) + getCreateModelDetails().hashCode(); break; + case 30: + hash = (37 * hash) + CREATE_DATASET_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getCreateDatasetDetails().hashCode(); + break; + case 15: + hash = (37 * hash) + IMPORT_DATA_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getImportDataDetails().hashCode(); + break; + case 16: + hash = (37 * hash) + BATCH_PREDICT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getBatchPredictDetails().hashCode(); + break; + case 21: + hash = (37 * hash) + EXPORT_DATA_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getExportDataDetails().hashCode(); + break; + case 22: + hash = (37 * hash) + EXPORT_MODEL_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getExportModelDetails().hashCode(); + break; case 0: default: } @@ -776,7 +1361,7 @@ public Builder clear() { if (partialFailuresBuilder_ == null) { partialFailures_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000400); } else { partialFailuresBuilder_.clear(); } @@ -830,6 +1415,20 @@ public com.google.cloud.automl.v1.OperationMetadata buildPartial() { result.details_ = deleteDetailsBuilder_.build(); } } + if (detailsCase_ == 24) { + if (deployModelDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = deployModelDetailsBuilder_.build(); + } + } + if (detailsCase_ == 25) { + if (undeployModelDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = undeployModelDetailsBuilder_.build(); + } + } if (detailsCase_ == 10) { if (createModelDetailsBuilder_ == null) { result.details_ = details_; @@ -837,12 +1436,47 @@ public com.google.cloud.automl.v1.OperationMetadata buildPartial() { result.details_ = createModelDetailsBuilder_.build(); } } - result.progressPercent_ = progressPercent_; - if (partialFailuresBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); - bitField0_ = (bitField0_ & ~0x00000008); - } + if (detailsCase_ == 30) { + if (createDatasetDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = createDatasetDetailsBuilder_.build(); + } + } + if (detailsCase_ == 15) { + if (importDataDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = importDataDetailsBuilder_.build(); + } + } + if (detailsCase_ == 16) { + if (batchPredictDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = batchPredictDetailsBuilder_.build(); + } + } + if (detailsCase_ == 21) { + if (exportDataDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = exportDataDetailsBuilder_.build(); + } + } + if (detailsCase_ == 22) { + if (exportModelDetailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = exportModelDetailsBuilder_.build(); + } + } + result.progressPercent_ = progressPercent_; + if (partialFailuresBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); + bitField0_ = (bitField0_ & ~0x00000400); + } result.partialFailures_ = partialFailures_; } else { result.partialFailures_ = partialFailuresBuilder_.build(); @@ -915,7 +1549,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1.OperationMetadata other) { if (!other.partialFailures_.isEmpty()) { if (partialFailures_.isEmpty()) { partialFailures_ = other.partialFailures_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000400); } else { ensurePartialFailuresIsMutable(); partialFailures_.addAll(other.partialFailures_); @@ -928,7 +1562,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1.OperationMetadata other) { partialFailuresBuilder_.dispose(); partialFailuresBuilder_ = null; partialFailures_ = other.partialFailures_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000400); partialFailuresBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPartialFailuresFieldBuilder() @@ -950,11 +1584,46 @@ public Builder mergeFrom(com.google.cloud.automl.v1.OperationMetadata other) { mergeDeleteDetails(other.getDeleteDetails()); break; } + case DEPLOY_MODEL_DETAILS: + { + mergeDeployModelDetails(other.getDeployModelDetails()); + break; + } + case UNDEPLOY_MODEL_DETAILS: + { + mergeUndeployModelDetails(other.getUndeployModelDetails()); + break; + } case CREATE_MODEL_DETAILS: { mergeCreateModelDetails(other.getCreateModelDetails()); break; } + case CREATE_DATASET_DETAILS: + { + mergeCreateDatasetDetails(other.getCreateDatasetDetails()); + break; + } + case IMPORT_DATA_DETAILS: + { + mergeImportDataDetails(other.getImportDataDetails()); + break; + } + case BATCH_PREDICT_DETAILS: + { + mergeBatchPredictDetails(other.getBatchPredictDetails()); + break; + } + case EXPORT_DATA_DETAILS: + { + mergeExportDataDetails(other.getExportDataDetails()); + break; + } + case EXPORT_MODEL_DETAILS: + { + mergeExportModelDetails(other.getExportModelDetails()); + break; + } case DETAILS_NOT_SET: { break; @@ -1209,105 +1878,105 @@ public com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDeta } private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.CreateModelOperationMetadata, - com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, - com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder> - createModelDetailsBuilder_; + com.google.cloud.automl.v1.DeployModelOperationMetadata, + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder> + deployModelDetailsBuilder_; /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public boolean hasCreateModelDetails() { - return detailsCase_ == 10; + public boolean hasDeployModelDetails() { + return detailsCase_ == 24; } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public com.google.cloud.automl.v1.CreateModelOperationMetadata getCreateModelDetails() { - if (createModelDetailsBuilder_ == null) { - if (detailsCase_ == 10) { - return (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_; + public com.google.cloud.automl.v1.DeployModelOperationMetadata getDeployModelDetails() { + if (deployModelDetailsBuilder_ == null) { + if (detailsCase_ == 24) { + return (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_; } - return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); } else { - if (detailsCase_ == 10) { - return createModelDetailsBuilder_.getMessage(); + if (detailsCase_ == 24) { + return deployModelDetailsBuilder_.getMessage(); } - return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); } } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public Builder setCreateModelDetails( - com.google.cloud.automl.v1.CreateModelOperationMetadata value) { - if (createModelDetailsBuilder_ == null) { + public Builder setDeployModelDetails( + com.google.cloud.automl.v1.DeployModelOperationMetadata value) { + if (deployModelDetailsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } details_ = value; onChanged(); } else { - createModelDetailsBuilder_.setMessage(value); + deployModelDetailsBuilder_.setMessage(value); } - detailsCase_ = 10; + detailsCase_ = 24; return this; } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public Builder setCreateModelDetails( - com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder builderForValue) { - if (createModelDetailsBuilder_ == null) { + public Builder setDeployModelDetails( + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder builderForValue) { + if (deployModelDetailsBuilder_ == null) { details_ = builderForValue.build(); onChanged(); } else { - createModelDetailsBuilder_.setMessage(builderForValue.build()); + deployModelDetailsBuilder_.setMessage(builderForValue.build()); } - detailsCase_ = 10; + detailsCase_ = 24; return this; } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public Builder mergeCreateModelDetails( - com.google.cloud.automl.v1.CreateModelOperationMetadata value) { - if (createModelDetailsBuilder_ == null) { - if (detailsCase_ == 10 + public Builder mergeDeployModelDetails( + com.google.cloud.automl.v1.DeployModelOperationMetadata value) { + if (deployModelDetailsBuilder_ == null) { + if (detailsCase_ == 24 && details_ - != com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance()) { + != com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance()) { details_ = - com.google.cloud.automl.v1.CreateModelOperationMetadata.newBuilder( - (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_) + com.google.cloud.automl.v1.DeployModelOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_) .mergeFrom(value) .buildPartial(); } else { @@ -1315,36 +1984,36 @@ public Builder mergeCreateModelDetails( } onChanged(); } else { - if (detailsCase_ == 10) { - createModelDetailsBuilder_.mergeFrom(value); + if (detailsCase_ == 24) { + deployModelDetailsBuilder_.mergeFrom(value); } - createModelDetailsBuilder_.setMessage(value); + deployModelDetailsBuilder_.setMessage(value); } - detailsCase_ = 10; + detailsCase_ = 24; return this; } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public Builder clearCreateModelDetails() { - if (createModelDetailsBuilder_ == null) { - if (detailsCase_ == 10) { + public Builder clearDeployModelDetails() { + if (deployModelDetailsBuilder_ == null) { + if (detailsCase_ == 24) { detailsCase_ = 0; details_ = null; onChanged(); } } else { - if (detailsCase_ == 10) { + if (detailsCase_ == 24) { detailsCase_ = 0; details_ = null; } - createModelDetailsBuilder_.clear(); + deployModelDetailsBuilder_.clear(); } return this; } @@ -1352,67 +2021,1543 @@ public Builder clearCreateModelDetails() { * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder - getCreateModelDetailsBuilder() { - return getCreateModelDetailsFieldBuilder().getBuilder(); + public com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder + getDeployModelDetailsBuilder() { + return getDeployModelDetailsFieldBuilder().getBuilder(); } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ - public com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder - getCreateModelDetailsOrBuilder() { - if ((detailsCase_ == 10) && (createModelDetailsBuilder_ != null)) { - return createModelDetailsBuilder_.getMessageOrBuilder(); + public com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder + getDeployModelDetailsOrBuilder() { + if ((detailsCase_ == 24) && (deployModelDetailsBuilder_ != null)) { + return deployModelDetailsBuilder_.getMessageOrBuilder(); } else { - if (detailsCase_ == 10) { - return (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_; + if (detailsCase_ == 24) { + return (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_; } - return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + return com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); } } /** * * *
-     * Details of CreateModel operation.
+     * Details of a DeployModel operation.
      * 
* - * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.CreateModelOperationMetadata, - com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, - com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder> - getCreateModelDetailsFieldBuilder() { - if (createModelDetailsBuilder_ == null) { - if (!(detailsCase_ == 10)) { - details_ = com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + com.google.cloud.automl.v1.DeployModelOperationMetadata, + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder> + getDeployModelDetailsFieldBuilder() { + if (deployModelDetailsBuilder_ == null) { + if (!(detailsCase_ == 24)) { + details_ = com.google.cloud.automl.v1.DeployModelOperationMetadata.getDefaultInstance(); } - createModelDetailsBuilder_ = + deployModelDetailsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1.CreateModelOperationMetadata, - com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, - com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder>( - (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_, + com.google.cloud.automl.v1.DeployModelOperationMetadata, + com.google.cloud.automl.v1.DeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.DeployModelOperationMetadata) details_, getParentForChildren(), isClean()); details_ = null; } - detailsCase_ = 10; + detailsCase_ = 24; onChanged(); ; - return createModelDetailsBuilder_; + return deployModelDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.UndeployModelOperationMetadata, + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder> + undeployModelDetailsBuilder_; + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public boolean hasUndeployModelDetails() { + return detailsCase_ == 25; + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public com.google.cloud.automl.v1.UndeployModelOperationMetadata getUndeployModelDetails() { + if (undeployModelDetailsBuilder_ == null) { + if (detailsCase_ == 25) { + return (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 25) { + return undeployModelDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public Builder setUndeployModelDetails( + com.google.cloud.automl.v1.UndeployModelOperationMetadata value) { + if (undeployModelDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + undeployModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 25; + return this; + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public Builder setUndeployModelDetails( + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder builderForValue) { + if (undeployModelDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + undeployModelDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 25; + return this; + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public Builder mergeUndeployModelDetails( + com.google.cloud.automl.v1.UndeployModelOperationMetadata value) { + if (undeployModelDetailsBuilder_ == null) { + if (detailsCase_ == 25 + && details_ + != com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.UndeployModelOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 25) { + undeployModelDetailsBuilder_.mergeFrom(value); + } + undeployModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 25; + return this; + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public Builder clearUndeployModelDetails() { + if (undeployModelDetailsBuilder_ == null) { + if (detailsCase_ == 25) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 25) { + detailsCase_ = 0; + details_ = null; + } + undeployModelDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder + getUndeployModelDetailsBuilder() { + return getUndeployModelDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + public com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder + getUndeployModelDetailsOrBuilder() { + if ((detailsCase_ == 25) && (undeployModelDetailsBuilder_ != null)) { + return undeployModelDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 25) { + return (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of an UndeployModel operation.
+     * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.UndeployModelOperationMetadata, + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder> + getUndeployModelDetailsFieldBuilder() { + if (undeployModelDetailsBuilder_ == null) { + if (!(detailsCase_ == 25)) { + details_ = com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + undeployModelDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.UndeployModelOperationMetadata, + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder, + com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.UndeployModelOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 25; + onChanged(); + ; + return undeployModelDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateModelOperationMetadata, + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder> + createModelDetailsBuilder_; + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public boolean hasCreateModelDetails() { + return detailsCase_ == 10; + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1.CreateModelOperationMetadata getCreateModelDetails() { + if (createModelDetailsBuilder_ == null) { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 10) { + return createModelDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder setCreateModelDetails( + com.google.cloud.automl.v1.CreateModelOperationMetadata value) { + if (createModelDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + createModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 10; + return this; + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder setCreateModelDetails( + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder builderForValue) { + if (createModelDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + createModelDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 10; + return this; + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder mergeCreateModelDetails( + com.google.cloud.automl.v1.CreateModelOperationMetadata value) { + if (createModelDetailsBuilder_ == null) { + if (detailsCase_ == 10 + && details_ + != com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.CreateModelOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 10) { + createModelDetailsBuilder_.mergeFrom(value); + } + createModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 10; + return this; + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public Builder clearCreateModelDetails() { + if (createModelDetailsBuilder_ == null) { + if (detailsCase_ == 10) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 10) { + detailsCase_ = 0; + details_ = null; + } + createModelDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder + getCreateModelDetailsBuilder() { + return getCreateModelDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + public com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder + getCreateModelDetailsOrBuilder() { + if ((detailsCase_ == 10) && (createModelDetailsBuilder_ != null)) { + return createModelDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 10) { + return (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of CreateModel operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateModelOperationMetadata, + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder> + getCreateModelDetailsFieldBuilder() { + if (createModelDetailsBuilder_ == null) { + if (!(detailsCase_ == 10)) { + details_ = com.google.cloud.automl.v1.CreateModelOperationMetadata.getDefaultInstance(); + } + createModelDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateModelOperationMetadata, + com.google.cloud.automl.v1.CreateModelOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.CreateModelOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 10; + onChanged(); + ; + return createModelDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateDatasetOperationMetadata, + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder> + createDatasetDetailsBuilder_; + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public boolean hasCreateDatasetDetails() { + return detailsCase_ == 30; + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata getCreateDatasetDetails() { + if (createDatasetDetailsBuilder_ == null) { + if (detailsCase_ == 30) { + return (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 30) { + return createDatasetDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public Builder setCreateDatasetDetails( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata value) { + if (createDatasetDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + createDatasetDetailsBuilder_.setMessage(value); + } + detailsCase_ = 30; + return this; + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public Builder setCreateDatasetDetails( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder builderForValue) { + if (createDatasetDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + createDatasetDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 30; + return this; + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public Builder mergeCreateDatasetDetails( + com.google.cloud.automl.v1.CreateDatasetOperationMetadata value) { + if (createDatasetDetailsBuilder_ == null) { + if (detailsCase_ == 30 + && details_ + != com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 30) { + createDatasetDetailsBuilder_.mergeFrom(value); + } + createDatasetDetailsBuilder_.setMessage(value); + } + detailsCase_ = 30; + return this; + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public Builder clearCreateDatasetDetails() { + if (createDatasetDetailsBuilder_ == null) { + if (detailsCase_ == 30) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 30) { + detailsCase_ = 0; + details_ = null; + } + createDatasetDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder + getCreateDatasetDetailsBuilder() { + return getCreateDatasetDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + public com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder + getCreateDatasetDetailsOrBuilder() { + if ((detailsCase_ == 30) && (createDatasetDetailsBuilder_ != null)) { + return createDatasetDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 30) { + return (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_; + } + return com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of CreateDataset operation.
+     * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateDatasetOperationMetadata, + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder> + getCreateDatasetDetailsFieldBuilder() { + if (createDatasetDetailsBuilder_ == null) { + if (!(detailsCase_ == 30)) { + details_ = com.google.cloud.automl.v1.CreateDatasetOperationMetadata.getDefaultInstance(); + } + createDatasetDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.CreateDatasetOperationMetadata, + com.google.cloud.automl.v1.CreateDatasetOperationMetadata.Builder, + com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.CreateDatasetOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 30; + onChanged(); + ; + return createDatasetDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImportDataOperationMetadata, + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder> + importDataDetailsBuilder_; + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public boolean hasImportDataDetails() { + return detailsCase_ == 15; + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public com.google.cloud.automl.v1.ImportDataOperationMetadata getImportDataDetails() { + if (importDataDetailsBuilder_ == null) { + if (detailsCase_ == 15) { + return (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 15) { + return importDataDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public Builder setImportDataDetails( + com.google.cloud.automl.v1.ImportDataOperationMetadata value) { + if (importDataDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + importDataDetailsBuilder_.setMessage(value); + } + detailsCase_ = 15; + return this; + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public Builder setImportDataDetails( + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder builderForValue) { + if (importDataDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + importDataDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 15; + return this; + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public Builder mergeImportDataDetails( + com.google.cloud.automl.v1.ImportDataOperationMetadata value) { + if (importDataDetailsBuilder_ == null) { + if (detailsCase_ == 15 + && details_ + != com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.ImportDataOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 15) { + importDataDetailsBuilder_.mergeFrom(value); + } + importDataDetailsBuilder_.setMessage(value); + } + detailsCase_ = 15; + return this; + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public Builder clearImportDataDetails() { + if (importDataDetailsBuilder_ == null) { + if (detailsCase_ == 15) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 15) { + detailsCase_ = 0; + details_ = null; + } + importDataDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder + getImportDataDetailsBuilder() { + return getImportDataDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + public com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder + getImportDataDetailsOrBuilder() { + if ((detailsCase_ == 15) && (importDataDetailsBuilder_ != null)) { + return importDataDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 15) { + return (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ImportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImportDataOperationMetadata, + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder> + getImportDataDetailsFieldBuilder() { + if (importDataDetailsBuilder_ == null) { + if (!(detailsCase_ == 15)) { + details_ = com.google.cloud.automl.v1.ImportDataOperationMetadata.getDefaultInstance(); + } + importDataDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ImportDataOperationMetadata, + com.google.cloud.automl.v1.ImportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.ImportDataOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 15; + onChanged(); + ; + return importDataDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder> + batchPredictDetailsBuilder_; + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public boolean hasBatchPredictDetails() { + return detailsCase_ == 16; + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata getBatchPredictDetails() { + if (batchPredictDetailsBuilder_ == null) { + if (detailsCase_ == 16) { + return (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_; + } + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 16) { + return batchPredictDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public Builder setBatchPredictDetails( + com.google.cloud.automl.v1.BatchPredictOperationMetadata value) { + if (batchPredictDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + batchPredictDetailsBuilder_.setMessage(value); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public Builder setBatchPredictDetails( + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder builderForValue) { + if (batchPredictDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + batchPredictDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public Builder mergeBatchPredictDetails( + com.google.cloud.automl.v1.BatchPredictOperationMetadata value) { + if (batchPredictDetailsBuilder_ == null) { + if (detailsCase_ == 16 + && details_ + != com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.BatchPredictOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 16) { + batchPredictDetailsBuilder_.mergeFrom(value); + } + batchPredictDetailsBuilder_.setMessage(value); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public Builder clearBatchPredictDetails() { + if (batchPredictDetailsBuilder_ == null) { + if (detailsCase_ == 16) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 16) { + detailsCase_ = 0; + details_ = null; + } + batchPredictDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder + getBatchPredictDetailsBuilder() { + return getBatchPredictDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + public com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder + getBatchPredictDetailsOrBuilder() { + if ((detailsCase_ == 16) && (batchPredictDetailsBuilder_ != null)) { + return batchPredictDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 16) { + return (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_; + } + return com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of BatchPredict operation.
+     * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder> + getBatchPredictDetailsFieldBuilder() { + if (batchPredictDetailsBuilder_ == null) { + if (!(detailsCase_ == 16)) { + details_ = com.google.cloud.automl.v1.BatchPredictOperationMetadata.getDefaultInstance(); + } + batchPredictDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.BatchPredictOperationMetadata, + com.google.cloud.automl.v1.BatchPredictOperationMetadata.Builder, + com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.BatchPredictOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 16; + onChanged(); + ; + return batchPredictDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata, + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder> + exportDataDetailsBuilder_; + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public boolean hasExportDataDetails() { + return detailsCase_ == 21; + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata getExportDataDetails() { + if (exportDataDetailsBuilder_ == null) { + if (detailsCase_ == 21) { + return (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 21) { + return exportDataDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public Builder setExportDataDetails( + com.google.cloud.automl.v1.ExportDataOperationMetadata value) { + if (exportDataDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + exportDataDetailsBuilder_.setMessage(value); + } + detailsCase_ = 21; + return this; + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public Builder setExportDataDetails( + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder builderForValue) { + if (exportDataDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + exportDataDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 21; + return this; + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public Builder mergeExportDataDetails( + com.google.cloud.automl.v1.ExportDataOperationMetadata value) { + if (exportDataDetailsBuilder_ == null) { + if (detailsCase_ == 21 + && details_ + != com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.ExportDataOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 21) { + exportDataDetailsBuilder_.mergeFrom(value); + } + exportDataDetailsBuilder_.setMessage(value); + } + detailsCase_ = 21; + return this; + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public Builder clearExportDataDetails() { + if (exportDataDetailsBuilder_ == null) { + if (detailsCase_ == 21) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 21) { + detailsCase_ = 0; + details_ = null; + } + exportDataDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder + getExportDataDetailsBuilder() { + return getExportDataDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + public com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder + getExportDataDetailsOrBuilder() { + if ((detailsCase_ == 21) && (exportDataDetailsBuilder_ != null)) { + return exportDataDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 21) { + return (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ExportData operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata, + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder> + getExportDataDetailsFieldBuilder() { + if (exportDataDetailsBuilder_ == null) { + if (!(detailsCase_ == 21)) { + details_ = com.google.cloud.automl.v1.ExportDataOperationMetadata.getDefaultInstance(); + } + exportDataDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportDataOperationMetadata, + com.google.cloud.automl.v1.ExportDataOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.ExportDataOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 21; + onChanged(); + ; + return exportDataDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata, + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder> + exportModelDetailsBuilder_; + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public boolean hasExportModelDetails() { + return detailsCase_ == 22; + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata getExportModelDetails() { + if (exportModelDetailsBuilder_ == null) { + if (detailsCase_ == 22) { + return (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } else { + if (detailsCase_ == 22) { + return exportModelDetailsBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public Builder setExportModelDetails( + com.google.cloud.automl.v1.ExportModelOperationMetadata value) { + if (exportModelDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + exportModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 22; + return this; + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public Builder setExportModelDetails( + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder builderForValue) { + if (exportModelDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + exportModelDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 22; + return this; + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public Builder mergeExportModelDetails( + com.google.cloud.automl.v1.ExportModelOperationMetadata value) { + if (exportModelDetailsBuilder_ == null) { + if (detailsCase_ == 22 + && details_ + != com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance()) { + details_ = + com.google.cloud.automl.v1.ExportModelOperationMetadata.newBuilder( + (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 22) { + exportModelDetailsBuilder_.mergeFrom(value); + } + exportModelDetailsBuilder_.setMessage(value); + } + detailsCase_ = 22; + return this; + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public Builder clearExportModelDetails() { + if (exportModelDetailsBuilder_ == null) { + if (detailsCase_ == 22) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 22) { + detailsCase_ = 0; + details_ = null; + } + exportModelDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder + getExportModelDetailsBuilder() { + return getExportModelDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + public com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder + getExportModelDetailsOrBuilder() { + if ((detailsCase_ == 22) && (exportModelDetailsBuilder_ != null)) { + return exportModelDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 22) { + return (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_; + } + return com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Details of ExportModel operation.
+     * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata, + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder> + getExportModelDetailsFieldBuilder() { + if (exportModelDetailsBuilder_ == null) { + if (!(detailsCase_ == 22)) { + details_ = com.google.cloud.automl.v1.ExportModelOperationMetadata.getDefaultInstance(); + } + exportModelDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExportModelOperationMetadata, + com.google.cloud.automl.v1.ExportModelOperationMetadata.Builder, + com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder>( + (com.google.cloud.automl.v1.ExportModelOperationMetadata) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 22; + onChanged(); + ; + return exportModelDetailsBuilder_; } private int progressPercent_; @@ -1466,9 +3611,9 @@ public Builder clearProgressPercent() { java.util.Collections.emptyList(); private void ensurePartialFailuresIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000400) != 0)) { partialFailures_ = new java.util.ArrayList(partialFailures_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000400; } } @@ -1712,7 +3857,7 @@ public Builder addAllPartialFailures( public Builder clearPartialFailures() { if (partialFailuresBuilder_ == null) { partialFailures_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { partialFailuresBuilder_.clear(); @@ -1853,7 +3998,7 @@ public java.util.List getPartialFailuresBuilderLi com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( partialFailures_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); partialFailures_ = null; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java index b590babc5..ff9b34f00 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OperationMetadataOrBuilder.java @@ -54,6 +54,72 @@ public interface OperationMetadataOrBuilder */ com.google.cloud.automl.v1.DeleteOperationMetadataOrBuilder getDeleteDetailsOrBuilder(); + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + boolean hasDeployModelDetails(); + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + com.google.cloud.automl.v1.DeployModelOperationMetadata getDeployModelDetails(); + /** + * + * + *
+   * Details of a DeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + */ + com.google.cloud.automl.v1.DeployModelOperationMetadataOrBuilder getDeployModelDetailsOrBuilder(); + + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + boolean hasUndeployModelDetails(); + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + com.google.cloud.automl.v1.UndeployModelOperationMetadata getUndeployModelDetails(); + /** + * + * + *
+   * Details of an UndeployModel operation.
+   * 
+ * + * .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * + */ + com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder + getUndeployModelDetailsOrBuilder(); + /** * * @@ -85,6 +151,166 @@ public interface OperationMetadataOrBuilder */ com.google.cloud.automl.v1.CreateModelOperationMetadataOrBuilder getCreateModelDetailsOrBuilder(); + /** + * + * + *
+   * Details of CreateDataset operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + boolean hasCreateDatasetDetails(); + /** + * + * + *
+   * Details of CreateDataset operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + com.google.cloud.automl.v1.CreateDatasetOperationMetadata getCreateDatasetDetails(); + /** + * + * + *
+   * Details of CreateDataset operation.
+   * 
+ * + * .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * + */ + com.google.cloud.automl.v1.CreateDatasetOperationMetadataOrBuilder + getCreateDatasetDetailsOrBuilder(); + + /** + * + * + *
+   * Details of ImportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + boolean hasImportDataDetails(); + /** + * + * + *
+   * Details of ImportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + com.google.cloud.automl.v1.ImportDataOperationMetadata getImportDataDetails(); + /** + * + * + *
+   * Details of ImportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + */ + com.google.cloud.automl.v1.ImportDataOperationMetadataOrBuilder getImportDataDetailsOrBuilder(); + + /** + * + * + *
+   * Details of BatchPredict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + */ + boolean hasBatchPredictDetails(); + /** + * + * + *
+   * Details of BatchPredict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + */ + com.google.cloud.automl.v1.BatchPredictOperationMetadata getBatchPredictDetails(); + /** + * + * + *
+   * Details of BatchPredict operation.
+   * 
+ * + * .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + */ + com.google.cloud.automl.v1.BatchPredictOperationMetadataOrBuilder + getBatchPredictDetailsOrBuilder(); + + /** + * + * + *
+   * Details of ExportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + boolean hasExportDataDetails(); + /** + * + * + *
+   * Details of ExportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + com.google.cloud.automl.v1.ExportDataOperationMetadata getExportDataDetails(); + /** + * + * + *
+   * Details of ExportData operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + */ + com.google.cloud.automl.v1.ExportDataOperationMetadataOrBuilder getExportDataDetailsOrBuilder(); + + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + boolean hasExportModelDetails(); + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + com.google.cloud.automl.v1.ExportModelOperationMetadata getExportModelDetails(); + /** + * + * + *
+   * Details of ExportModel operation.
+   * 
+ * + * .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + */ + com.google.cloud.automl.v1.ExportModelOperationMetadataOrBuilder getExportModelDetailsOrBuilder(); + /** * * diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java index b009a4f65..24d7d6d18 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/Operations.java @@ -35,10 +35,50 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_automl_v1_DeleteOperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_DeleteOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_DeployModelOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_CreateDatasetOperationMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_CreateModelOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ImportDataOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ExportDataOperationMetadata_ExportDataOutputInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictOperationMetadata_BatchPredictOutputInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_ExportModelOperationMetadata_ExportModelOutputInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -49,28 +89,66 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\'google/cloud/automl/v1/operations.prot" - + "o\022\026google.cloud.automl.v1\032\037google/cloud/" - + "automl/v1/io.proto\032\"google/cloud/automl/" - + "v1/model.proto\032-google/cloud/automl/v1/m" - + "odel_evaluation.proto\032\033google/protobuf/e" - + "mpty.proto\032\037google/protobuf/timestamp.pr" - + "oto\032\027google/rpc/status.proto\032\034google/api" - + "/annotations.proto\"\351\002\n\021OperationMetadata" - + "\022I\n\016delete_details\030\010 \001(\0132/.google.cloud." - + "automl.v1.DeleteOperationMetadataH\000\022T\n\024c" - + "reate_model_details\030\n \001(\01324.google.cloud" - + ".automl.v1.CreateModelOperationMetadataH" - + "\000\022\030\n\020progress_percent\030\r \001(\005\022,\n\020partial_f" - + "ailures\030\002 \003(\0132\022.google.rpc.Status\022/\n\013cre" - + "ate_time\030\003 \001(\0132\032.google.protobuf.Timesta" - + "mp\022/\n\013update_time\030\004 \001(\0132\032.google.protobu" - + "f.TimestampB\t\n\007details\"\031\n\027DeleteOperatio" - + "nMetadata\"\036\n\034CreateModelOperationMetadat" - + "aB\252\001\n\032com.google.cloud.automl.v1P\001Z - * * For Translation: + * Output configuration for ExportData. + * As destination the + * [gcs_destination][google.cloud.automl.v1.OutputConfig.gcs_destination] + * must be set unless specified otherwise for a domain. If gcs_destination is + * set then in the given directory a new directory is created. Its name + * will be "export_data-<dataset-display-name>-<timestamp-of-export-call>", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + * Only ground truth annotations are exported (not approved annotations are + * not exported). + * The outputs correspond to how the data was imported, and may be used as + * input to import data. The output formats are represented as EBNF with literal + * commas and same non-terminal symbols definitions are these in import data's + * [InputConfig][google.cloud.automl.v1.InputConfig]: + * * For Image Classification: + * CSV file(s) `image_classification_1.csv`, + * `image_classification_2.csv`,...,`image_classification_N.csv`with + * each line in format: + * ML_USE,GCS_FILE_PATH,LABEL,LABEL,... + * where GCS_FILE_PATHs point at the original, source locations of the + * imported images. + * For MULTICLASS classification type, there can be at most one LABEL + * per example. + * * For Image Object Detection: + * CSV file(s) `image_object_detection_1.csv`, + * `image_object_detection_2.csv`,...,`image_object_detection_N.csv` + * with each line in format: + * ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) + * where GCS_FILE_PATHs point at the original, source locations of the + * imported images. + * * For Text Classification: + * In the created directory CSV file(s) `text_classification_1.csv`, + * `text_classification_2.csv`, ...,`text_classification_N.csv` will be + * created where N depends on the total number of examples exported. + * Each line in the CSV is of the format: + * ML_USE,GCS_FILE_PATH,LABEL,LABEL,... + * where GCS_FILE_PATHs point at the exported .txt files containing + * the text content of the imported example. For MULTICLASS + * classification type, there will be at most one LABEL per example. + * * For Text Sentiment: + * In the created directory CSV file(s) `text_sentiment_1.csv`, + * `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be + * created where N depends on the total number of examples exported. + * Each line in the CSV is of the format: + * ML_USE,GCS_FILE_PATH,SENTIMENT + * where GCS_FILE_PATHs point at the exported .txt files containing + * the text content of the imported example. + * * For Text Extraction: + * CSV file `text_extraction.csv`, with each line in format: + * ML_USE,GCS_FILE_PATH + * GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which + * contains, per line, a proto that wraps a TextSnippet proto (in json + * representation) followed by AnnotationPayload protos (called + * annotations). If initially documents had been imported, the JSONL + * will point at the original, source locations of the imported + * documents. + * * For Translation: * CSV file `translation.csv`, with each line in format: * ML_USE,GCS_FILE_PATH * GCS_FILE_PATH leads to a .TSV file which describes examples that have * given ML_USE, using the following row format per line: * TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target * language) - * `export_data_<automl-dataset-display-name>_<timestamp-of-export-call>` - * where <automl-dataset-display-name> will be made - * BigQuery-dataset-name compatible (e.g. most special characters will - * become underscores), and timestamp will be in - * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that - * dataset a new table called `primary_table` will be created, and - * filled with precisely the same data as this obtained on import. *
* * Protobuf type {@code google.cloud.automl.v1.OutputConfig} @@ -168,15 +216,17 @@ public DestinationCase getDestinationCase() { * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public boolean hasGcsDestination() { return destinationCase_ == 1; @@ -185,15 +235,17 @@ public boolean hasGcsDestination() { * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { if (destinationCase_ == 1) { @@ -205,15 +257,17 @@ public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { if (destinationCase_ == 1) { @@ -399,20 +453,68 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * *  For Translation:
+   * Output configuration for ExportData.
+   * As destination the
+   * [gcs_destination][google.cloud.automl.v1.OutputConfig.gcs_destination]
+   * must be set unless specified otherwise for a domain. If gcs_destination is
+   * set then in the given directory a new directory is created. Its name
+   * will be "export_data-<dataset-display-name>-<timestamp-of-export-call>",
+   * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format.
+   * Only ground truth annotations are exported (not approved annotations are
+   * not exported).
+   * The outputs correspond to how the data was imported, and may be used as
+   * input to import data. The output formats are represented as EBNF with literal
+   * commas and same non-terminal symbols definitions are these in import data's
+   * [InputConfig][google.cloud.automl.v1.InputConfig]:
+   *  *  For Image Classification:
+   *         CSV file(s) `image_classification_1.csv`,
+   *         `image_classification_2.csv`,...,`image_classification_N.csv`with
+   *         each line in format:
+   *         ML_USE,GCS_FILE_PATH,LABEL,LABEL,...
+   *         where GCS_FILE_PATHs point at the original, source locations of the
+   *         imported images.
+   *         For MULTICLASS classification type, there can be at most one LABEL
+   *         per example.
+   *  *  For Image Object Detection:
+   *         CSV file(s) `image_object_detection_1.csv`,
+   *         `image_object_detection_2.csv`,...,`image_object_detection_N.csv`
+   *         with each line in format:
+   *         ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,)
+   *         where GCS_FILE_PATHs point at the original, source locations of the
+   *         imported images.
+   *  *  For Text Classification:
+   *         In the created directory CSV file(s) `text_classification_1.csv`,
+   *         `text_classification_2.csv`, ...,`text_classification_N.csv` will be
+   *         created where N depends on the total number of examples exported.
+   *         Each line in the CSV is of the format:
+   *         ML_USE,GCS_FILE_PATH,LABEL,LABEL,...
+   *         where GCS_FILE_PATHs point at the exported .txt files containing
+   *         the text content of the imported example. For MULTICLASS
+   *         classification type, there will be at most one LABEL per example.
+   *  *  For Text Sentiment:
+   *         In the created directory CSV file(s) `text_sentiment_1.csv`,
+   *         `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be
+   *         created where N depends on the total number of examples exported.
+   *         Each line in the CSV is of the format:
+   *         ML_USE,GCS_FILE_PATH,SENTIMENT
+   *         where GCS_FILE_PATHs point at the exported .txt files containing
+   *         the text content of the imported example.
+   *  *  For Text Extraction:
+   *         CSV file `text_extraction.csv`, with each line in format:
+   *         ML_USE,GCS_FILE_PATH
+   *         GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which
+   *         contains, per line, a proto that wraps a TextSnippet proto (in json
+   *         representation) followed by AnnotationPayload protos (called
+   *         annotations). If initially documents had been imported, the JSONL
+   *         will point at the original, source locations of the imported
+   *         documents.
+   *  *  For Translation:
    *         CSV file `translation.csv`, with each line in format:
    *         ML_USE,GCS_FILE_PATH
    *         GCS_FILE_PATH leads to a .TSV file which describes examples that have
    *         given ML_USE, using the following row format per line:
    *         TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target
    *         language)
-   * `export_data_<automl-dataset-display-name>_<timestamp-of-export-call>`
-   *           where <automl-dataset-display-name> will be made
-   *           BigQuery-dataset-name compatible (e.g. most special characters will
-   *           become underscores), and timestamp will be in
-   *           YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that
-   *           dataset a new table called `primary_table` will be created, and
-   *           filled with precisely the same data as this obtained on import.
    * 
* * Protobuf type {@code google.cloud.automl.v1.OutputConfig} @@ -602,15 +704,17 @@ public Builder clearDestination() { * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public boolean hasGcsDestination() { return destinationCase_ == 1; @@ -619,15 +723,17 @@ public boolean hasGcsDestination() { * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { if (gcsDestinationBuilder_ == null) { @@ -646,15 +752,17 @@ public com.google.cloud.automl.v1.GcsDestination getGcsDestination() { * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { if (gcsDestinationBuilder_ == null) { @@ -673,15 +781,17 @@ public Builder setGcsDestination(com.google.cloud.automl.v1.GcsDestination value * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setGcsDestination( com.google.cloud.automl.v1.GcsDestination.Builder builderForValue) { @@ -698,15 +808,17 @@ public Builder setGcsDestination( * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination value) { if (gcsDestinationBuilder_ == null) { @@ -734,15 +846,17 @@ public Builder mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination val * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder clearGcsDestination() { if (gcsDestinationBuilder_ == null) { @@ -764,15 +878,17 @@ public Builder clearGcsDestination() { * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilder() { return getGcsDestinationFieldBuilder().getBuilder(); @@ -781,15 +897,17 @@ public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilde * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { @@ -805,15 +923,17 @@ public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBui * * *
-     * The Google Cloud Storage location where the output is to be written to.
-     * For Image Object Detection, Text Extraction, Video Classification and
-     * Tables, in the given directory a new directory will be created with name:
+     * Required. The Google Cloud Storage location where the output is to be
+     * written to. For Image Object Detection, Text Extraction in the given
+     * directory a new directory will be created with name:
      * export_data-<dataset-display-name>-<timestamp-of-export-call> where
      * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
      * output will be written into that directory.
      * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.automl.v1.GcsDestination, diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.java index d6f7b9c4d..00d2fd6d0 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/OutputConfigOrBuilder.java @@ -27,45 +27,51 @@ public interface OutputConfigOrBuilder * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ boolean hasGcsDestination(); /** * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ com.google.cloud.automl.v1.GcsDestination getGcsDestination(); /** * * *
-   * The Google Cloud Storage location where the output is to be written to.
-   * For Image Object Detection, Text Extraction, Video Classification and
-   * Tables, in the given directory a new directory will be created with name:
+   * Required. The Google Cloud Storage location where the output is to be
+   * written to. For Image Object Detection, Text Extraction in the given
+   * directory a new directory will be created with name:
    * export_data-<dataset-display-name>-<timestamp-of-export-call> where
    * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
    * output will be written into that directory.
    * 
* - * .google.cloud.automl.v1.GcsDestination gcs_destination = 1; + * + * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java index 21a8ae148..d5cf2c1a3 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequest.java @@ -266,6 +266,17 @@ public int getParamsCount() { *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -287,6 +298,17 @@ public java.util.Map getParams() { *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -300,6 +322,17 @@ public java.util.Map getParamsMap() { *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -317,6 +350,17 @@ public java.lang.String getParamsOrDefault(java.lang.String key, java.lang.Strin *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -1038,6 +1082,17 @@ public int getParamsCount() { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1059,6 +1114,17 @@ public java.util.Map getParams() { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1072,6 +1138,17 @@ public java.util.Map getParamsMap() { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1090,6 +1167,17 @@ public java.lang.String getParamsOrDefault( *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1115,6 +1203,17 @@ public Builder clearParams() { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1137,6 +1236,17 @@ public java.util.Map getMutableParams() { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; @@ -1157,6 +1267,17 @@ public Builder putParams(java.lang.String key, java.lang.String value) { *
      * Additional domain-specific parameters, any string must be up to 25000
      * characters long.
+     * *  For Image Classification:
+     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+     *     makes predictions for an image, it will only produce results that have
+     *     at least this confidence score. The default is 0.5.
+     *  *  For Image Object Detection:
+     *    `score_threshold` - (float) When Model detects objects on the image,
+     *        it will only produce bounding boxes which have at least this
+     *        confidence score. Value in 0 to 1 range, default is 0.5.
+     *    `max_bounding_box_count` - (int64) No more than this number of bounding
+     *        boxes will be returned in the response. Default is 100, the
+     *        requested value may be limited by server.
      * 
* * map<string, string> params = 3; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.java index 6623665b7..d13d7a37e 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictRequestOrBuilder.java @@ -84,6 +84,17 @@ public interface PredictRequestOrBuilder *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -95,6 +106,17 @@ public interface PredictRequestOrBuilder *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -109,6 +131,17 @@ public interface PredictRequestOrBuilder *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -120,6 +153,17 @@ public interface PredictRequestOrBuilder *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; @@ -131,6 +175,17 @@ public interface PredictRequestOrBuilder *
    * Additional domain-specific parameters, any string must be up to 25000
    * characters long.
+   * *  For Image Classification:
+   *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
+   *     makes predictions for an image, it will only produce results that have
+   *     at least this confidence score. The default is 0.5.
+   *  *  For Image Object Detection:
+   *    `score_threshold` - (float) When Model detects objects on the image,
+   *        it will only produce bounding boxes which have at least this
+   *        confidence score. Value in 0 to 1 range, default is 0.5.
+   *    `max_bounding_box_count` - (int64) No more than this number of bounding
+   *        boxes will be returned in the response. Default is 100, the
+   *        requested value may be limited by server.
    * 
* * map<string, string> params = 3; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java index 8bd3a7872..357c812a2 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponse.java @@ -79,17 +79,33 @@ private PredictResponse( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { metadata_ = com.google.protobuf.MapField.newMapField( MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000004; } com.google.protobuf.MapEntry metadata__ = input.readMessage( MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 26: + { + com.google.cloud.automl.v1.ExamplePayload.Builder subBuilder = null; + if (preprocessedInput_ != null) { + subBuilder = preprocessedInput_.toBuilder(); + } + preprocessedInput_ = + input.readMessage( + com.google.cloud.automl.v1.ExamplePayload.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(preprocessedInput_); + preprocessedInput_ = subBuilder.buildPartial(); + } + break; } default: @@ -140,6 +156,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.automl.v1.PredictResponse.Builder.class); } + private int bitField0_; public static final int PAYLOAD_FIELD_NUMBER = 1; private java.util.List payload_; /** @@ -209,6 +226,77 @@ public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder return payload_.get(index); } + public static final int PREPROCESSED_INPUT_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_; + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public boolean hasPreprocessedInput() { + return preprocessedInput_ != null; + } + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() { + return getPreprocessedInput(); + } + public static final int METADATA_FIELD_NUMBER = 2; private static final class MetadataDefaultEntryHolder { @@ -239,6 +327,18 @@ public int getMetadataCount() { * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -259,6 +359,18 @@ public java.util.Map getMetadata() { * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -271,6 +383,18 @@ public java.util.Map getMetadataMap() { * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -288,6 +412,18 @@ public java.lang.String getMetadataOrDefault( * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -322,6 +458,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + if (preprocessedInput_ != null) { + output.writeMessage(3, getPreprocessedInput()); + } unknownFields.writeTo(output); } @@ -344,6 +483,9 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__); } + if (preprocessedInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPreprocessedInput()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -361,6 +503,10 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.automl.v1.PredictResponse) obj; if (!getPayloadList().equals(other.getPayloadList())) return false; + if (hasPreprocessedInput() != other.hasPreprocessedInput()) return false; + if (hasPreprocessedInput()) { + if (!getPreprocessedInput().equals(other.getPreprocessedInput())) return false; + } if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -377,6 +523,10 @@ public int hashCode() { hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayloadList().hashCode(); } + if (hasPreprocessedInput()) { + hash = (37 * hash) + PREPROCESSED_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getPreprocessedInput().hashCode(); + } if (!internalGetMetadata().getMap().isEmpty()) { hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + internalGetMetadata().hashCode(); @@ -555,6 +705,12 @@ public Builder clear() { } else { payloadBuilder_.clear(); } + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = null; + } else { + preprocessedInput_ = null; + preprocessedInputBuilder_ = null; + } internalGetMutableMetadata().clear(); return this; } @@ -584,6 +740,7 @@ public com.google.cloud.automl.v1.PredictResponse buildPartial() { com.google.cloud.automl.v1.PredictResponse result = new com.google.cloud.automl.v1.PredictResponse(this); int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (payloadBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { payload_ = java.util.Collections.unmodifiableList(payload_); @@ -593,8 +750,14 @@ public com.google.cloud.automl.v1.PredictResponse buildPartial() { } else { result.payload_ = payloadBuilder_.build(); } + if (preprocessedInputBuilder_ == null) { + result.preprocessedInput_ = preprocessedInput_; + } else { + result.preprocessedInput_ = preprocessedInputBuilder_.build(); + } result.metadata_ = internalGetMetadata(); result.metadata_.makeImmutable(); + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -671,6 +834,9 @@ public Builder mergeFrom(com.google.cloud.automl.v1.PredictResponse other) { } } } + if (other.hasPreprocessedInput()) { + mergePreprocessedInput(other.getPreprocessedInput()); + } internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -1071,6 +1237,278 @@ public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder(in return payloadBuilder_; } + private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder> + preprocessedInputBuilder_; + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public boolean hasPreprocessedInput() { + return preprocessedInputBuilder_ != null || preprocessedInput_ != null; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() { + if (preprocessedInputBuilder_ == null) { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } else { + return preprocessedInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public Builder setPreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) { + if (preprocessedInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preprocessedInput_ = value; + onChanged(); + } else { + preprocessedInputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public Builder setPreprocessedInput( + com.google.cloud.automl.v1.ExamplePayload.Builder builderForValue) { + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = builderForValue.build(); + onChanged(); + } else { + preprocessedInputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public Builder mergePreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) { + if (preprocessedInputBuilder_ == null) { + if (preprocessedInput_ != null) { + preprocessedInput_ = + com.google.cloud.automl.v1.ExamplePayload.newBuilder(preprocessedInput_) + .mergeFrom(value) + .buildPartial(); + } else { + preprocessedInput_ = value; + } + onChanged(); + } else { + preprocessedInputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public Builder clearPreprocessedInput() { + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = null; + onChanged(); + } else { + preprocessedInput_ = null; + preprocessedInputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1.ExamplePayload.Builder getPreprocessedInputBuilder() { + + onChanged(); + return getPreprocessedInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() { + if (preprocessedInputBuilder_ != null) { + return preprocessedInputBuilder_.getMessageOrBuilder(); + } else { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Classification:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * * For Text Sentiment:
+     *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+     *   [document_text][google.cloud.automl.v1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder> + getPreprocessedInputFieldBuilder() { + if (preprocessedInputBuilder_ == null) { + preprocessedInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ExamplePayload, + com.google.cloud.automl.v1.ExamplePayload.Builder, + com.google.cloud.automl.v1.ExamplePayloadOrBuilder>( + getPreprocessedInput(), getParentForChildren(), isClean()); + preprocessedInput_ = null; + } + return preprocessedInputBuilder_; + } + private com.google.protobuf.MapField metadata_; private com.google.protobuf.MapField internalGetMetadata() { @@ -1102,6 +1540,18 @@ public int getMetadataCount() { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1122,6 +1572,18 @@ public java.util.Map getMetadata() { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1134,6 +1596,18 @@ public java.util.Map getMetadataMap() { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1151,6 +1625,18 @@ public java.lang.String getMetadataOrDefault( * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1175,6 +1661,18 @@ public Builder clearMetadata() { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1196,6 +1694,18 @@ public java.util.Map getMutableMetadata() { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; @@ -1215,6 +1725,18 @@ public Builder putMetadata(java.lang.String key, java.lang.String value) { * *
      * Additional domain-specific prediction response metadata.
+     * * For Image Object Detection:
+     *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+     *      image could have been returned.
+     * * For Text Sentiment:
+     *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+     *      -1 maps to least positive sentiment, while 1 maps to the most positive
+     *      one and the higher the score, the more positive the sentiment in the
+     *      document is. Yet these values are relative to the training data, so
+     *      e.g. if all data was positive then -1 will be also positive (though
+     *      the least).
+     *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+     *      from the previous Natural Language Sentiment Analysis API.
      * 
* * map<string, string> metadata = 2; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java index 43140f250..0db4217a7 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictResponseOrBuilder.java @@ -80,11 +80,84 @@ public interface PredictResponseOrBuilder */ com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + boolean hasPreprocessedInput(); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput(); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Classification:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * * For Text Sentiment:
+   *   If the input is a .pdf file, the OCR'ed trucated text will be provided in
+   *   [document_text][google.cloud.automl.v1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder(); + /** * * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -95,6 +168,18 @@ public interface PredictResponseOrBuilder * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -108,6 +193,18 @@ public interface PredictResponseOrBuilder * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -118,6 +215,18 @@ public interface PredictResponseOrBuilder * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; @@ -128,6 +237,18 @@ public interface PredictResponseOrBuilder * *
    * Additional domain-specific prediction response metadata.
+   * * For Image Object Detection:
+   *  `max_bounding_box_count` - (int64) At most that many bounding boxes per
+   *      image could have been returned.
+   * * For Text Sentiment:
+   *  `sentiment_score` - (float, deprecated) A value between -1 and 1,
+   *      -1 maps to least positive sentiment, while 1 maps to the most positive
+   *      one and the higher the score, the more positive the sentiment in the
+   *      document is. Yet these values are relative to the training data, so
+   *      e.g. if all data was positive then -1 will be also positive (though
+   *      the least).
+   *      The sentiment_score shouldn't be confused with "score" or "magnitude"
+   *      from the previous Natural Language Sentiment Analysis API.
    * 
* * map<string, string> metadata = 2; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java index 7cb4a10f6..e877a888e 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/PredictionServiceProto.java @@ -43,6 +43,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_automl_v1_PredictResponse_MetadataEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1_PredictResponse_MetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_BatchPredictResult_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_BatchPredictResult_MetadataEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -55,33 +71,50 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n/google/cloud/automl/v1/prediction_serv" + "ice.proto\022\026google.cloud.automl.v1\032\034googl" + "e/api/annotations.proto\032\027google/api/clie" - + "nt.proto\032/google/cloud/automl/v1/annotat" - + "ion_payload.proto\032\'google/cloud/automl/v" - + "1/data_items.proto\032\037google/cloud/automl/" - + "v1/io.proto\032\'google/cloud/automl/v1/oper" - + "ations.proto\032#google/longrunning/operati" - + "ons.proto\"\312\001\n\016PredictRequest\022\014\n\004name\030\001 \001" - + "(\t\0227\n\007payload\030\002 \001(\0132&.google.cloud.autom" - + "l.v1.ExamplePayload\022B\n\006params\030\003 \003(\01322.go" - + "ogle.cloud.automl.v1.PredictRequest.Para" - + "msEntry\032-\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - + "alue\030\002 \001(\t:\0028\001\"\307\001\n\017PredictResponse\022:\n\007pa" - + "yload\030\001 \003(\0132).google.cloud.automl.v1.Ann" - + "otationPayload\022G\n\010metadata\030\002 \003(\01325.googl" - + "e.cloud.automl.v1.PredictResponse.Metada" - + "taEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\0012\372\001\n\021PredictionService\022\231" - + "\001\n\007Predict\022&.google.cloud.automl.v1.Pred" - + "ictRequest\032\'.google.cloud.automl.v1.Pred" - + "ictResponse\"=\202\323\344\223\0027\"2/v1/{name=projects/" - + "*/locations/*/models/*}:predict:\001*\032I\312A\025a" - + "utoml.googleapis.com\322A.https://www.googl" - + "eapis.com/auth/cloud-platformB\302\001\n\032com.go" - + "ogle.cloud.automl.v1B\026PredictionServiceP" - + "rotoP\001Z + * Dataset metadata for classification. + *
+ * + * Protobuf type {@code google.cloud.automl.v1.TextClassificationDatasetMetadata} + */ +public final class TextClassificationDatasetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextClassificationDatasetMetadata) + TextClassificationDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextClassificationDatasetMetadata.newBuilder() to construct. + private TextClassificationDatasetMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextClassificationDatasetMetadata() { + classificationType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextClassificationDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.class, + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder.class); + } + + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 1; + private int classificationType_; + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, classificationType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, classificationType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextClassificationDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextClassificationDatasetMetadata other = + (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) obj; + + if (classificationType_ != other.classificationType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata 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.automl.v1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata 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.automl.v1.TextClassificationDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata 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.automl.v1.TextClassificationDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata 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.automl.v1.TextClassificationDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata 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.automl.v1.TextClassificationDatasetMetadata 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; + } + /** + * + * + *
+   * Dataset metadata for classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextClassificationDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextClassificationDatasetMetadata) + com.google.cloud.automl.v1.TextClassificationDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.class, + com.google.cloud.automl.v1.TextClassificationDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextClassificationDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + classificationType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata build() { + com.google.cloud.automl.v1.TextClassificationDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.TextClassificationDatasetMetadata result = + new com.google.cloud.automl.v1.TextClassificationDatasetMetadata(this); + result.classificationType_ = classificationType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextClassificationDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextClassificationDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextClassificationDatasetMetadata other) { + if (other + == com.google.cloud.automl.v1.TextClassificationDatasetMetadata.getDefaultInstance()) + return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextClassificationDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextClassificationDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int classificationType_ = 0; + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder setClassificationType(com.google.cloud.automl.v1.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Type of the classification problem.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + public Builder clearClassificationType() { + + classificationType_ = 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.automl.v1.TextClassificationDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextClassificationDatasetMetadata) + private static final com.google.cloud.automl.v1.TextClassificationDatasetMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.TextClassificationDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextClassificationDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextClassificationDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationDatasetMetadataOrBuilder.java new file mode 100644 index 000000000..a375b7fe1 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationDatasetMetadataOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextClassificationDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextClassificationDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + int getClassificationTypeValue(); + /** + * + * + *
+   * Required. Type of the classification problem.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + com.google.cloud.automl.v1.ClassificationType getClassificationType(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadata.java new file mode 100644 index 000000000..a8e0a0f2c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadata.java @@ -0,0 +1,587 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata that is specific to text classification.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextClassificationModelMetadata} + */ +public final class TextClassificationModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextClassificationModelMetadata) + TextClassificationModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextClassificationModelMetadata.newBuilder() to construct. + private TextClassificationModelMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextClassificationModelMetadata() { + classificationType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextClassificationModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 24: + { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextClassificationModelMetadata.class, + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder.class); + } + + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 3; + private int classificationType_; + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, classificationType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (classificationType_ + != com.google.cloud.automl.v1.ClassificationType.CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, classificationType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextClassificationModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextClassificationModelMetadata other = + (com.google.cloud.automl.v1.TextClassificationModelMetadata) obj; + + if (classificationType_ != other.classificationType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata 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.automl.v1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata 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.automl.v1.TextClassificationModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata 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.automl.v1.TextClassificationModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata 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.automl.v1.TextClassificationModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata 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.automl.v1.TextClassificationModelMetadata 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; + } + /** + * + * + *
+   * Model metadata that is specific to text classification.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextClassificationModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextClassificationModelMetadata) + com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextClassificationModelMetadata.class, + com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextClassificationModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + classificationType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationModelMetadata build() { + com.google.cloud.automl.v1.TextClassificationModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationModelMetadata buildPartial() { + com.google.cloud.automl.v1.TextClassificationModelMetadata result = + new com.google.cloud.automl.v1.TextClassificationModelMetadata(this); + result.classificationType_ = classificationType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextClassificationModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextClassificationModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextClassificationModelMetadata other) { + if (other == com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance()) + return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextClassificationModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextClassificationModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int classificationType_ = 0; + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public com.google.cloud.automl.v1.ClassificationType getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1.ClassificationType result = + com.google.cloud.automl.v1.ClassificationType.valueOf(classificationType_); + return result == null ? com.google.cloud.automl.v1.ClassificationType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public Builder setClassificationType(com.google.cloud.automl.v1.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + public Builder clearClassificationType() { + + classificationType_ = 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.automl.v1.TextClassificationModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextClassificationModelMetadata) + private static final com.google.cloud.automl.v1.TextClassificationModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextClassificationModelMetadata(); + } + + public static com.google.cloud.automl.v1.TextClassificationModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextClassificationModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextClassificationModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextClassificationModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadataOrBuilder.java new file mode 100644 index 000000000..650065397 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextClassificationModelMetadataOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextClassificationModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextClassificationModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + int getClassificationTypeValue(); + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + com.google.cloud.automl.v1.ClassificationType getClassificationType(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtraction.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtraction.java new file mode 100644 index 000000000..559868cda --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtraction.java @@ -0,0 +1,116 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_extraction.proto + +package com.google.cloud.automl.v1; + +public final class TextExtraction { + private TextExtraction() {} + + 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_automl_v1_TextExtractionAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextExtractionAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_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/automl/v1/text_extraction" + + ".proto\022\026google.cloud.automl.v1\032)google/c" + + "loud/automl/v1/text_segment.proto\032\034googl" + + "e/api/annotations.proto\"t\n\030TextExtractio" + + "nAnnotation\022;\n\014text_segment\030\003 \001(\0132#.goog" + + "le.cloud.automl.v1.TextSegmentH\000\022\r\n\005scor" + + "e\030\001 \001(\002B\014\n\nannotation\"\222\002\n\037TextExtraction" + + "EvaluationMetrics\022\016\n\006au_prc\030\001 \001(\002\022r\n\032con" + + "fidence_metrics_entries\030\002 \003(\0132N.google.c" + + "loud.automl.v1.TextExtractionEvaluationM" + + "etrics.ConfidenceMetricsEntry\032k\n\026Confide" + + "nceMetricsEntry\022\034\n\024confidence_threshold\030" + + "\001 \001(\002\022\016\n\006recall\030\003 \001(\002\022\021\n\tprecision\030\004 \001(\002" + + "\022\020\n\010f1_score\030\005 \001(\002B\252\001\n\032com.google.cloud." + + "automl.v1P\001Z + * Annotation for identifying spans of text. + *
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionAnnotation} + */ +public final class TextExtractionAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextExtractionAnnotation) + TextExtractionAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextExtractionAnnotation.newBuilder() to construct. + private TextExtractionAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextExtractionAnnotation() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextExtractionAnnotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + score_ = input.readFloat(); + break; + } + case 26: + { + com.google.cloud.automl.v1.TextSegment.Builder subBuilder = null; + if (annotationCase_ == 3) { + subBuilder = ((com.google.cloud.automl.v1.TextSegment) annotation_).toBuilder(); + } + annotation_ = + input.readMessage( + com.google.cloud.automl.v1.TextSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.automl.v1.TextSegment) annotation_); + annotation_ = subBuilder.buildPartial(); + } + annotationCase_ = 3; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionAnnotation.class, + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder.class); + } + + private int annotationCase_ = 0; + private java.lang.Object annotation_; + + public enum AnnotationCase implements com.google.protobuf.Internal.EnumLite { + TEXT_SEGMENT(3), + ANNOTATION_NOT_SET(0); + private final int value; + + private AnnotationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static AnnotationCase valueOf(int value) { + return forNumber(value); + } + + public static AnnotationCase forNumber(int value) { + switch (value) { + case 3: + return TEXT_SEGMENT; + case 0: + return ANNOTATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AnnotationCase getAnnotationCase() { + return AnnotationCase.forNumber(annotationCase_); + } + + public static final int TEXT_SEGMENT_FIELD_NUMBER = 3; + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public boolean hasTextSegment() { + return annotationCase_ == 3; + } + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public com.google.cloud.automl.v1.TextSegment getTextSegment() { + if (annotationCase_ == 3) { + return (com.google.cloud.automl.v1.TextSegment) annotation_; + } + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + if (annotationCase_ == 3) { + return (com.google.cloud.automl.v1.TextSegment) annotation_; + } + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + + public static final int SCORE_FIELD_NUMBER = 1; + private float score_; + /** + * + * + *
+   * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+   * means greater confidence in correctness of the annotation.
+   * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + + 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 (score_ != 0F) { + output.writeFloat(1, score_); + } + if (annotationCase_ == 3) { + output.writeMessage(3, (com.google.cloud.automl.v1.TextSegment) annotation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, score_); + } + if (annotationCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.automl.v1.TextSegment) annotation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextExtractionAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextExtractionAnnotation other = + (com.google.cloud.automl.v1.TextExtractionAnnotation) obj; + + if (java.lang.Float.floatToIntBits(getScore()) + != java.lang.Float.floatToIntBits(other.getScore())) return false; + if (!getAnnotationCase().equals(other.getAnnotationCase())) return false; + switch (annotationCase_) { + case 3: + if (!getTextSegment().equals(other.getTextSegment())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); + switch (annotationCase_) { + case 3: + hash = (37 * hash) + TEXT_SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getTextSegment().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation 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.automl.v1.TextExtractionAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation 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.automl.v1.TextExtractionAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation 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.automl.v1.TextExtractionAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation 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.automl.v1.TextExtractionAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation 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.automl.v1.TextExtractionAnnotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Annotation for identifying spans of text.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextExtractionAnnotation) + com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionAnnotation.class, + com.google.cloud.automl.v1.TextExtractionAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextExtractionAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + score_ = 0F; + + annotationCase_ = 0; + annotation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionAnnotation build() { + com.google.cloud.automl.v1.TextExtractionAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionAnnotation buildPartial() { + com.google.cloud.automl.v1.TextExtractionAnnotation result = + new com.google.cloud.automl.v1.TextExtractionAnnotation(this); + if (annotationCase_ == 3) { + if (textSegmentBuilder_ == null) { + result.annotation_ = annotation_; + } else { + result.annotation_ = textSegmentBuilder_.build(); + } + } + result.score_ = score_; + result.annotationCase_ = annotationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextExtractionAnnotation) { + return mergeFrom((com.google.cloud.automl.v1.TextExtractionAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextExtractionAnnotation other) { + if (other == com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance()) + return this; + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + switch (other.getAnnotationCase()) { + case TEXT_SEGMENT: + { + mergeTextSegment(other.getTextSegment()); + break; + } + case ANNOTATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextExtractionAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextExtractionAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int annotationCase_ = 0; + private java.lang.Object annotation_; + + public AnnotationCase getAnnotationCase() { + return AnnotationCase.forNumber(annotationCase_); + } + + public Builder clearAnnotation() { + annotationCase_ = 0; + annotation_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder> + textSegmentBuilder_; + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public boolean hasTextSegment() { + return annotationCase_ == 3; + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public com.google.cloud.automl.v1.TextSegment getTextSegment() { + if (textSegmentBuilder_ == null) { + if (annotationCase_ == 3) { + return (com.google.cloud.automl.v1.TextSegment) annotation_; + } + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } else { + if (annotationCase_ == 3) { + return textSegmentBuilder_.getMessage(); + } + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public Builder setTextSegment(com.google.cloud.automl.v1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + annotation_ = value; + onChanged(); + } else { + textSegmentBuilder_.setMessage(value); + } + annotationCase_ = 3; + return this; + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public Builder setTextSegment(com.google.cloud.automl.v1.TextSegment.Builder builderForValue) { + if (textSegmentBuilder_ == null) { + annotation_ = builderForValue.build(); + onChanged(); + } else { + textSegmentBuilder_.setMessage(builderForValue.build()); + } + annotationCase_ = 3; + return this; + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public Builder mergeTextSegment(com.google.cloud.automl.v1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (annotationCase_ == 3 + && annotation_ != com.google.cloud.automl.v1.TextSegment.getDefaultInstance()) { + annotation_ = + com.google.cloud.automl.v1.TextSegment.newBuilder( + (com.google.cloud.automl.v1.TextSegment) annotation_) + .mergeFrom(value) + .buildPartial(); + } else { + annotation_ = value; + } + onChanged(); + } else { + if (annotationCase_ == 3) { + textSegmentBuilder_.mergeFrom(value); + } + textSegmentBuilder_.setMessage(value); + } + annotationCase_ = 3; + return this; + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public Builder clearTextSegment() { + if (textSegmentBuilder_ == null) { + if (annotationCase_ == 3) { + annotationCase_ = 0; + annotation_ = null; + onChanged(); + } + } else { + if (annotationCase_ == 3) { + annotationCase_ = 0; + annotation_ = null; + } + textSegmentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public com.google.cloud.automl.v1.TextSegment.Builder getTextSegmentBuilder() { + return getTextSegmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + if ((annotationCase_ == 3) && (textSegmentBuilder_ != null)) { + return textSegmentBuilder_.getMessageOrBuilder(); + } else { + if (annotationCase_ == 3) { + return (com.google.cloud.automl.v1.TextSegment) annotation_; + } + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + } + /** + * + * + *
+     * An entity annotation will set this, which is the part of the original
+     * text to which the annotation pertains.
+     * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder> + getTextSegmentFieldBuilder() { + if (textSegmentBuilder_ == null) { + if (!(annotationCase_ == 3)) { + annotation_ = com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + textSegmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.TextSegment, + com.google.cloud.automl.v1.TextSegment.Builder, + com.google.cloud.automl.v1.TextSegmentOrBuilder>( + (com.google.cloud.automl.v1.TextSegment) annotation_, + getParentForChildren(), + isClean()); + annotation_ = null; + } + annotationCase_ = 3; + onChanged(); + ; + return textSegmentBuilder_; + } + + private float score_; + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence in correctness of the annotation.
+     * 
+ * + * float score = 1; + */ + public float getScore() { + return score_; + } + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence in correctness of the annotation.
+     * 
+ * + * float score = 1; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+     * means greater confidence in correctness of the annotation.
+     * 
+ * + * float score = 1; + */ + public Builder clearScore() { + + score_ = 0F; + 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.automl.v1.TextExtractionAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextExtractionAnnotation) + private static final com.google.cloud.automl.v1.TextExtractionAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextExtractionAnnotation(); + } + + public static com.google.cloud.automl.v1.TextExtractionAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextExtractionAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextExtractionAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionAnnotationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionAnnotationOrBuilder.java new file mode 100644 index 000000000..62f90f4f3 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionAnnotationOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_extraction.proto + +package com.google.cloud.automl.v1; + +public interface TextExtractionAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextExtractionAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + boolean hasTextSegment(); + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + com.google.cloud.automl.v1.TextSegment getTextSegment(); + /** + * + * + *
+   * An entity annotation will set this, which is the part of the original
+   * text to which the annotation pertains.
+   * 
+ * + * .google.cloud.automl.v1.TextSegment text_segment = 3; + */ + com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder(); + + /** + * + * + *
+   * Output only. A confidence estimate between 0.0 and 1.0. A higher value
+   * means greater confidence in correctness of the annotation.
+   * 
+ * + * float score = 1; + */ + float getScore(); + + public com.google.cloud.automl.v1.TextExtractionAnnotation.AnnotationCase getAnnotationCase(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadata.java new file mode 100644 index 000000000..e39847bb6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadata.java @@ -0,0 +1,451 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Dataset metadata that is specific to text extraction
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionDatasetMetadata} + */ +public final class TextExtractionDatasetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextExtractionDatasetMetadata) + TextExtractionDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextExtractionDatasetMetadata.newBuilder() to construct. + private TextExtractionDatasetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextExtractionDatasetMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextExtractionDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.class, + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextExtractionDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextExtractionDatasetMetadata other = + (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata 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.automl.v1.TextExtractionDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata 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.automl.v1.TextExtractionDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata 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.automl.v1.TextExtractionDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata 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.automl.v1.TextExtractionDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata 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.automl.v1.TextExtractionDatasetMetadata 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; + } + /** + * + * + *
+   * Dataset metadata that is specific to text extraction
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextExtractionDatasetMetadata) + com.google.cloud.automl.v1.TextExtractionDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.class, + com.google.cloud.automl.v1.TextExtractionDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextExtractionDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata build() { + com.google.cloud.automl.v1.TextExtractionDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.TextExtractionDatasetMetadata result = + new com.google.cloud.automl.v1.TextExtractionDatasetMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextExtractionDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextExtractionDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextExtractionDatasetMetadata other) { + if (other == com.google.cloud.automl.v1.TextExtractionDatasetMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextExtractionDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextExtractionDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.TextExtractionDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextExtractionDatasetMetadata) + private static final com.google.cloud.automl.v1.TextExtractionDatasetMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.TextExtractionDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextExtractionDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextExtractionDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadataOrBuilder.java new file mode 100644 index 000000000..56b8edeee --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionDatasetMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextExtractionDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextExtractionDatasetMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetrics.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetrics.java new file mode 100644 index 000000000..0dc2eea97 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetrics.java @@ -0,0 +1,2009 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_extraction.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model evaluation metrics for text extraction problems.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionEvaluationMetrics} + */ +public final class TextExtractionEvaluationMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextExtractionEvaluationMetrics) + TextExtractionEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextExtractionEvaluationMetrics.newBuilder() to construct. + private TextExtractionEvaluationMetrics( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextExtractionEvaluationMetrics() { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextExtractionEvaluationMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + auPrc_ = input.readFloat(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + confidenceMetricsEntries_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntry>(); + mutable_bitField0_ |= 0x00000002; + } + confidenceMetricsEntries_.add( + input.readMessage( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntry.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + confidenceMetricsEntries_ = + java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.class, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder.class); + } + + public interface ConfidenceMetricsEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The confidence threshold value used to compute the metrics.
+     * Only annotations with score of at least this threshold are considered to
+     * be ones the model would return.
+     * 
+ * + * float confidence_threshold = 1; + */ + float getConfidenceThreshold(); + + /** + * + * + *
+     * Output only. Recall under the given confidence threshold.
+     * 
+ * + * float recall = 3; + */ + float getRecall(); + + /** + * + * + *
+     * Output only. Precision under the given confidence threshold.
+     * 
+ * + * float precision = 4; + */ + float getPrecision(); + + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 5; + */ + float getF1Score(); + } + /** + * + * + *
+   * Metrics for a single confidence threshold.
+   * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class ConfidenceMetricsEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + ConfidenceMetricsEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidenceMetricsEntry.newBuilder() to construct. + private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfidenceMetricsEntry() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConfidenceMetricsEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + confidenceThreshold_ = input.readFloat(); + break; + } + case 29: + { + recall_ = input.readFloat(); + break; + } + case 37: + { + precision_ = input.readFloat(); + break; + } + case 45: + { + f1Score_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .class, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder.class); + } + + public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1; + private float confidenceThreshold_; + /** + * + * + *
+     * Output only. The confidence threshold value used to compute the metrics.
+     * Only annotations with score of at least this threshold are considered to
+     * be ones the model would return.
+     * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + + public static final int RECALL_FIELD_NUMBER = 3; + private float recall_; + /** + * + * + *
+     * Output only. Recall under the given confidence threshold.
+     * 
+ * + * float recall = 3; + */ + public float getRecall() { + return recall_; + } + + public static final int PRECISION_FIELD_NUMBER = 4; + private float precision_; + /** + * + * + *
+     * Output only. Precision under the given confidence threshold.
+     * 
+ * + * float precision = 4; + */ + public float getPrecision() { + return precision_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 5; + private float f1Score_; + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 5; + */ + public float getF1Score() { + return f1Score_; + } + + 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 (confidenceThreshold_ != 0F) { + output.writeFloat(1, confidenceThreshold_); + } + if (recall_ != 0F) { + output.writeFloat(3, recall_); + } + if (precision_ != 0F) { + output.writeFloat(4, precision_); + } + if (f1Score_ != 0F) { + output.writeFloat(5, f1Score_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (confidenceThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceThreshold_); + } + if (recall_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, recall_); + } + if (precision_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, precision_); + } + if (f1Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, f1Score_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry other = + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) obj; + + if (java.lang.Float.floatToIntBits(getConfidenceThreshold()) + != java.lang.Float.floatToIntBits(other.getConfidenceThreshold())) return false; + if (java.lang.Float.floatToIntBits(getRecall()) + != java.lang.Float.floatToIntBits(other.getRecall())) return false; + if (java.lang.Float.floatToIntBits(getPrecision()) + != java.lang.Float.floatToIntBits(other.getPrecision())) return false; + if (java.lang.Float.floatToIntBits(getF1Score()) + != java.lang.Float.floatToIntBits(other.getF1Score())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceThreshold()); + hash = (37 * hash) + RECALL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall()); + hash = (37 * hash) + PRECISION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision()); + hash = (37 * hash) + F1_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + 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 for a single confidence threshold.
+     * 
+ * + * Protobuf type {@code + * google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .class, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder.class); + } + + // Construct using + // com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + confidenceThreshold_ = 0F; + + recall_ = 0F; + + precision_ = 0F; + + f1Score_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_ConfidenceMetricsEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + build() { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + buildPartial() { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry result = + new com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry( + this); + result.confidenceThreshold_ = confidenceThreshold_; + result.recall_ = recall_; + result.precision_ = precision_; + result.f1Score_ = f1Score_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) { + return mergeFrom( + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry other) { + if (other + == com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()) return this; + if (other.getConfidenceThreshold() != 0F) { + setConfidenceThreshold(other.getConfidenceThreshold()); + } + if (other.getRecall() != 0F) { + setRecall(other.getRecall()); + } + if (other.getPrecision() != 0F) { + setPrecision(other.getPrecision()); + } + if (other.getF1Score() != 0F) { + setF1Score(other.getF1Score()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float confidenceThreshold_; + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * Only annotations with score of at least this threshold are considered to
+       * be ones the model would return.
+       * 
+ * + * float confidence_threshold = 1; + */ + public float getConfidenceThreshold() { + return confidenceThreshold_; + } + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * Only annotations with score of at least this threshold are considered to
+       * be ones the model would return.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder setConfidenceThreshold(float value) { + + confidenceThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The confidence threshold value used to compute the metrics.
+       * Only annotations with score of at least this threshold are considered to
+       * be ones the model would return.
+       * 
+ * + * float confidence_threshold = 1; + */ + public Builder clearConfidenceThreshold() { + + confidenceThreshold_ = 0F; + onChanged(); + return this; + } + + private float recall_; + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 3; + */ + public float getRecall() { + return recall_; + } + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 3; + */ + public Builder setRecall(float value) { + + recall_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Recall under the given confidence threshold.
+       * 
+ * + * float recall = 3; + */ + public Builder clearRecall() { + + recall_ = 0F; + onChanged(); + return this; + } + + private float precision_; + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 4; + */ + public float getPrecision() { + return precision_; + } + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 4; + */ + public Builder setPrecision(float value) { + + precision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Precision under the given confidence threshold.
+       * 
+ * + * float precision = 4; + */ + public Builder clearPrecision() { + + precision_ = 0F; + onChanged(); + return this; + } + + private float f1Score_; + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 5; + */ + public float getF1Score() { + return f1Score_; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 5; + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The harmonic mean of recall and precision.
+       * 
+ * + * float f1_score = 5; + */ + public Builder clearF1Score() { + + f1Score_ = 0F; + 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + private static final com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntry + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfidenceMetricsEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfidenceMetricsEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int AU_PRC_FIELD_NUMBER = 1; + private float auPrc_; + /** + * + * + *
+   * Output only. The Area under precision recall curve metric.
+   * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + + public static final int CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER = 2; + private java.util.List< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry> + confidenceMetricsEntries_; + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry> + getConfidenceMetricsEntriesList() { + return confidenceMetricsEntries_; + } + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList() { + return confidenceMetricsEntries_; + } + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public int getConfidenceMetricsEntriesCount() { + return confidenceMetricsEntries_.size(); + } + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index) { + return confidenceMetricsEntries_.get(index); + } + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index) { + return confidenceMetricsEntries_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (auPrc_ != 0F) { + output.writeFloat(1, auPrc_); + } + for (int i = 0; i < confidenceMetricsEntries_.size(); i++) { + output.writeMessage(2, confidenceMetricsEntries_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (auPrc_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, auPrc_); + } + for (int i = 0; i < confidenceMetricsEntries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, confidenceMetricsEntries_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextExtractionEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics other = + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) obj; + + if (java.lang.Float.floatToIntBits(getAuPrc()) + != java.lang.Float.floatToIntBits(other.getAuPrc())) return false; + if (!getConfidenceMetricsEntriesList().equals(other.getConfidenceMetricsEntriesList())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AU_PRC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuPrc()); + if (getConfidenceMetricsEntriesCount() > 0) { + hash = (37 * hash) + CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceMetricsEntriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics 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.automl.v1.TextExtractionEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics 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.automl.v1.TextExtractionEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics 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.automl.v1.TextExtractionEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics 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.automl.v1.TextExtractionEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics 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.automl.v1.TextExtractionEvaluationMetrics 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; + } + /** + * + * + *
+   * Model evaluation metrics for text extraction problems.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionEvaluationMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextExtractionEvaluationMetrics) + com.google.cloud.automl.v1.TextExtractionEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.class, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConfidenceMetricsEntriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + auPrc_ = 0F; + + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + confidenceMetricsEntriesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextExtraction + .internal_static_google_cloud_automl_v1_TextExtractionEvaluationMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics build() { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics result = + new com.google.cloud.automl.v1.TextExtractionEvaluationMetrics(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.auPrc_ = auPrc_; + if (confidenceMetricsEntriesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + confidenceMetricsEntries_ = + java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.confidenceMetricsEntries_ = confidenceMetricsEntries_; + } else { + result.confidenceMetricsEntries_ = confidenceMetricsEntriesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextExtractionEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.getDefaultInstance()) + return this; + if (other.getAuPrc() != 0F) { + setAuPrc(other.getAuPrc()); + } + if (confidenceMetricsEntriesBuilder_ == null) { + if (!other.confidenceMetricsEntries_.isEmpty()) { + if (confidenceMetricsEntries_.isEmpty()) { + confidenceMetricsEntries_ = other.confidenceMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.addAll(other.confidenceMetricsEntries_); + } + onChanged(); + } + } else { + if (!other.confidenceMetricsEntries_.isEmpty()) { + if (confidenceMetricsEntriesBuilder_.isEmpty()) { + confidenceMetricsEntriesBuilder_.dispose(); + confidenceMetricsEntriesBuilder_ = null; + confidenceMetricsEntries_ = other.confidenceMetricsEntries_; + bitField0_ = (bitField0_ & ~0x00000002); + confidenceMetricsEntriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConfidenceMetricsEntriesFieldBuilder() + : null; + } else { + confidenceMetricsEntriesBuilder_.addAllMessages(other.confidenceMetricsEntries_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextExtractionEvaluationMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private float auPrc_; + /** + * + * + *
+     * Output only. The Area under precision recall curve metric.
+     * 
+ * + * float au_prc = 1; + */ + public float getAuPrc() { + return auPrc_; + } + /** + * + * + *
+     * Output only. The Area under precision recall curve metric.
+     * 
+ * + * float au_prc = 1; + */ + public Builder setAuPrc(float value) { + + auPrc_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Area under precision recall curve metric.
+     * 
+ * + * float au_prc = 1; + */ + public Builder clearAuPrc() { + + auPrc_ = 0F; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry> + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + + private void ensureConfidenceMetricsEntriesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + confidenceMetricsEntries_ = + new java.util.ArrayList< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry>( + confidenceMetricsEntries_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + confidenceMetricsEntriesBuilder_; + + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry> + getConfidenceMetricsEntriesList() { + if (confidenceMetricsEntriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } else { + return confidenceMetricsEntriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public int getConfidenceMetricsEntriesCount() { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.size(); + } else { + return confidenceMetricsEntriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.get(index); + } else { + return confidenceMetricsEntriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder setConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.set(index, value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder setConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.set(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder addConfidenceMetricsEntries( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder addConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry value) { + if (confidenceMetricsEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(index, value); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder addConfidenceMetricsEntries( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder addConfidenceMetricsEntries( + int index, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + builderForValue) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.add(index, builderForValue.build()); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder addAllConfidenceMetricsEntries( + java.lang.Iterable< + ? extends + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntry> + values) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceMetricsEntries_); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder clearConfidenceMetricsEntries() { + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public Builder removeConfidenceMetricsEntries(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + ensureConfidenceMetricsEntriesIsMutable(); + confidenceMetricsEntries_.remove(index); + onChanged(); + } else { + confidenceMetricsEntriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + getConfidenceMetricsEntriesBuilder(int index) { + return getConfidenceMetricsEntriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index) { + if (confidenceMetricsEntriesBuilder_ == null) { + return confidenceMetricsEntries_.get(index); + } else { + return confidenceMetricsEntriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList() { + if (confidenceMetricsEntriesBuilder_ != null) { + return confidenceMetricsEntriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(confidenceMetricsEntries_); + } + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntriesBuilder() { + return getConfidenceMetricsEntriesFieldBuilder() + .addBuilder( + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.Builder + addConfidenceMetricsEntriesBuilder(int index) { + return getConfidenceMetricsEntriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Metrics that have confidence thresholds.
+     * Precision-recall curve can be derived from it.
+     * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + public java.util.List< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder> + getConfidenceMetricsEntriesBuilderList() { + return getConfidenceMetricsEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesFieldBuilder() { + if (confidenceMetricsEntriesBuilder_ == null) { + confidenceMetricsEntriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + .Builder, + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder>( + confidenceMetricsEntries_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + confidenceMetricsEntries_ = null; + } + return confidenceMetricsEntriesBuilder_; + } + + @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.automl.v1.TextExtractionEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextExtractionEvaluationMetrics) + private static final com.google.cloud.automl.v1.TextExtractionEvaluationMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1.TextExtractionEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextExtractionEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextExtractionEvaluationMetrics(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetricsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000..d804ef190 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionEvaluationMetricsOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_extraction.proto + +package com.google.cloud.automl.v1; + +public interface TextExtractionEvaluationMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextExtractionEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The Area under precision recall curve metric.
+   * 
+ * + * float au_prc = 1; + */ + float getAuPrc(); + + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + java.util.List + getConfidenceMetricsEntriesList(); + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + getConfidenceMetricsEntries(int index); + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + int getConfidenceMetricsEntriesCount(); + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics + .ConfidenceMetricsEntryOrBuilder> + getConfidenceMetricsEntriesOrBuilderList(); + /** + * + * + *
+   * Output only. Metrics that have confidence thresholds.
+   * Precision-recall curve can be derived from it.
+   * 
+ * + * + * repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * + */ + com.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntryOrBuilder + getConfidenceMetricsEntriesOrBuilder(int index); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadata.java new file mode 100644 index 000000000..357010d3b --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadata.java @@ -0,0 +1,451 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata that is specific to text extraction.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionModelMetadata} + */ +public final class TextExtractionModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextExtractionModelMetadata) + TextExtractionModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextExtractionModelMetadata.newBuilder() to construct. + private TextExtractionModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextExtractionModelMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextExtractionModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionModelMetadata.class, + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextExtractionModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextExtractionModelMetadata other = + (com.google.cloud.automl.v1.TextExtractionModelMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata 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.automl.v1.TextExtractionModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata 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.automl.v1.TextExtractionModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata 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.automl.v1.TextExtractionModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata 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.automl.v1.TextExtractionModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata 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.automl.v1.TextExtractionModelMetadata 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; + } + /** + * + * + *
+   * Model metadata that is specific to text extraction.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextExtractionModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextExtractionModelMetadata) + com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextExtractionModelMetadata.class, + com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextExtractionModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionModelMetadata build() { + com.google.cloud.automl.v1.TextExtractionModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionModelMetadata buildPartial() { + com.google.cloud.automl.v1.TextExtractionModelMetadata result = + new com.google.cloud.automl.v1.TextExtractionModelMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextExtractionModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextExtractionModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextExtractionModelMetadata other) { + if (other == com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextExtractionModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextExtractionModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.TextExtractionModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextExtractionModelMetadata) + private static final com.google.cloud.automl.v1.TextExtractionModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextExtractionModelMetadata(); + } + + public static com.google.cloud.automl.v1.TextExtractionModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextExtractionModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextExtractionModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextExtractionModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadataOrBuilder.java new file mode 100644 index 000000000..a5ea2927c --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextExtractionModelMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextExtractionModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextExtractionModelMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextProto.java new file mode 100644 index 000000000..a125720e6 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextProto.java @@ -0,0 +1,144 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public final class TextProto { + private TextProto() {} + + 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_automl_v1_TextClassificationDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextClassificationDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextClassificationModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextExtractionDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextExtractionModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_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/automl/v1/text.proto\022\026goo" + + "gle.cloud.automl.v1\032\034google/api/annotati" + + "ons.proto\032+google/cloud/automl/v1/classi" + + "fication.proto\"l\n!TextClassificationData" + + "setMetadata\022G\n\023classification_type\030\001 \001(\016" + + "2*.google.cloud.automl.v1.Classification" + + "Type\"j\n\037TextClassificationModelMetadata\022" + + "G\n\023classification_type\030\003 \001(\0162*.google.cl" + + "oud.automl.v1.ClassificationType\"\037\n\035Text" + + "ExtractionDatasetMetadata\"\035\n\033TextExtract" + + "ionModelMetadata\"5\n\034TextSentimentDataset" + + "Metadata\022\025\n\rsentiment_max\030\001 \001(\005\"\034\n\032TextS" + + "entimentModelMetadataB\265\001\n\032com.google.clo" + + "ud.automl.v1B\tTextProtoP\001Z + * A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. + * + * + * Protobuf type {@code google.cloud.automl.v1.TextSegment} + */ +public final class TextSegment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSegment) + TextSegmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSegment.newBuilder() to construct. + private TextSegment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSegment() { + content_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSegment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + startOffset_ = input.readInt64(); + break; + } + case 16: + { + endOffset_ = input.readInt64(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSegmentProto + .internal_static_google_cloud_automl_v1_TextSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSegmentProto + .internal_static_google_cloud_automl_v1_TextSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSegment.class, + com.google.cloud.automl.v1.TextSegment.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * + * + *
+   * Output only. The content of the TextSegment.
+   * 
+ * + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The content of the TextSegment.
+   * 
+ * + * string content = 3; + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_OFFSET_FIELD_NUMBER = 1; + private long startOffset_; + /** + * + * + *
+   * Required. Zero-based character index of the first character of the text
+   * segment (counting characters from the beginning of the text).
+   * 
+ * + * int64 start_offset = 1; + */ + public long getStartOffset() { + return startOffset_; + } + + public static final int END_OFFSET_FIELD_NUMBER = 2; + private long endOffset_; + /** + * + * + *
+   * Required. Zero-based character index of the first character past the end of
+   * the text segment (counting character from the beginning of the text).
+   * The character at the end_offset is NOT included in the text segment.
+   * 
+ * + * int64 end_offset = 2; + */ + public long getEndOffset() { + return endOffset_; + } + + 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 (startOffset_ != 0L) { + output.writeInt64(1, startOffset_); + } + if (endOffset_ != 0L) { + output.writeInt64(2, endOffset_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, startOffset_); + } + if (endOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, endOffset_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextSegment)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSegment other = (com.google.cloud.automl.v1.TextSegment) obj; + + if (!getContent().equals(other.getContent())) return false; + if (getStartOffset() != other.getStartOffset()) return false; + if (getEndOffset() != other.getEndOffset()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + START_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStartOffset()); + hash = (37 * hash) + END_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEndOffset()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSegment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSegment 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.automl.v1.TextSegment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSegment 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.automl.v1.TextSegment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSegment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextSegment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSegment 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.automl.v1.TextSegment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSegment 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.automl.v1.TextSegment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSegment 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.automl.v1.TextSegment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSegment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSegment) + com.google.cloud.automl.v1.TextSegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSegmentProto + .internal_static_google_cloud_automl_v1_TextSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSegmentProto + .internal_static_google_cloud_automl_v1_TextSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSegment.class, + com.google.cloud.automl.v1.TextSegment.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSegment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + startOffset_ = 0L; + + endOffset_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextSegmentProto + .internal_static_google_cloud_automl_v1_TextSegment_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSegment getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSegment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSegment build() { + com.google.cloud.automl.v1.TextSegment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSegment buildPartial() { + com.google.cloud.automl.v1.TextSegment result = + new com.google.cloud.automl.v1.TextSegment(this); + result.content_ = content_; + result.startOffset_ = startOffset_; + result.endOffset_ = endOffset_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextSegment) { + return mergeFrom((com.google.cloud.automl.v1.TextSegment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSegment other) { + if (other == com.google.cloud.automl.v1.TextSegment.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.getStartOffset() != 0L) { + setStartOffset(other.getStartOffset()); + } + if (other.getEndOffset() != 0L) { + setEndOffset(other.getEndOffset()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextSegment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.TextSegment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + * + * + *
+     * Output only. The content of the TextSegment.
+     * 
+ * + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The content of the TextSegment.
+     * 
+ * + * string content = 3; + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The content of the TextSegment.
+     * 
+ * + * string content = 3; + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The content of the TextSegment.
+     * 
+ * + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The content of the TextSegment.
+     * 
+ * + * string content = 3; + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private long startOffset_; + /** + * + * + *
+     * Required. Zero-based character index of the first character of the text
+     * segment (counting characters from the beginning of the text).
+     * 
+ * + * int64 start_offset = 1; + */ + public long getStartOffset() { + return startOffset_; + } + /** + * + * + *
+     * Required. Zero-based character index of the first character of the text
+     * segment (counting characters from the beginning of the text).
+     * 
+ * + * int64 start_offset = 1; + */ + public Builder setStartOffset(long value) { + + startOffset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Zero-based character index of the first character of the text
+     * segment (counting characters from the beginning of the text).
+     * 
+ * + * int64 start_offset = 1; + */ + public Builder clearStartOffset() { + + startOffset_ = 0L; + onChanged(); + return this; + } + + private long endOffset_; + /** + * + * + *
+     * Required. Zero-based character index of the first character past the end of
+     * the text segment (counting character from the beginning of the text).
+     * The character at the end_offset is NOT included in the text segment.
+     * 
+ * + * int64 end_offset = 2; + */ + public long getEndOffset() { + return endOffset_; + } + /** + * + * + *
+     * Required. Zero-based character index of the first character past the end of
+     * the text segment (counting character from the beginning of the text).
+     * The character at the end_offset is NOT included in the text segment.
+     * 
+ * + * int64 end_offset = 2; + */ + public Builder setEndOffset(long value) { + + endOffset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Zero-based character index of the first character past the end of
+     * the text segment (counting character from the beginning of the text).
+     * The character at the end_offset is NOT included in the text segment.
+     * 
+ * + * int64 end_offset = 2; + */ + public Builder clearEndOffset() { + + endOffset_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.TextSegment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSegment) + private static final com.google.cloud.automl.v1.TextSegment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSegment(); + } + + public static com.google.cloud.automl.v1.TextSegment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSegment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSegment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSegment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentOrBuilder.java new file mode 100644 index 000000000..019a97d68 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_segment.proto + +package com.google.cloud.automl.v1; + +public interface TextSegmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSegment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The content of the TextSegment.
+   * 
+ * + * string content = 3; + */ + java.lang.String getContent(); + /** + * + * + *
+   * Output only. The content of the TextSegment.
+   * 
+ * + * string content = 3; + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
+   * Required. Zero-based character index of the first character of the text
+   * segment (counting characters from the beginning of the text).
+   * 
+ * + * int64 start_offset = 1; + */ + long getStartOffset(); + + /** + * + * + *
+   * Required. Zero-based character index of the first character past the end of
+   * the text segment (counting character from the beginning of the text).
+   * The character at the end_offset is NOT included in the text segment.
+   * 
+ * + * int64 end_offset = 2; + */ + long getEndOffset(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentProto.java new file mode 100644 index 000000000..a59f38b23 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSegmentProto.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_segment.proto + +package com.google.cloud.automl.v1; + +public final class TextSegmentProto { + private TextSegmentProto() {} + + 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_automl_v1_TextSegment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextSegment_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/automl/v1/text_segment.pr" + + "oto\022\026google.cloud.automl.v1\032\034google/api/" + + "annotations.proto\"H\n\013TextSegment\022\017\n\007cont" + + "ent\030\003 \001(\t\022\024\n\014start_offset\030\001 \001(\003\022\022\n\nend_o" + + "ffset\030\002 \001(\003B\274\001\n\032com.google.cloud.automl." + + "v1B\020TextSegmentProtoP\001Z + * Contains annotation details specific to text sentiment. + * + * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentAnnotation} + */ +public final class TextSentimentAnnotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSentimentAnnotation) + TextSentimentAnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSentimentAnnotation.newBuilder() to construct. + private TextSentimentAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSentimentAnnotation() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSentimentAnnotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + sentiment_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentAnnotation.class, + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder.class); + } + + public static final int SENTIMENT_FIELD_NUMBER = 1; + private int sentiment_; + /** + * + * + *
+   * Output only. The sentiment with the semantic, as given to the
+   * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when
+   * populating the dataset from which the model used for the prediction had
+   * been trained. The sentiment values are between 0 and
+   * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
+   * with higher value meaning more positive sentiment. They are completely
+   * relative, i.e. 0 means least positive sentiment and sentiment_max means
+   * the most positive from the sentiments present in the train data. Therefore
+   *  e.g. if train data had only negative sentiment, then sentiment_max, would
+   * be still negative (although least negative).
+   * The sentiment shouldn't be confused with "score" or "magnitude"
+   * from the previous Natural Language Sentiment Analysis API.
+   * 
+ * + * int32 sentiment = 1; + */ + public int getSentiment() { + return sentiment_; + } + + 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 (sentiment_ != 0) { + output.writeInt32(1, sentiment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sentiment_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, sentiment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextSentimentAnnotation)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSentimentAnnotation other = + (com.google.cloud.automl.v1.TextSentimentAnnotation) obj; + + if (getSentiment() != other.getSentiment()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; + hash = (53 * hash) + getSentiment(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation 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.automl.v1.TextSentimentAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation 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.automl.v1.TextSentimentAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation 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.automl.v1.TextSentimentAnnotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation 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.automl.v1.TextSentimentAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation 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.automl.v1.TextSentimentAnnotation 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; + } + /** + * + * + *
+   * Contains annotation details specific to text sentiment.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentAnnotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSentimentAnnotation) + com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentAnnotation.class, + com.google.cloud.automl.v1.TextSentimentAnnotation.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSentimentAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sentiment_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentAnnotation getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentAnnotation build() { + com.google.cloud.automl.v1.TextSentimentAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentAnnotation buildPartial() { + com.google.cloud.automl.v1.TextSentimentAnnotation result = + new com.google.cloud.automl.v1.TextSentimentAnnotation(this); + result.sentiment_ = sentiment_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextSentimentAnnotation) { + return mergeFrom((com.google.cloud.automl.v1.TextSentimentAnnotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSentimentAnnotation other) { + if (other == com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance()) + return this; + if (other.getSentiment() != 0) { + setSentiment(other.getSentiment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextSentimentAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextSentimentAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sentiment_; + /** + * + * + *
+     * Output only. The sentiment with the semantic, as given to the
+     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when
+     * populating the dataset from which the model used for the prediction had
+     * been trained. The sentiment values are between 0 and
+     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
+     * with higher value meaning more positive sentiment. They are completely
+     * relative, i.e. 0 means least positive sentiment and sentiment_max means
+     * the most positive from the sentiments present in the train data. Therefore
+     *  e.g. if train data had only negative sentiment, then sentiment_max, would
+     * be still negative (although least negative).
+     * The sentiment shouldn't be confused with "score" or "magnitude"
+     * from the previous Natural Language Sentiment Analysis API.
+     * 
+ * + * int32 sentiment = 1; + */ + public int getSentiment() { + return sentiment_; + } + /** + * + * + *
+     * Output only. The sentiment with the semantic, as given to the
+     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when
+     * populating the dataset from which the model used for the prediction had
+     * been trained. The sentiment values are between 0 and
+     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
+     * with higher value meaning more positive sentiment. They are completely
+     * relative, i.e. 0 means least positive sentiment and sentiment_max means
+     * the most positive from the sentiments present in the train data. Therefore
+     *  e.g. if train data had only negative sentiment, then sentiment_max, would
+     * be still negative (although least negative).
+     * The sentiment shouldn't be confused with "score" or "magnitude"
+     * from the previous Natural Language Sentiment Analysis API.
+     * 
+ * + * int32 sentiment = 1; + */ + public Builder setSentiment(int value) { + + sentiment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The sentiment with the semantic, as given to the
+     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when
+     * populating the dataset from which the model used for the prediction had
+     * been trained. The sentiment values are between 0 and
+     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
+     * with higher value meaning more positive sentiment. They are completely
+     * relative, i.e. 0 means least positive sentiment and sentiment_max means
+     * the most positive from the sentiments present in the train data. Therefore
+     *  e.g. if train data had only negative sentiment, then sentiment_max, would
+     * be still negative (although least negative).
+     * The sentiment shouldn't be confused with "score" or "magnitude"
+     * from the previous Natural Language Sentiment Analysis API.
+     * 
+ * + * int32 sentiment = 1; + */ + public Builder clearSentiment() { + + sentiment_ = 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.automl.v1.TextSentimentAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSentimentAnnotation) + private static final com.google.cloud.automl.v1.TextSentimentAnnotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSentimentAnnotation(); + } + + public static com.google.cloud.automl.v1.TextSentimentAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSentimentAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSentimentAnnotation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentAnnotationOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentAnnotationOrBuilder.java new file mode 100644 index 000000000..20e4fb9d3 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentAnnotationOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_sentiment.proto + +package com.google.cloud.automl.v1; + +public interface TextSentimentAnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSentimentAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The sentiment with the semantic, as given to the
+   * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when
+   * populating the dataset from which the model used for the prediction had
+   * been trained. The sentiment values are between 0 and
+   * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
+   * with higher value meaning more positive sentiment. They are completely
+   * relative, i.e. 0 means least positive sentiment and sentiment_max means
+   * the most positive from the sentiments present in the train data. Therefore
+   *  e.g. if train data had only negative sentiment, then sentiment_max, would
+   * be still negative (although least negative).
+   * The sentiment shouldn't be confused with "score" or "magnitude"
+   * from the previous Natural Language Sentiment Analysis API.
+   * 
+ * + * int32 sentiment = 1; + */ + int getSentiment(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadata.java new file mode 100644 index 000000000..e88786de8 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadata.java @@ -0,0 +1,547 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Dataset metadata for text sentiment.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentDatasetMetadata} + */ +public final class TextSentimentDatasetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSentimentDatasetMetadata) + TextSentimentDatasetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSentimentDatasetMetadata.newBuilder() to construct. + private TextSentimentDatasetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSentimentDatasetMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSentimentDatasetMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + sentimentMax_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.class, + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder.class); + } + + public static final int SENTIMENT_MAX_FIELD_NUMBER = 1; + private int sentimentMax_; + /** + * + * + *
+   * Required. A sentiment is expressed as an integer ordinal, where higher
+   * value means a more positive sentiment. The range of sentiments that will be
+   * used is between 0 and sentiment_max (inclusive on both ends), and all the
+   * values in the range must be represented in the dataset before a model can
+   * be created. sentiment_max value must be between 1 and 10 (inclusive).
+   * 
+ * + * int32 sentiment_max = 1; + */ + public int getSentimentMax() { + return sentimentMax_; + } + + 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 (sentimentMax_ != 0) { + output.writeInt32(1, sentimentMax_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sentimentMax_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, sentimentMax_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextSentimentDatasetMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSentimentDatasetMetadata other = + (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) obj; + + if (getSentimentMax() != other.getSentimentMax()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SENTIMENT_MAX_FIELD_NUMBER; + hash = (53 * hash) + getSentimentMax(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata 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.automl.v1.TextSentimentDatasetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata 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.automl.v1.TextSentimentDatasetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata 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.automl.v1.TextSentimentDatasetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata 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.automl.v1.TextSentimentDatasetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata 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.automl.v1.TextSentimentDatasetMetadata 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; + } + /** + * + * + *
+   * Dataset metadata for text sentiment.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentDatasetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSentimentDatasetMetadata) + com.google.cloud.automl.v1.TextSentimentDatasetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.class, + com.google.cloud.automl.v1.TextSentimentDatasetMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSentimentDatasetMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sentimentMax_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentDatasetMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata build() { + com.google.cloud.automl.v1.TextSentimentDatasetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata buildPartial() { + com.google.cloud.automl.v1.TextSentimentDatasetMetadata result = + new com.google.cloud.automl.v1.TextSentimentDatasetMetadata(this); + result.sentimentMax_ = sentimentMax_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextSentimentDatasetMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextSentimentDatasetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSentimentDatasetMetadata other) { + if (other == com.google.cloud.automl.v1.TextSentimentDatasetMetadata.getDefaultInstance()) + return this; + if (other.getSentimentMax() != 0) { + setSentimentMax(other.getSentimentMax()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextSentimentDatasetMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextSentimentDatasetMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sentimentMax_; + /** + * + * + *
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
+     * 
+ * + * int32 sentiment_max = 1; + */ + public int getSentimentMax() { + return sentimentMax_; + } + /** + * + * + *
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
+     * 
+ * + * int32 sentiment_max = 1; + */ + public Builder setSentimentMax(int value) { + + sentimentMax_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
+     * 
+ * + * int32 sentiment_max = 1; + */ + public Builder clearSentimentMax() { + + sentimentMax_ = 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.automl.v1.TextSentimentDatasetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSentimentDatasetMetadata) + private static final com.google.cloud.automl.v1.TextSentimentDatasetMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + } + + public static com.google.cloud.automl.v1.TextSentimentDatasetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSentimentDatasetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSentimentDatasetMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentDatasetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadataOrBuilder.java new file mode 100644 index 000000000..2b1a192fc --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentDatasetMetadataOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextSentimentDatasetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSentimentDatasetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A sentiment is expressed as an integer ordinal, where higher
+   * value means a more positive sentiment. The range of sentiments that will be
+   * used is between 0 and sentiment_max (inclusive on both ends), and all the
+   * values in the range must be represented in the dataset before a model can
+   * be created. sentiment_max value must be between 1 and 10 (inclusive).
+   * 
+ * + * int32 sentiment_max = 1; + */ + int getSentimentMax(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetrics.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetrics.java new file mode 100644 index 000000000..68ecc2791 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetrics.java @@ -0,0 +1,1362 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_sentiment.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model evaluation metrics for text sentiment problems.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentEvaluationMetrics} + */ +public final class TextSentimentEvaluationMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSentimentEvaluationMetrics) + TextSentimentEvaluationMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSentimentEvaluationMetrics.newBuilder() to construct. + private TextSentimentEvaluationMetrics( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSentimentEvaluationMetrics() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSentimentEvaluationMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + precision_ = input.readFloat(); + break; + } + case 21: + { + recall_ = input.readFloat(); + break; + } + case 29: + { + f1Score_ = input.readFloat(); + break; + } + case 37: + { + meanAbsoluteError_ = input.readFloat(); + break; + } + case 45: + { + meanSquaredError_ = input.readFloat(); + break; + } + case 53: + { + linearKappa_ = input.readFloat(); + break; + } + case 61: + { + quadraticKappa_ = input.readFloat(); + break; + } + case 66: + { + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + subBuilder = null; + if (confusionMatrix_ != null) { + subBuilder = confusionMatrix_.toBuilder(); + } + confusionMatrix_ = + input.readMessage( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(confusionMatrix_); + confusionMatrix_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.class, + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder.class); + } + + public static final int PRECISION_FIELD_NUMBER = 1; + private float precision_; + /** + * + * + *
+   * Output only. Precision.
+   * 
+ * + * float precision = 1; + */ + public float getPrecision() { + return precision_; + } + + public static final int RECALL_FIELD_NUMBER = 2; + private float recall_; + /** + * + * + *
+   * Output only. Recall.
+   * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + + public static final int F1_SCORE_FIELD_NUMBER = 3; + private float f1Score_; + /** + * + * + *
+   * Output only. The harmonic mean of recall and precision.
+   * 
+ * + * float f1_score = 3; + */ + public float getF1Score() { + return f1Score_; + } + + public static final int MEAN_ABSOLUTE_ERROR_FIELD_NUMBER = 4; + private float meanAbsoluteError_; + /** + * + * + *
+   * Output only. Mean absolute error. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float mean_absolute_error = 4; + */ + public float getMeanAbsoluteError() { + return meanAbsoluteError_; + } + + public static final int MEAN_SQUARED_ERROR_FIELD_NUMBER = 5; + private float meanSquaredError_; + /** + * + * + *
+   * Output only. Mean squared error. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float mean_squared_error = 5; + */ + public float getMeanSquaredError() { + return meanSquaredError_; + } + + public static final int LINEAR_KAPPA_FIELD_NUMBER = 6; + private float linearKappa_; + /** + * + * + *
+   * Output only. Linear weighted kappa. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float linear_kappa = 6; + */ + public float getLinearKappa() { + return linearKappa_; + } + + public static final int QUADRATIC_KAPPA_FIELD_NUMBER = 7; + private float quadraticKappa_; + /** + * + * + *
+   * Output only. Quadratic weighted kappa. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float quadratic_kappa = 7; + */ + public float getQuadraticKappa() { + return quadraticKappa_; + } + + public static final int CONFUSION_MATRIX_FIELD_NUMBER = 8; + private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + confusionMatrix_; + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public boolean hasConfusionMatrix() { + return confusionMatrix_ != null; + } + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getConfusionMatrix() { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder() { + return getConfusionMatrix(); + } + + 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 (precision_ != 0F) { + output.writeFloat(1, precision_); + } + if (recall_ != 0F) { + output.writeFloat(2, recall_); + } + if (f1Score_ != 0F) { + output.writeFloat(3, f1Score_); + } + if (meanAbsoluteError_ != 0F) { + output.writeFloat(4, meanAbsoluteError_); + } + if (meanSquaredError_ != 0F) { + output.writeFloat(5, meanSquaredError_); + } + if (linearKappa_ != 0F) { + output.writeFloat(6, linearKappa_); + } + if (quadraticKappa_ != 0F) { + output.writeFloat(7, quadraticKappa_); + } + if (confusionMatrix_ != null) { + output.writeMessage(8, getConfusionMatrix()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (precision_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, precision_); + } + if (recall_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_); + } + if (f1Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, f1Score_); + } + if (meanAbsoluteError_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, meanAbsoluteError_); + } + if (meanSquaredError_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, meanSquaredError_); + } + if (linearKappa_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, linearKappa_); + } + if (quadraticKappa_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, quadraticKappa_); + } + if (confusionMatrix_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getConfusionMatrix()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextSentimentEvaluationMetrics)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics other = + (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) 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 (java.lang.Float.floatToIntBits(getMeanAbsoluteError()) + != java.lang.Float.floatToIntBits(other.getMeanAbsoluteError())) return false; + if (java.lang.Float.floatToIntBits(getMeanSquaredError()) + != java.lang.Float.floatToIntBits(other.getMeanSquaredError())) return false; + if (java.lang.Float.floatToIntBits(getLinearKappa()) + != java.lang.Float.floatToIntBits(other.getLinearKappa())) return false; + if (java.lang.Float.floatToIntBits(getQuadraticKappa()) + != java.lang.Float.floatToIntBits(other.getQuadraticKappa())) return false; + if (hasConfusionMatrix() != other.hasConfusionMatrix()) return false; + if (hasConfusionMatrix()) { + if (!getConfusionMatrix().equals(other.getConfusionMatrix())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + MEAN_ABSOLUTE_ERROR_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMeanAbsoluteError()); + hash = (37 * hash) + MEAN_SQUARED_ERROR_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMeanSquaredError()); + hash = (37 * hash) + LINEAR_KAPPA_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getLinearKappa()); + hash = (37 * hash) + QUADRATIC_KAPPA_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getQuadraticKappa()); + if (hasConfusionMatrix()) { + hash = (37 * hash) + CONFUSION_MATRIX_FIELD_NUMBER; + hash = (53 * hash) + getConfusionMatrix().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics 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.automl.v1.TextSentimentEvaluationMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics 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.automl.v1.TextSentimentEvaluationMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics 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.automl.v1.TextSentimentEvaluationMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics 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.automl.v1.TextSentimentEvaluationMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics 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.automl.v1.TextSentimentEvaluationMetrics 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; + } + /** + * + * + *
+   * Model evaluation metrics for text sentiment problems.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentEvaluationMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSentimentEvaluationMetrics) + com.google.cloud.automl.v1.TextSentimentEvaluationMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.class, + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + precision_ = 0F; + + recall_ = 0F; + + f1Score_ = 0F; + + meanAbsoluteError_ = 0F; + + meanSquaredError_ = 0F; + + linearKappa_ = 0F; + + quadraticKappa_ = 0F; + + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextSentimentProto + .internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics build() { + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics buildPartial() { + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics result = + new com.google.cloud.automl.v1.TextSentimentEvaluationMetrics(this); + result.precision_ = precision_; + result.recall_ = recall_; + result.f1Score_ = f1Score_; + result.meanAbsoluteError_ = meanAbsoluteError_; + result.meanSquaredError_ = meanSquaredError_; + result.linearKappa_ = linearKappa_; + result.quadraticKappa_ = quadraticKappa_; + if (confusionMatrixBuilder_ == null) { + result.confusionMatrix_ = confusionMatrix_; + } else { + result.confusionMatrix_ = confusionMatrixBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) { + return mergeFrom((com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSentimentEvaluationMetrics other) { + if (other == com.google.cloud.automl.v1.TextSentimentEvaluationMetrics.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.getMeanAbsoluteError() != 0F) { + setMeanAbsoluteError(other.getMeanAbsoluteError()); + } + if (other.getMeanSquaredError() != 0F) { + setMeanSquaredError(other.getMeanSquaredError()); + } + if (other.getLinearKappa() != 0F) { + setLinearKappa(other.getLinearKappa()); + } + if (other.getQuadraticKappa() != 0F) { + setQuadraticKappa(other.getQuadraticKappa()); + } + if (other.hasConfusionMatrix()) { + mergeConfusionMatrix(other.getConfusionMatrix()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextSentimentEvaluationMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextSentimentEvaluationMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float precision_; + /** + * + * + *
+     * Output only. Precision.
+     * 
+ * + * float precision = 1; + */ + public float getPrecision() { + return precision_; + } + /** + * + * + *
+     * Output only. Precision.
+     * 
+ * + * float precision = 1; + */ + public Builder setPrecision(float value) { + + precision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Precision.
+     * 
+ * + * float precision = 1; + */ + public Builder clearPrecision() { + + precision_ = 0F; + onChanged(); + return this; + } + + private float recall_; + /** + * + * + *
+     * Output only. Recall.
+     * 
+ * + * float recall = 2; + */ + public float getRecall() { + return recall_; + } + /** + * + * + *
+     * Output only. Recall.
+     * 
+ * + * float recall = 2; + */ + public Builder setRecall(float value) { + + recall_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Recall.
+     * 
+ * + * float recall = 2; + */ + public Builder clearRecall() { + + recall_ = 0F; + onChanged(); + return this; + } + + private float f1Score_; + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 3; + */ + public float getF1Score() { + return f1Score_; + } + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 3; + */ + public Builder setF1Score(float value) { + + f1Score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The harmonic mean of recall and precision.
+     * 
+ * + * float f1_score = 3; + */ + public Builder clearF1Score() { + + f1Score_ = 0F; + onChanged(); + return this; + } + + private float meanAbsoluteError_; + /** + * + * + *
+     * Output only. Mean absolute error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_absolute_error = 4; + */ + public float getMeanAbsoluteError() { + return meanAbsoluteError_; + } + /** + * + * + *
+     * Output only. Mean absolute error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_absolute_error = 4; + */ + public Builder setMeanAbsoluteError(float value) { + + meanAbsoluteError_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Mean absolute error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_absolute_error = 4; + */ + public Builder clearMeanAbsoluteError() { + + meanAbsoluteError_ = 0F; + onChanged(); + return this; + } + + private float meanSquaredError_; + /** + * + * + *
+     * Output only. Mean squared error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_squared_error = 5; + */ + public float getMeanSquaredError() { + return meanSquaredError_; + } + /** + * + * + *
+     * Output only. Mean squared error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_squared_error = 5; + */ + public Builder setMeanSquaredError(float value) { + + meanSquaredError_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Mean squared error. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float mean_squared_error = 5; + */ + public Builder clearMeanSquaredError() { + + meanSquaredError_ = 0F; + onChanged(); + return this; + } + + private float linearKappa_; + /** + * + * + *
+     * Output only. Linear weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float linear_kappa = 6; + */ + public float getLinearKappa() { + return linearKappa_; + } + /** + * + * + *
+     * Output only. Linear weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float linear_kappa = 6; + */ + public Builder setLinearKappa(float value) { + + linearKappa_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Linear weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float linear_kappa = 6; + */ + public Builder clearLinearKappa() { + + linearKappa_ = 0F; + onChanged(); + return this; + } + + private float quadraticKappa_; + /** + * + * + *
+     * Output only. Quadratic weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float quadratic_kappa = 7; + */ + public float getQuadraticKappa() { + return quadraticKappa_; + } + /** + * + * + *
+     * Output only. Quadratic weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float quadratic_kappa = 7; + */ + public Builder setQuadraticKappa(float value) { + + quadraticKappa_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Quadratic weighted kappa. Only set for the overall model
+     * evaluation, not for evaluation of a single annotation spec.
+     * 
+ * + * float quadratic_kappa = 7; + */ + public Builder clearQuadraticKappa() { + + quadraticKappa_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + confusionMatrix_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> + confusionMatrixBuilder_; + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public boolean hasConfusionMatrix() { + return confusionMatrixBuilder_ != null || confusionMatrix_ != null; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + getConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } else { + return confusionMatrixBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public Builder setConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + confusionMatrix_ = value; + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public Builder setConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + builderForValue) { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = builderForValue.build(); + onChanged(); + } else { + confusionMatrixBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public Builder mergeConfusionMatrix( + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) { + if (confusionMatrixBuilder_ == null) { + if (confusionMatrix_ != null) { + confusionMatrix_ = + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder( + confusionMatrix_) + .mergeFrom(value) + .buildPartial(); + } else { + confusionMatrix_ = value; + } + onChanged(); + } else { + confusionMatrixBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public Builder clearConfusionMatrix() { + if (confusionMatrixBuilder_ == null) { + confusionMatrix_ = null; + onChanged(); + } else { + confusionMatrix_ = null; + confusionMatrixBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder + getConfusionMatrixBuilder() { + + onChanged(); + return getConfusionMatrixFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder() { + if (confusionMatrixBuilder_ != null) { + return confusionMatrixBuilder_.getMessageOrBuilder(); + } else { + return confusionMatrix_ == null + ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + .getDefaultInstance() + : confusionMatrix_; + } + } + /** + * + * + *
+     * Output only. Confusion matrix of the evaluation.
+     * Only set for the overall model evaluation, not for evaluation of a single
+     * annotation spec.
+     * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder> + getConfusionMatrixFieldBuilder() { + if (confusionMatrixBuilder_ == null) { + confusionMatrixBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder, + com.google.cloud.automl.v1.ClassificationEvaluationMetrics + .ConfusionMatrixOrBuilder>( + getConfusionMatrix(), getParentForChildren(), isClean()); + confusionMatrix_ = null; + } + return confusionMatrixBuilder_; + } + + @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.automl.v1.TextSentimentEvaluationMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSentimentEvaluationMetrics) + private static final com.google.cloud.automl.v1.TextSentimentEvaluationMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + } + + public static com.google.cloud.automl.v1.TextSentimentEvaluationMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSentimentEvaluationMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSentimentEvaluationMetrics(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentEvaluationMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetricsOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetricsOrBuilder.java new file mode 100644 index 000000000..23001a423 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentEvaluationMetricsOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_sentiment.proto + +package com.google.cloud.automl.v1; + +public interface TextSentimentEvaluationMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSentimentEvaluationMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Precision.
+   * 
+ * + * float precision = 1; + */ + float getPrecision(); + + /** + * + * + *
+   * Output only. Recall.
+   * 
+ * + * float recall = 2; + */ + float getRecall(); + + /** + * + * + *
+   * Output only. The harmonic mean of recall and precision.
+   * 
+ * + * float f1_score = 3; + */ + float getF1Score(); + + /** + * + * + *
+   * Output only. Mean absolute error. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float mean_absolute_error = 4; + */ + float getMeanAbsoluteError(); + + /** + * + * + *
+   * Output only. Mean squared error. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float mean_squared_error = 5; + */ + float getMeanSquaredError(); + + /** + * + * + *
+   * Output only. Linear weighted kappa. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float linear_kappa = 6; + */ + float getLinearKappa(); + + /** + * + * + *
+   * Output only. Quadratic weighted kappa. Only set for the overall model
+   * evaluation, not for evaluation of a single annotation spec.
+   * 
+ * + * float quadratic_kappa = 7; + */ + float getQuadraticKappa(); + + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + boolean hasConfusionMatrix(); + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix getConfusionMatrix(); + /** + * + * + *
+   * Output only. Confusion matrix of the evaluation.
+   * Only set for the overall model evaluation, not for evaluation of a single
+   * annotation spec.
+   * 
+ * + * + * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * + */ + com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder + getConfusionMatrixOrBuilder(); +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadata.java new file mode 100644 index 000000000..1ffc87cfd --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadata.java @@ -0,0 +1,451 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Model metadata that is specific to text sentiment.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentModelMetadata} + */ +public final class TextSentimentModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.TextSentimentModelMetadata) + TextSentimentModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextSentimentModelMetadata.newBuilder() to construct. + private TextSentimentModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextSentimentModelMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextSentimentModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentModelMetadata.class, + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.TextSentimentModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.TextSentimentModelMetadata other = + (com.google.cloud.automl.v1.TextSentimentModelMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata 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.automl.v1.TextSentimentModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata 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.automl.v1.TextSentimentModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata 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.automl.v1.TextSentimentModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata 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.automl.v1.TextSentimentModelMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata 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.automl.v1.TextSentimentModelMetadata 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; + } + /** + * + * + *
+   * Model metadata that is specific to text sentiment.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.TextSentimentModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.TextSentimentModelMetadata) + com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.TextSentimentModelMetadata.class, + com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.TextSentimentModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.TextProto + .internal_static_google_cloud_automl_v1_TextSentimentModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentModelMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentModelMetadata build() { + com.google.cloud.automl.v1.TextSentimentModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentModelMetadata buildPartial() { + com.google.cloud.automl.v1.TextSentimentModelMetadata result = + new com.google.cloud.automl.v1.TextSentimentModelMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.TextSentimentModelMetadata) { + return mergeFrom((com.google.cloud.automl.v1.TextSentimentModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.TextSentimentModelMetadata other) { + if (other == com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.TextSentimentModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.TextSentimentModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.TextSentimentModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.TextSentimentModelMetadata) + private static final com.google.cloud.automl.v1.TextSentimentModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.TextSentimentModelMetadata(); + } + + public static com.google.cloud.automl.v1.TextSentimentModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSentimentModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSentimentModelMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.TextSentimentModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadataOrBuilder.java new file mode 100644 index 000000000..5fc98c762 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentModelMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text.proto + +package com.google.cloud.automl.v1; + +public interface TextSentimentModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.TextSentimentModelMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentProto.java new file mode 100644 index 000000000..2d8bbc812 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSentimentProto.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/text_sentiment.proto + +package com.google.cloud.automl.v1; + +public final class TextSentimentProto { + private TextSentimentProto() {} + + 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_automl_v1_TextSentimentAnnotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextSentimentAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1_TextSentimentEvaluationMetrics_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/automl/v1/text_sentiment." + + "proto\022\026google.cloud.automl.v1\032\034google/ap" + + "i/annotations.proto\032+google/cloud/automl" + + "/v1/classification.proto\",\n\027TextSentimen" + + "tAnnotation\022\021\n\tsentiment\030\001 \001(\005\"\240\002\n\036TextS" + + "entimentEvaluationMetrics\022\021\n\tprecision\030\001" + + " \001(\002\022\016\n\006recall\030\002 \001(\002\022\020\n\010f1_score\030\003 \001(\002\022\033" + + "\n\023mean_absolute_error\030\004 \001(\002\022\032\n\022mean_squa" + + "red_error\030\005 \001(\002\022\024\n\014linear_kappa\030\006 \001(\002\022\027\n" + + "\017quadratic_kappa\030\007 \001(\002\022a\n\020confusion_matr" + + "ix\030\010 \001(\0132G.google.cloud.automl.v1.Classi" + + "ficationEvaluationMetrics.ConfusionMatri" + + "xB\276\001\n\032com.google.cloud.automl.v1B\022TextSe" + + "ntimentProtoP\001Z - * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed - * values are "text/html" and "text/plain". If left blank, the format is - * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * Optional. The format of + * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only + * two allowed values are "text/html" and "text/plain". If left blank, the + * format is automatically determined from the type of the uploaded + * [content][google.cloud.automl.v1.TextSnippet.content]. * * * string mime_type = 2; @@ -195,9 +197,11 @@ public java.lang.String getMimeType() { * * *
-   * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+   * two allowed values are "text/html" and "text/plain". If left blank, the
+   * format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1.TextSnippet.content].
    * 
* * string mime_type = 2; @@ -708,9 +712,11 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+     * two allowed values are "text/html" and "text/plain". If left blank, the
+     * format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -730,9 +736,11 @@ public java.lang.String getMimeType() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+     * two allowed values are "text/html" and "text/plain". If left blank, the
+     * format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -752,9 +760,11 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+     * two allowed values are "text/html" and "text/plain". If left blank, the
+     * format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -772,9 +782,11 @@ public Builder setMimeType(java.lang.String value) { * * *
-     * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+     * two allowed values are "text/html" and "text/plain". If left blank, the
+     * format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -789,9 +801,11 @@ public Builder clearMimeType() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+     * two allowed values are "text/html" and "text/plain". If left blank, the
+     * format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1.TextSnippet.content].
      * 
* * string mime_type = 2; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.java index e6d7e55d6..eed83caad 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TextSnippetOrBuilder.java @@ -50,9 +50,11 @@ public interface TextSnippetOrBuilder * * *
-   * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+   * two allowed values are "text/html" and "text/plain". If left blank, the
+   * format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1.TextSnippet.content].
    * 
* * string mime_type = 2; @@ -62,9 +64,11 @@ public interface TextSnippetOrBuilder * * *
-   * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
+   * two allowed values are "text/html" and "text/plain". If left blank, the
+   * format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1.TextSnippet.content].
    * 
* * string mime_type = 2; diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java index 101f6e909..e0375165b 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadata.java @@ -123,7 +123,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getSourceLanguageCode() { java.lang.Object ref = sourceLanguageCode_; @@ -143,7 +143,7 @@ public java.lang.String getSourceLanguageCode() { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { java.lang.Object ref = sourceLanguageCode_; @@ -166,7 +166,7 @@ public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getTargetLanguageCode() { java.lang.Object ref = targetLanguageCode_; @@ -186,7 +186,7 @@ public java.lang.String getTargetLanguageCode() { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { java.lang.Object ref = targetLanguageCode_; @@ -543,7 +543,7 @@ public Builder mergeFrom( * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getSourceLanguageCode() { java.lang.Object ref = sourceLanguageCode_; @@ -563,7 +563,7 @@ public java.lang.String getSourceLanguageCode() { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { java.lang.Object ref = sourceLanguageCode_; @@ -583,7 +583,7 @@ public com.google.protobuf.ByteString getSourceLanguageCodeBytes() { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setSourceLanguageCode(java.lang.String value) { if (value == null) { @@ -601,7 +601,7 @@ public Builder setSourceLanguageCode(java.lang.String value) { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearSourceLanguageCode() { @@ -616,7 +616,7 @@ public Builder clearSourceLanguageCode() { * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -637,7 +637,7 @@ public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public java.lang.String getTargetLanguageCode() { java.lang.Object ref = targetLanguageCode_; @@ -657,7 +657,7 @@ public java.lang.String getTargetLanguageCode() { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { java.lang.Object ref = targetLanguageCode_; @@ -677,7 +677,7 @@ public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setTargetLanguageCode(java.lang.String value) { if (value == null) { @@ -695,7 +695,7 @@ public Builder setTargetLanguageCode(java.lang.String value) { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearTargetLanguageCode() { @@ -710,7 +710,7 @@ public Builder clearTargetLanguageCode() { * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.java index ed7ffbf5b..6c9838469 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationDatasetMetadataOrBuilder.java @@ -30,7 +30,7 @@ public interface TranslationDatasetMetadataOrBuilder * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ java.lang.String getSourceLanguageCode(); /** @@ -40,7 +40,7 @@ public interface TranslationDatasetMetadataOrBuilder * Required. The BCP-47 language code of the source language. * * - * string source_language_code = 1; + * string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ com.google.protobuf.ByteString getSourceLanguageCodeBytes(); @@ -51,7 +51,7 @@ public interface TranslationDatasetMetadataOrBuilder * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ java.lang.String getTargetLanguageCode(); /** @@ -61,7 +61,7 @@ public interface TranslationDatasetMetadataOrBuilder * Required. The BCP-47 language code of the target language. * * - * string target_language_code = 2; + * string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ com.google.protobuf.ByteString getTargetLanguageCodeBytes(); } diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java index 11c27d0a2..8abffd5fc 100644 --- a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/TranslationProto.java @@ -53,23 +53,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n(google/cloud/automl/v1/translation.pro" - + "to\022\026google.cloud.automl.v1\032\'google/cloud" - + "/automl/v1/data_items.proto\032\034google/api/" - + "annotations.proto\"X\n\032TranslationDatasetM" - + "etadata\022\034\n\024source_language_code\030\001 \001(\t\022\034\n" - + "\024target_language_code\030\002 \001(\t\"K\n\034Translati" - + "onEvaluationMetrics\022\022\n\nbleu_score\030\001 \001(\001\022" - + "\027\n\017base_bleu_score\030\002 \001(\001\"j\n\030TranslationM" - + "odelMetadata\022\022\n\nbase_model\030\001 \001(\t\022\034\n\024sour" - + "ce_language_code\030\002 \001(\t\022\034\n\024target_languag" - + "e_code\030\003 \001(\t\"X\n\025TranslationAnnotation\022?\n" - + "\022translated_content\030\001 \001(\0132#.google.cloud" - + ".automl.v1.TextSnippetB\274\001\n\032com.google.cl" - + "oud.automl.v1B\020TranslationProtoP\001Z + * Details of UndeployModel operation. + * + * + * Protobuf type {@code google.cloud.automl.v1.UndeployModelOperationMetadata} + */ +public final class UndeployModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.UndeployModelOperationMetadata) + UndeployModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployModelOperationMetadata.newBuilder() to construct. + private UndeployModelOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployModelOperationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployModelOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UndeployModelOperationMetadata.class, + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.UndeployModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.UndeployModelOperationMetadata other = + (com.google.cloud.automl.v1.UndeployModelOperationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata 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.automl.v1.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata 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.automl.v1.UndeployModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata 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.automl.v1.UndeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata 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.automl.v1.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata 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.automl.v1.UndeployModelOperationMetadata 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; + } + /** + * + * + *
+   * Details of UndeployModel operation.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UndeployModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.UndeployModelOperationMetadata) + com.google.cloud.automl.v1.UndeployModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UndeployModelOperationMetadata.class, + com.google.cloud.automl.v1.UndeployModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.UndeployModelOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.Operations + .internal_static_google_cloud_automl_v1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelOperationMetadata build() { + com.google.cloud.automl.v1.UndeployModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelOperationMetadata buildPartial() { + com.google.cloud.automl.v1.UndeployModelOperationMetadata result = + new com.google.cloud.automl.v1.UndeployModelOperationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.UndeployModelOperationMetadata) { + return mergeFrom((com.google.cloud.automl.v1.UndeployModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.UndeployModelOperationMetadata other) { + if (other == com.google.cloud.automl.v1.UndeployModelOperationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.UndeployModelOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1.UndeployModelOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.UndeployModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UndeployModelOperationMetadata) + private static final com.google.cloud.automl.v1.UndeployModelOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.UndeployModelOperationMetadata(); + } + + public static com.google.cloud.automl.v1.UndeployModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployModelOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelOperationMetadataOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000..e02ec51cf --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelOperationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/operations.proto + +package com.google.cloud.automl.v1; + +public interface UndeployModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.UndeployModelOperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequest.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequest.java new file mode 100644 index 000000000..95cdcde43 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequest.java @@ -0,0 +1,614 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +/** + * + * + *
+ * Request message for
+ * [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UndeployModelRequest} + */ +public final class UndeployModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.UndeployModelRequest) + UndeployModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployModelRequest.newBuilder() to construct. + private UndeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployModelRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeployModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UndeployModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UndeployModelRequest.class, + com.google.cloud.automl.v1.UndeployModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1.UndeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.automl.v1.UndeployModelRequest other = + (com.google.cloud.automl.v1.UndeployModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1.UndeployModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest 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.automl.v1.UndeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest 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.automl.v1.UndeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest 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.automl.v1.UndeployModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest 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.automl.v1.UndeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest 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.automl.v1.UndeployModelRequest 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
+   * [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1.UndeployModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.UndeployModelRequest) + com.google.cloud.automl.v1.UndeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UndeployModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1.UndeployModelRequest.class, + com.google.cloud.automl.v1.UndeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.automl.v1.UndeployModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1.AutoMlProto + .internal_static_google_cloud_automl_v1_UndeployModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.automl.v1.UndeployModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelRequest build() { + com.google.cloud.automl.v1.UndeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelRequest buildPartial() { + com.google.cloud.automl.v1.UndeployModelRequest result = + new com.google.cloud.automl.v1.UndeployModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1.UndeployModelRequest) { + return mergeFrom((com.google.cloud.automl.v1.UndeployModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1.UndeployModelRequest other) { + if (other == com.google.cloud.automl.v1.UndeployModelRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1.UndeployModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1.UndeployModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the model to undeploy.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.UndeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UndeployModelRequest) + private static final com.google.cloud.automl.v1.UndeployModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1.UndeployModelRequest(); + } + + public static com.google.cloud.automl.v1.UndeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeployModelRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1.UndeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequestOrBuilder.java b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequestOrBuilder.java new file mode 100644 index 000000000..b97633367 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/java/com/google/cloud/automl/v1/UndeployModelRequestOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/automl/v1/service.proto + +package com.google.cloud.automl.v1; + +public interface UndeployModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.UndeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of the model to undeploy.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto index 9469c2618..346ec8b93 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_payload.proto @@ -17,12 +17,16 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -35,5 +39,30 @@ message AnnotationPayload { oneof detail { // Annotation details for translation. TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; } diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_spec.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_spec.proto new file mode 100644 index 000000000..6cd8c7965 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/annotation_spec.proto @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A definition of an annotation spec. +message AnnotationSpec { + // Output only. Resource name of the annotation spec. + // Form: + // + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. + // The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + // (_), and ASCII digits 0-9. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/classification.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/classification.proto new file mode 100644 index 000000000..75abeacbd --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/classification.proto @@ -0,0 +1,172 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Model evaluation metrics for classification problems. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of + // [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] + // and + // [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the + // [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + // field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto index d5337ac57..60ee9229a 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/data_items.proto @@ -17,39 +17,184 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/geometry.proto"; import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/text_segment.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; -import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; option ruby_package = "Google::Cloud::AutoML::V1"; +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + // A representation of a text snippet. message TextSnippet { // Required. The content of the text snippet as a string. Up to 250000 // characters long. string content = 1; - // Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed - // values are "text/html" and "text/plain". If left blank, the format is - // automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + // Optional. The format of + // [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only + // two allowed values are "text/html" and "text/plain". If left blank, the + // format is automatically determined from the type of the uploaded + // [content][google.cloud.automl.v1.TextSnippet.content]. string mime_type = 2; // Output only. HTTP URI where you can download the content. string content_uri = 4; } +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the + // document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // the original document, starts from 1. + int32 page_number = 2; + + // The position of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // the page. Contains exactly 4 + // + // [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + // Example data used for training or prediction. message ExamplePayload { - // Required. Input only. The example data. + // Required. The example data. oneof payload { + // Example image. + Image image = 1; + // Example text. TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; } } diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto index 73b7d6027..6e0961b38 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/dataset.proto @@ -17,12 +17,15 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -36,6 +39,21 @@ message Dataset { oneof dataset_metadata { // Metadata for a dataset used for translation. TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; } // Output only. The resource name of the dataset. diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/detection.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/detection.proto new file mode 100644 index 000000000..d55593468 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/detection.proto @@ -0,0 +1,88 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/geometry.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent + // example, value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/geometry.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/geometry.proto new file mode 100644 index 000000000..99bf9134b --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/geometry.proto @@ -0,0 +1,48 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/image.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/image.proto new file mode 100644 index 000000000..a6f278735 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/image.proto @@ -0,0 +1,194 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata {} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud`(default), the train budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192, 000 + // which represents one day in wall time. For model type + // `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + // `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + // `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + // and 100,000 milli node hours, inclusive. The default value is 24, 000 which + // represents one day in wall time. + int64 train_budget_milli_node_hours = 16; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 17; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. Expected to have low latency, but may have lower + // prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. Expected to have a higher latency, but should + // also have a higher prediction quality than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. Expected + // to have low latency, but may have lower prediction quality + // than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. Expected + // to have a higher latency, but should also have a higher + // prediction quality than other models. + string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + string model_type = 1; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto index fd835d250..98a694a64 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/io.proto @@ -18,28 +18,451 @@ syntax = "proto3"; package google.cloud.automl.v1; import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; option ruby_package = "Google::Cloud::AutoML::V1"; -// Input configuration for ImportData Action. +// Input configuration for +// [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action. // // The format of input depends on dataset_metadata the Dataset into which // the import is happening has. As input source the -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] // is expected, unless specified otherwise. Additionally any input .CSV file // by itself must be 100MB or smaller, unless specified otherwise. // If an "example" file (that is, image, video etc.) with identical content -// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then +// (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then // its label, bounding boxes etc. are appended. The same file should be always -// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then +// provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then // these values are nondeterministically selected from the given ones. // -// Errors: +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +//

AutoML Vision

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/vision/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, +// .TIFF, .ICO. +// +// * `LABEL` - A label that identifies the object in the image. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no `LABEL`. +// +// Some sample rows: +// +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// +//
Object Detection
+// See [Preparing your training +// data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) +// for more information. +// +// A CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image +// is assumed to be exhaustively labeled. +// +// * `LABEL` - A label that identifies the object in the image specified by the +// `BOUNDING_BOX`. +// +// * `BOUNDING BOX` - The vertices of an object in the example image. +// The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than +// 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` +// per line). If an image has no looked for objects then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// `BOUNDING_BOX`. +// +// **Four sample rows:** +// +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +//
+//
+// +// +//

AutoML Natural Language

+// +// +//
Entity Extraction
+// +// See [Preparing your training +// data](/natural-language/automl/entity-analysis/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,GCS_FILE_PATH +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing.. +// +// * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in +// Google Cloud Storage that contains in-line text in-line as documents +// for model training. +// +// After the training data set has been determined from the `TRAIN` and +// `UNASSIGNED` CSV files, the training data is divided into train and +// validation data sets. 70% for training and 30% for validation. +// +// For example: +// +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// +// **In-line JSONL files** +// +// In-line .JSONL files contain, per line, a JSON document that wraps a +// [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by +// one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] +// fields, which have `display_name` and `text_extraction` fields to describe +// the entity from the text snippet. Multiple JSON documents can be separated +// using line breaks (\n). +// +// The supplied text must be annotated exhaustively. For example, if you +// include the text "horse", but do not label it as "animal", +// then "horse" is assumed to not be an "animal". +// +// Any given text snippet content must have 30,000 characters or +// less, and also be UTF-8 NFC encoded. ASCII is accepted as it is +// UTF-8 NFC encoded. +// +// For example: +// +// { +// "text_snippet": { +// "content": "dog car cat" +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 2} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 6} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 10} +// } +// } +// ] +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 7} +// } +// } +// ] +// } +// +// **JSONL files that reference documents** +// +// .JSONL files contain, per line, a JSON document that wraps a +// `input_config` that contains the path to a source PDF document. +// Multiple JSON documents can be separated using line breaks (\n). +// +// For example: +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// **In-line JSONL files with PDF layout information** +// +// **Note:** You can only annotate PDF files using the UI. The format described +// below applies to annotated PDF files exported using the UI or `exportData`. +// +// In-line .JSONL files for PDF documents contain, per line, a JSON document +// that wraps a `document` field that provides the textual content of the PDF +// document and the layout information. +// +// For example: +// +// { +// "document": { +// "document_text": { +// "content": "dog car cat" +// } +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 11, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 3, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 3} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 7} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 11} +// } +// }, +// ], +// +// +// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 10MB or +// less in size. For zip files, the size of each file inside the zip must be +// 10MB or less in size. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed. +// The `ML_USE` and `LABEL` columns are optional. +// Supported file extensions: .TXT, .PDF, .ZIP +// +// A maximum of 100 unique labels are allowed per CSV row. +// +// Sample rows: +// +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// gs://folder/content.txt,SlowService +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,BadFood +// +// +// +//
Sentiment Analysis
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 128kB or +// less in size. For zip files, the size of each file inside the zip must be +// 128kB or less in size. +// +// The `ML_USE` and `SENTIMENT` columns are optional. +// Supported file extensions: .TXT, .PDF, .ZIP +// +// * `SENTIMENT` - An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one - +// it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// large. +// +// Sample rows: +// +// TRAIN,"@freewrytin this is way too good for your product",2 +// gs://folder/content.txt,3 +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,2 +//
+//
+// +// +// **Input field definitions:** +// +// `ML_USE` +// : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/image1.png". +// +// `LABEL` +// : A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// +// `BOUNDING_BOX` +// : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// +// `VERTEX` +// : (`COORDINATE,COORDINATE`) +// First coordinate is horizontal (x), the second is vertical (y). +// +// `COORDINATE` +// : A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// +// `TEXT_SNIPPET` +// : The content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// +// `DOCUMENT` +// : A field that provides the textual content with document and the layout +// information. +// +// +// **Errors:** +// // If any of the provided CSV files can't be parsed or if more than certain // percent of CSV rows cannot be processed then the operation fails and // nothing is imported. Regardless of overall success or failure the per-row @@ -50,8 +473,9 @@ message InputConfig { // The source of the input. oneof source { // The Google Cloud Storage location for the input content. - // In ImportData, the gcs_source points to a csv with structure described in - // the comment. + // For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + // `gcs_source` points to a CSV file with a structure described in + // [InputConfig][google.cloud.automl.v1.InputConfig]. GcsSource gcs_source = 1; } @@ -61,40 +485,392 @@ message InputConfig { map params = 2; } -// * For Translation: +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +//

AutoML Natural Language

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF +// Text files can be no larger than 10MB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// +//
Sentiment Analysis
+// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF +// Text files can be no larger than 128kB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// +//
Entity Extraction
+// +// One or more JSONL (JSON Lines) files that either provide inline text or +// documents. You can only use one format, either inline text or documents, +// for a single call to [AutoMl.BatchPredict]. +// +// Each JSONL file contains a per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// JSON representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// +// Each document JSONL file contains, per line, a proto that wraps a +// Document proto with `input_config` set. Only PDF documents are +// currently supported, and each PDF document cannot exceed 2MB in size. +// +// Each JSONL file must not exceed 100MB in size, and no more than 20 +// JSONL files may be passed. +// +// Sample inline JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "Extended sample content", +// "mime_type": "text/plain" +// } +// } +// +// Sample document JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +//
+//
+// +// **Input field definitions:** +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/video.avi". +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // The source of the input. + oneof source { + // Required. The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // + // Max supported size: 512MB. + // + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// Output configuration for ExportData. +// +// As destination the +// [gcs_destination][google.cloud.automl.v1.OutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be "export_data--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. +// Only ground truth annotations are exported (not approved annotations are +// not exported). +// +// The outputs correspond to how the data was imported, and may be used as +// input to import data. The output formats are represented as EBNF with literal +// commas and same non-terminal symbols definitions are these in import data's +// [InputConfig][google.cloud.automl.v1.InputConfig]: +// +// * For Image Classification: +// CSV file(s) `image_classification_1.csv`, +// `image_classification_2.csv`,...,`image_classification_N.csv`with +// each line in format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// where GCS_FILE_PATHs point at the original, source locations of the +// imported images. +// For MULTICLASS classification type, there can be at most one LABEL +// per example. +// +// * For Image Object Detection: +// CSV file(s) `image_object_detection_1.csv`, +// `image_object_detection_2.csv`,...,`image_object_detection_N.csv` +// with each line in format: +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// where GCS_FILE_PATHs point at the original, source locations of the +// imported images. +// +// * For Text Classification: +// In the created directory CSV file(s) `text_classification_1.csv`, +// `text_classification_2.csv`, ...,`text_classification_N.csv` will be +// created where N depends on the total number of examples exported. +// Each line in the CSV is of the format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// where GCS_FILE_PATHs point at the exported .txt files containing +// the text content of the imported example. For MULTICLASS +// classification type, there will be at most one LABEL per example. +// +// * For Text Sentiment: +// In the created directory CSV file(s) `text_sentiment_1.csv`, +// `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be +// created where N depends on the total number of examples exported. +// Each line in the CSV is of the format: +// ML_USE,GCS_FILE_PATH,SENTIMENT +// where GCS_FILE_PATHs point at the exported .txt files containing +// the text content of the imported example. +// +// * For Text Extraction: +// CSV file `text_extraction.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which +// contains, per line, a proto that wraps a TextSnippet proto (in json +// representation) followed by AnnotationPayload protos (called +// annotations). If initially documents had been imported, the JSONL +// will point at the original, source locations of the imported +// documents. +// +// * For Translation: // CSV file `translation.csv`, with each line in format: // ML_USE,GCS_FILE_PATH // GCS_FILE_PATH leads to a .TSV file which describes examples that have // given ML_USE, using the following row format per line: // TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target // language) -// -// `export_data__` -// where will be made -// BigQuery-dataset-name compatible (e.g. most special characters will -// become underscores), and timestamp will be in -// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that -// dataset a new table called `primary_table` will be created, and -// filled with precisely the same data as this obtained on import. message OutputConfig { - // Required. The destination of the output. + // The destination of the output. oneof destination { - // The Google Cloud Storage location where the output is to be written to. - // For Image Object Detection, Text Extraction, Video Classification and - // Tables, in the given directory a new directory will be created with name: + // Required. The Google Cloud Storage location where the output is to be + // written to. For Image Object Detection, Text Extraction in the given + // directory a new directory will be created with name: // export_data-- where // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export // output will be written into that directory. - GcsDestination gcs_destination = 1; + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; } } +// Output configuration for BatchPredict Action. +// +// As destination the +// +// [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text (or pdf) file in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text (or pdf) file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text (or pdf) file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text (or pdf) file followed by exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text (or pdf) file in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text (or pdf) file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text (or pdf) file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text (or pdf) file followed by exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +message BatchPredictOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location of the directory where the + // output is to be written to. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the model is to be + // written to. This location may only be set for the following model + // formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript.x` + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + map params = 2; +} + // The Google Cloud Storage location for the input content. message GcsSource { - // Required. Google Cloud Storage URIs to input files, up to 2000 characters - // long. Accepted forms: + // Required. Google Cloud Storage URIs to input files, up to 2000 + // characters long. Accepted forms: // * Full object path, e.g. gs://bucket/directory/object.csv - repeated string input_uris = 1; + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; } // The Google Cloud Storage location where the output is to be written to. @@ -105,5 +881,5 @@ message GcsDestination { // * Prefix path: gs://bucket/directory // The requesting user must have write permission to the bucket. // The directory is created if it doesn't exist. - string output_uri_prefix = 1; + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto index 5f820b420..51ca90425 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model.proto @@ -17,12 +17,15 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -30,6 +33,11 @@ option ruby_package = "Google::Cloud::AutoML::V1"; // API proto representing a trained machine learning model. message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project_id}/locations/{location_id}/models/{model_id}" + }; + // Deployment state of the model. enum DeploymentState { // Should not be used, an un-set enum has this value by default. @@ -48,6 +56,21 @@ message Model { oneof model_metadata { // Metadata for translation models. TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; } // Output only. Resource name of the model. @@ -74,6 +97,10 @@ message Model { // prediction requests after it gets deployed. DeploymentState deployment_state = 8; + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 10; + // Optional. The labels with user-defined metadata to organize your model. // // Label keys and values can be no longer than 64 characters diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto index fe9df1b94..149fa4e87 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/model_evaluation.proto @@ -17,12 +17,17 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -32,8 +37,21 @@ option ruby_package = "Google::Cloud::AutoML::V1"; message ModelEvaluation { // Output only. Problem type specific evaluation metrics. oneof metrics { + // Model evaluation metrics for image, text classification. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + // Model evaluation metrics for translation. TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics + image_object_detection_evaluation_metrics = 12; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; } // Output only. Resource name of the model evaluation. @@ -42,10 +60,18 @@ message ModelEvaluation { // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` string name = 1; - // Output only. The ID of the annotation spec that the model evaluation applies to. The - // The ID is empty for the overall model evaluation. + // Output only. The ID of the annotation spec that the model evaluation + // applies to. The The ID is empty for the overall model evaluation. string annotation_spec_id = 2; + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // at the moment when the model was trained. Because this field returns a + // value at model training time, for different models trained from the same + // dataset, the values may differ, since display names could had been changed + // between the two model's trainings. + string display_name = 15; + // Output only. Timestamp when this model evaluation was created. google.protobuf.Timestamp create_time = 5; @@ -57,6 +83,6 @@ message ModelEvaluation { // Otherwise, this is the count of examples that according to the ground // truth were annotated by the // - // [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + // [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. int32 evaluated_example_count = 6; } diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto index 575fd8a4c..7c09d6ecd 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/operations.proto @@ -17,16 +17,19 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/cloud/automl/v1/dataset.proto"; import "google/cloud/automl/v1/io.proto"; import "google/cloud/automl/v1/model.proto"; import "google/cloud/automl/v1/model_evaluation.proto"; +import "google/cloud/automl/v1/prediction_service.proto"; +import "google/cloud/automl/v1/service.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -40,8 +43,29 @@ message OperationMetadata { // Details of a Delete operation. DeleteOperationMetadata delete_details = 8; + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + // Details of CreateModel operation. CreateModelOperationMetadata create_model_details = 10; + + // Details of CreateDataset operation. + CreateDatasetOperationMetadata create_dataset_details = 30; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; } // Output only. Progress of operation. Range: [0, 100]. @@ -66,7 +90,84 @@ message DeleteOperationMetadata { } +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateDataset operation. +message CreateDatasetOperationMetadata { + +} + // Details of CreateModel operation. message CreateModelOperationMetadata { } + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // + // [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto index a5f02873d..0628dbaac 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/prediction_service.proto @@ -19,14 +19,14 @@ package google.cloud.automl.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/resource.proto"; import "google/cloud/automl/v1/annotation_payload.proto"; import "google/cloud/automl/v1/data_items.proto"; import "google/cloud/automl/v1/io.proto"; -import "google/cloud/automl/v1/operations.proto"; import "google/longrunning/operations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "PredictionServiceProto"; option java_package = "com.google.cloud.automl.v1"; @@ -45,14 +45,43 @@ service PredictionService { // Perform an online prediction. The prediction result will be directly // returned in the response. // Available for following ML problems, and their expected request payloads: + // * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Text Classification - TextSnippet, content up to 60,000 characters, + // UTF-8 encoded. + // * Text Extraction - TextSnippet, content up to 30,000 characters, + // UTF-8 NFC encoded. // * Translation - TextSnippet, content up to 25,000 characters, UTF-8 // encoded. + // * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + // encoded. rpc Predict(PredictRequest) returns (PredictResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/models/*}:predict" body: "*" }; } + + // Perform a batch prediction. Unlike the online + // [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, + // [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned + // in the [response][google.longrunning.Operation.response] field. Available + // for following ML problems: + // * Image Classification + // * Image Object Detection + // * Text Extraction + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + } } // Request message for @@ -67,6 +96,20 @@ message PredictRequest { // Additional domain-specific parameters, any string must be up to 25000 // characters long. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned in the response. Default is 100, the + // requested value may be limited by server. map params = 3; } @@ -77,6 +120,87 @@ message PredictResponse { // Translation and Text Sentiment will return precisely one payload. repeated AnnotationPayload payload = 1; + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // * For Text Extraction: + // If the input is a .pdf file, the OCR'ed text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + // + // * For Text Classification: + // If the input is a .pdf file, the OCR'ed trucated text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + // + // * For Text Sentiment: + // If the input is a .pdf file, the OCR'ed trucated text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + ExamplePayload preprocessed_input = 3; + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Text Sentiment: + // `sentiment_score` - (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 will be also positive (though + // the least). + // The sentiment_score shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. map metadata = 2; } + +// Request message for +// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Name of the model requested to serve the batch prediction. + string name = 1; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4; + + // Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // * For Text Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be produced per image. Default is 100, the + // requested value may be limited by server. + map params = 5; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the +// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + map metadata = 1; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto index c994d95bf..5cd9065bd 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/service.proto @@ -19,17 +19,19 @@ package google.cloud.automl.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/resource.proto"; import "google/cloud/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; import "google/cloud/automl/v1/dataset.proto"; +import "google/cloud/automl/v1/image.proto"; import "google/cloud/automl/v1/io.proto"; import "google/cloud/automl/v1/model.proto"; import "google/cloud/automl/v1/model_evaluation.proto"; -import "google/cloud/automl/v1/operations.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "AutoMlProto"; option java_package = "com.google.cloud.automl.v1"; @@ -116,6 +118,14 @@ service AutoMl { }; } + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) + returns (google.cloud.automl.v1.AnnotationSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + } + // Creates a model. // Returns a Model in the [response][google.longrunning.Operation.response] // field when it completes. @@ -161,6 +171,54 @@ service AutoMl { }; } + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // + // [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection; all other + // domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + } + // Gets a model evaluation. rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { option (google.api.http) = { @@ -203,8 +261,8 @@ message ListDatasetsRequest { // An expression for filtering the results of the request. // // * `dataset_metadata` - for existence of the case (e.g. - // image_classification_dataset_metadata:*). - // Some examples of using the filter are: + // image_classification_dataset_metadata:*). Some examples of + // using the filter are: // // * `translation_dataset_metadata:*` --> The dataset has // translation_dataset_metadata. @@ -274,6 +332,13 @@ message ExportDataRequest { OutputConfig output_config = 3; } +// Request message for +// [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // The resource name of the annotation spec to retrieve. + string name = 1; +} + // Request message for // [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. message CreateModelRequest { @@ -300,7 +365,7 @@ message ListModelsRequest { // An expression for filtering the results of the request. // // * `model_metadata` - for existence of the case (e.g. - // video_classification_model_metadata:*). + // image_classification_model_metadata:*). // * `dataset_id` - for = or !=. Some examples of using the filter are: // // * `image_classification_model_metadata:*` --> The model has @@ -349,6 +414,42 @@ message UpdateModelRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for +// [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata + image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata + image_classification_model_deployment_metadata = 4; + } + + // Resource name of the model to deploy. + string name = 1; +} + +// Request message for +// [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Resource name of the model to undeploy. + string name = 1; +} + +// Request message for +// [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models need +// to be enabled for exporting, otherwise an error code will be returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3; +} + // Request message for // [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. message GetModelEvaluationRequest { diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text.proto new file mode 100644 index 000000000..7c47d9b35 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text.proto @@ -0,0 +1,60 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata {} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata {} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher + // value means a more positive sentiment. The range of sentiments that will be + // used is between 0 and sentiment_max (inclusive on both ends), and all the + // values in the range must be represented in the dataset before a model can + // be created. sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata {} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_extraction.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_extraction.proto new file mode 100644 index 000000000..f7e10ca89 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_extraction.proto @@ -0,0 +1,70 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/cloud/automl/v1/text_segment.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_segment.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_segment.proto new file mode 100644 index 000000000..cb75fc040 --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_segment.proto @@ -0,0 +1,43 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_sentiment.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_sentiment.proto new file mode 100644 index 000000000..f87f300bf --- /dev/null +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/text_sentiment.proto @@ -0,0 +1,79 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when + // populating the dataset from which the model used for the prediction had + // been trained. The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; +} diff --git a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.proto b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.proto index bc449fe79..bb67e3d46 100644 --- a/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.proto +++ b/proto-google-cloud-automl-v1/src/main/proto/google/cloud/automl/v1/translation.proto @@ -17,11 +17,12 @@ syntax = "proto3"; package google.cloud.automl.v1; -import "google/cloud/automl/v1/data_items.proto"; import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/data_items.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "TranslationProto"; option java_package = "com.google.cloud.automl.v1"; @@ -31,10 +32,10 @@ option ruby_package = "Google::Cloud::AutoML::V1"; // Dataset metadata that is specific to translation. message TranslationDatasetMetadata { // Required. The BCP-47 language code of the source language. - string source_language_code = 1; + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The BCP-47 language code of the target language. - string target_language_code = 2; + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; } // Evaluation metrics for the dataset. diff --git a/proto-google-cloud-automl-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-automl-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000..b752d65fc --- /dev/null +++ b/proto-google-cloud-automl-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,14 @@ + + + + + 7012 + com/google/cloud/automl/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/automl/v1beta1/*OrBuilder + boolean contains*(*) + + diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java index 24f5e5541..c318814a5 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ClassificationProto.java @@ -2764,7 +2764,10 @@ public interface ConfidenceMetricsEntryOrBuilder * * *
-       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * Output only. The harmonic mean of
+       * [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+       * and
+       * [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
        * 
* * float f1_score_at1 = 7; @@ -3123,7 +3126,10 @@ public float getFalsePositiveRateAt1() { * * *
-       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+       * Output only. The harmonic mean of
+       * [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+       * and
+       * [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
        * 
* * float f1_score_at1 = 7; @@ -4213,7 +4219,10 @@ public Builder clearFalsePositiveRateAt1() { * * *
-         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * Output only. The harmonic mean of
+         * [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+         * and
+         * [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
          * 
* * float f1_score_at1 = 7; @@ -4225,7 +4234,10 @@ public float getF1ScoreAt1() { * * *
-         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * Output only. The harmonic mean of
+         * [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+         * and
+         * [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
          * 
* * float f1_score_at1 = 7; @@ -4240,7 +4252,10 @@ public Builder setF1ScoreAt1(float value) { * * *
-         * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
+         * Output only. The harmonic mean of
+         * [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
+         * and
+         * [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
          * 
* * float f1_score_at1 = 7; @@ -4625,9 +4640,9 @@ public interface ConfusionMatrixOrBuilder *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -4644,9 +4659,9 @@ public interface ConfusionMatrixOrBuilder *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -4662,9 +4677,9 @@ public interface ConfusionMatrixOrBuilder *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -4678,9 +4693,9 @@ public interface ConfusionMatrixOrBuilder *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -4698,9 +4713,9 @@ public interface ConfusionMatrixOrBuilder *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -4855,7 +4870,9 @@ public interface RowOrBuilder * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -4868,7 +4885,9 @@ public interface RowOrBuilder * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -4881,7 +4900,9 @@ public interface RowOrBuilder * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5009,7 +5030,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5024,7 +5047,9 @@ public java.util.List getExampleCountList() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5039,7 +5064,9 @@ public int getExampleCountCount() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5483,7 +5510,9 @@ private void ensureExampleCountIsMutable() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5500,7 +5529,9 @@ public java.util.List getExampleCountList() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5515,7 +5546,9 @@ public int getExampleCountCount() { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5530,7 +5563,9 @@ public int getExampleCount(int index) { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5548,7 +5583,9 @@ public Builder setExampleCount(int index, int value) { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5566,7 +5603,9 @@ public Builder addExampleCount(int value) { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5585,7 +5624,9 @@ public Builder addAllExampleCount( * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * populated, length of the + * [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + * field. * * * repeated int32 example_count = 1; @@ -5802,9 +5843,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes(int index) { *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -5823,9 +5864,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes(int index) { *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -5845,9 +5886,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes(int index) { *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -5863,9 +5904,9 @@ public int getRowCount() { *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -5883,9 +5924,9 @@ public int getRowCount() { *
        * Output only. Rows in the confusion matrix. The number of rows is equal to
        * the size of `annotation_spec_id`.
-       * `row[i].value[j]` is the number of examples that have ground truth of the
-       * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-       * the model being evaluated.
+       * `row[i].example_count[j]` is the number of examples that have ground
+       * truth of the `annotation_spec_id[i]` and are predicted as
+       * `annotation_spec_id[j]` by the model being evaluated.
        * 
* * @@ -6778,9 +6819,9 @@ private void ensureRowIsMutable() { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6803,9 +6844,9 @@ private void ensureRowIsMutable() { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6825,9 +6866,9 @@ public int getRowCount() { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6849,9 +6890,9 @@ public int getRowCount() { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6881,9 +6922,9 @@ public Builder setRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6910,9 +6951,9 @@ public Builder setRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6941,9 +6982,9 @@ public Builder addRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -6973,9 +7014,9 @@ public Builder addRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7001,9 +7042,9 @@ public Builder addRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7030,9 +7071,9 @@ public Builder addRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7060,9 +7101,9 @@ public Builder addAllRow( *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7085,9 +7126,9 @@ public Builder clearRow() { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7110,9 +7151,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7130,9 +7171,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7154,9 +7195,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7180,9 +7221,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7203,9 +7244,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -7227,9 +7268,9 @@ public Builder removeRow(int index) { *
          * Output only. Rows in the confusion matrix. The number of rows is equal to
          * the size of `annotation_spec_id`.
-         * `row[i].value[j]` is the number of examples that have ground truth of the
-         * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by
-         * the model being evaluated.
+         * `row[i].example_count[j]` is the number of examples that have ground
+         * truth of the `annotation_spec_id[i]` and are predicted as
+         * `annotation_spec_id[j]` by the model being evaluated.
          * 
* * @@ -9401,8 +9442,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n0google/cloud/automl/v1beta1/classifica" + "tion.proto\022\033google.cloud.automl.v1beta1\032" - + "*google/cloud/automl/v1beta1/temporal.pr" - + "oto\032\034google/api/annotations.proto\")\n\030Cla" + + "\034google/api/annotations.proto\032*google/cl" + + "oud/automl/v1beta1/temporal.proto\")\n\030Cla" + "ssificationAnnotation\022\r\n\005score\030\001 \001(\002\"\307\001\n" + "\035VideoClassificationAnnotation\022\014\n\004type\030\001" + " \001(\t\022X\n\031classification_annotation\030\002 \001(\0132" @@ -9452,8 +9493,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.cloud.automl.v1beta1.Temporal.getDescriptor(), com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.Temporal.getDescriptor(), }, assigner); internal_static_google_cloud_automl_v1beta1_ClassificationAnnotation_descriptor = @@ -9529,8 +9570,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "ExampleCount", }); - com.google.cloud.automl.v1beta1.Temporal.getDescriptor(); com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.Temporal.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadata.java index 94fab20b6..52efaa990 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadata.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadata.java @@ -114,7 +114,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's - * [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + * [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. * Must be between 1 and 100, inclusive on both ends. * * @@ -469,7 +469,7 @@ public Builder mergeFrom( * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's - * [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + * [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. * Must be between 1 and 100, inclusive on both ends. * * @@ -485,7 +485,7 @@ public long getNodeCount() { * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's - * [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + * [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. * Must be between 1 and 100, inclusive on both ends. * * @@ -504,7 +504,7 @@ public Builder setNodeCount(long value) { * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's - * [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + * [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. * Must be between 1 and 100, inclusive on both ends. * * diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadataOrBuilder.java index 6736006b3..5ebc40369 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelDeploymentMetadataOrBuilder.java @@ -30,7 +30,7 @@ public interface ImageClassificationModelDeploymentMetadataOrBuilder * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's - * [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + * [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. * Must be between 1 and 100, inclusive on both ends. * * diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java index 112d38f6c..a0032cfd6 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadata.java @@ -99,6 +99,16 @@ private ImageClassificationModelMetadata( modelType_ = s; break; } + case 105: + { + nodeQps_ = input.readDouble(); + break; + } + case 112: + { + nodeCount_ = input.readInt64(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -377,6 +387,39 @@ public com.google.protobuf.ByteString getModelTypeBytes() { } } + public static final int NODE_QPS_FIELD_NUMBER = 13; + private double nodeQps_; + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 13; + */ + public double getNodeQps() { + return nodeQps_; + } + + public static final int NODE_COUNT_FIELD_NUMBER = 14; + private long nodeCount_; + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the node_qps field.
+   * 
+ * + * int64 node_count = 14; + */ + public long getNodeCount() { + return nodeCount_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -406,6 +449,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getModelTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, modelType_); } + if (nodeQps_ != 0D) { + output.writeDouble(13, nodeQps_); + } + if (nodeCount_ != 0L) { + output.writeInt64(14, nodeCount_); + } unknownFields.writeTo(output); } @@ -430,6 +479,12 @@ public int getSerializedSize() { if (!getModelTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, modelType_); } + if (nodeQps_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(13, nodeQps_); + } + if (nodeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(14, nodeCount_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -451,6 +506,9 @@ public boolean equals(final java.lang.Object obj) { if (getTrainCost() != other.getTrainCost()) return false; if (!getStopReason().equals(other.getStopReason())) return false; if (!getModelType().equals(other.getModelType())) return false; + if (java.lang.Double.doubleToLongBits(getNodeQps()) + != java.lang.Double.doubleToLongBits(other.getNodeQps())) return false; + if (getNodeCount() != other.getNodeCount()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -472,6 +530,13 @@ public int hashCode() { hash = (53 * hash) + getStopReason().hashCode(); hash = (37 * hash) + MODEL_TYPE_FIELD_NUMBER; hash = (53 * hash) + getModelType().hashCode(); + hash = (37 * hash) + NODE_QPS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getNodeQps())); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNodeCount()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -628,6 +693,10 @@ public Builder clear() { modelType_ = ""; + nodeQps_ = 0D; + + nodeCount_ = 0L; + return this; } @@ -661,6 +730,8 @@ public com.google.cloud.automl.v1beta1.ImageClassificationModelMetadata buildPar result.trainCost_ = trainCost_; result.stopReason_ = stopReason_; result.modelType_ = modelType_; + result.nodeQps_ = nodeQps_; + result.nodeCount_ = nodeCount_; onBuilt(); return result; } @@ -731,6 +802,12 @@ public Builder mergeFrom( modelType_ = other.modelType_; onChanged(); } + if (other.getNodeQps() != 0D) { + setNodeQps(other.getNodeQps()); + } + if (other.getNodeCount() != 0L) { + setNodeCount(other.getNodeCount()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1346,6 +1423,103 @@ public Builder setModelTypeBytes(com.google.protobuf.ByteString value) { return this; } + private double nodeQps_; + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public double getNodeQps() { + return nodeQps_; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public Builder setNodeQps(double value) { + + nodeQps_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An approximate number of online prediction QPS that can
+     * be supported by this model per each node on which it is deployed.
+     * 
+ * + * double node_qps = 13; + */ + public Builder clearNodeQps() { + + nodeQps_ = 0D; + onChanged(); + return this; + } + + private long nodeCount_; + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public long getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public Builder setNodeCount(long value) { + + nodeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of nodes this model is deployed on. A node is an
+     * abstraction of a machine resource, which can handle online prediction QPS
+     * as given in the node_qps field.
+     * 
+ * + * int64 node_count = 14; + */ + public Builder clearNodeCount() { + + nodeCount_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java index 920658b4c..f40fd6326 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageClassificationModelMetadataOrBuilder.java @@ -192,4 +192,29 @@ public interface ImageClassificationModelMetadataOrBuilder * string model_type = 7; */ com.google.protobuf.ByteString getModelTypeBytes(); + + /** + * + * + *
+   * Output only. An approximate number of online prediction QPS that can
+   * be supported by this model per each node on which it is deployed.
+   * 
+ * + * double node_qps = 13; + */ + double getNodeQps(); + + /** + * + * + *
+   * Output only. The number of nodes this model is deployed on. A node is an
+   * abstraction of a machine resource, which can handle online prediction QPS
+   * as given in the node_qps field.
+   * 
+ * + * int64 node_count = 14; + */ + long getNodeCount(); } diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadata.java index f00b7ea4f..cd59956d9 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadata.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadata.java @@ -283,7 +283,7 @@ public com.google.protobuf.ByteString getStopReasonBytes() { * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -1058,7 +1058,7 @@ public Builder setStopReasonBytes(com.google.protobuf.ByteString value) { * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -1084,7 +1084,7 @@ public long getTrainBudgetMilliNodeHours() { * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -1113,7 +1113,7 @@ public Builder setTrainBudgetMilliNodeHours(long value) { * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadataOrBuilder.java index 75b1b9d54..d390ed89a 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageObjectDetectionModelMetadataOrBuilder.java @@ -117,7 +117,7 @@ public interface ImageObjectDetectionModelMetadataOrBuilder * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java index ddca2bd72..160f21874 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ImageProto.java @@ -69,24 +69,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ageClassificationDatasetMetadata\022L\n\023clas" + "sification_type\030\001 \001(\0162/.google.cloud.aut" + "oml.v1beta1.ClassificationType\"%\n#ImageO" - + "bjectDetectionDatasetMetadata\"\214\001\n ImageC" + + "bjectDetectionDatasetMetadata\"\262\001\n ImageC" + "lassificationModelMetadata\022\025\n\rbase_model" + "_id\030\001 \001(\t\022\024\n\014train_budget\030\002 \001(\003\022\022\n\ntrain" + "_cost\030\003 \001(\003\022\023\n\013stop_reason\030\005 \001(\t\022\022\n\nmode" - + "l_type\030\007 \001(\t\"\276\001\n!ImageObjectDetectionMod" - + "elMetadata\022\022\n\nmodel_type\030\001 \001(\t\022\022\n\nnode_c" - + "ount\030\003 \001(\003\022\020\n\010node_qps\030\004 \001(\001\022\023\n\013stop_rea" - + "son\030\005 \001(\t\022%\n\035train_budget_milli_node_hou" - + "rs\030\006 \001(\003\022#\n\033train_cost_milli_node_hours\030" - + "\007 \001(\003\"@\n*ImageClassificationModelDeploym" - + "entMetadata\022\022\n\nnode_count\030\001 \001(\003\"A\n+Image" - + "ObjectDetectionModelDeploymentMetadata\022\022" - + "\n\nnode_count\030\001 \001(\003B\261\001\n\037com.google.cloud." - + "automl.v1beta1B\nImageProtoP\001ZAgoogle.gol" - + "ang.org/genproto/googleapis/cloud/automl" - + "/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1" - + "beta1\352\002\036Google::Cloud::AutoML::V1beta1b\006" - + "proto3" + + "l_type\030\007 \001(\t\022\020\n\010node_qps\030\r \001(\001\022\022\n\nnode_c" + + "ount\030\016 \001(\003\"\276\001\n!ImageObjectDetectionModel" + + "Metadata\022\022\n\nmodel_type\030\001 \001(\t\022\022\n\nnode_cou" + + "nt\030\003 \001(\003\022\020\n\010node_qps\030\004 \001(\001\022\023\n\013stop_reaso" + + "n\030\005 \001(\t\022%\n\035train_budget_milli_node_hours" + + "\030\006 \001(\003\022#\n\033train_cost_milli_node_hours\030\007 " + + "\001(\003\"@\n*ImageClassificationModelDeploymen" + + "tMetadata\022\022\n\nnode_count\030\001 \001(\003\"A\n+ImageOb" + + "jectDetectionModelDeploymentMetadata\022\022\n\n" + + "node_count\030\001 \001(\003B\261\001\n\037com.google.cloud.au" + + "toml.v1beta1B\nImageProtoP\001ZAgoogle.golan" + + "g.org/genproto/googleapis/cloud/automl/v" + + "1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1be" + + "ta1\352\002\036Google::Cloud::AutoML::V1beta1b\006pr" + + "oto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -125,7 +126,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_ImageClassificationModelMetadata_descriptor, new java.lang.String[] { - "BaseModelId", "TrainBudget", "TrainCost", "StopReason", "ModelType", + "BaseModelId", + "TrainBudget", + "TrainCost", + "StopReason", + "ModelType", + "NodeQps", + "NodeCount", }); internal_static_google_cloud_automl_v1beta1_ImageObjectDetectionModelMetadata_descriptor = getDescriptor().getMessageTypes().get(3); diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfig.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfig.java index fe371535d..1d0fb2f38 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfig.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfig.java @@ -212,7 +212,7 @@ public DestinationCase getDestinationCase() { *
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -231,7 +231,7 @@ public boolean hasGcsDestination() {
    * 
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -253,7 +253,7 @@ public com.google.cloud.automl.v1beta1.GcsDestination getGcsDestination() {
    * 
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -335,7 +335,8 @@ public com.google.cloud.automl.v1beta1.GcrDestinationOrBuilder getGcrDestination
    * exportable):
    * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
    *        mobile-high-accuracy-1:
-   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+   *      "docker".
    * *  For Image Classification mobile-core-ml-low-latency-1,
    *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
    *      "core_ml" (default).
@@ -344,6 +345,8 @@ public com.google.cloud.automl.v1beta1.GcrDestinationOrBuilder getGcrDestination
    * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
    *                    devices.
    * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.
    * * docker - Used for Docker containers. Use the params field to customize
    *            the container. The container is verified to work correctly on
    *            ubuntu 16.04 operating system. See more at
@@ -376,7 +379,8 @@ public java.lang.String getModelFormat() {
    * exportable):
    * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
    *        mobile-high-accuracy-1:
-   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+   *      "docker".
    * *  For Image Classification mobile-core-ml-low-latency-1,
    *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
    *      "core_ml" (default).
@@ -385,6 +389,8 @@ public java.lang.String getModelFormat() {
    * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
    *                    devices.
    * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.
    * * docker - Used for Docker containers. Use the params field to customize
    *            the container. The container is verified to work correctly on
    *            ubuntu 16.04 operating system. See more at
@@ -983,7 +989,7 @@ public Builder clearDestination() {
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1002,7 +1008,7 @@ public boolean hasGcsDestination() {
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1031,7 +1037,7 @@ public com.google.cloud.automl.v1beta1.GcsDestination getGcsDestination() {
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1060,7 +1066,7 @@ public Builder setGcsDestination(com.google.cloud.automl.v1beta1.GcsDestination
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1087,7 +1093,7 @@ public Builder setGcsDestination(
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1126,7 +1132,7 @@ public Builder mergeGcsDestination(com.google.cloud.automl.v1beta1.GcsDestinatio
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1158,7 +1164,7 @@ public Builder clearGcsDestination() {
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1177,7 +1183,7 @@ public com.google.cloud.automl.v1beta1.GcsDestination.Builder getGcsDestinationB
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1203,7 +1209,7 @@ public com.google.cloud.automl.v1beta1.GcsDestinationOrBuilder getGcsDestination
      * 
      * The Google Cloud Storage location where the model is to be written to.
      * This location may only be set for the following model formats:
-     *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+     *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
      *  Under the directory given as the destination a new one with name
      *  "model-export-<model-display-name>-<timestamp-of-export-call>",
      *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -1479,7 +1485,8 @@ public com.google.cloud.automl.v1beta1.GcrDestinationOrBuilder getGcrDestination
      * exportable):
      * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
      *        mobile-high-accuracy-1:
-     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+     *      "docker".
      * *  For Image Classification mobile-core-ml-low-latency-1,
      *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
      *      "core_ml" (default).
@@ -1488,6 +1495,8 @@ public com.google.cloud.automl.v1beta1.GcrDestinationOrBuilder getGcrDestination
      * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
      *                    devices.
      * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.
      * * docker - Used for Docker containers. Use the params field to customize
      *            the container. The container is verified to work correctly on
      *            ubuntu 16.04 operating system. See more at
@@ -1520,7 +1529,8 @@ public java.lang.String getModelFormat() {
      * exportable):
      * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
      *        mobile-high-accuracy-1:
-     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+     *      "docker".
      * *  For Image Classification mobile-core-ml-low-latency-1,
      *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
      *      "core_ml" (default).
@@ -1529,6 +1539,8 @@ public java.lang.String getModelFormat() {
      * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
      *                    devices.
      * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.
      * * docker - Used for Docker containers. Use the params field to customize
      *            the container. The container is verified to work correctly on
      *            ubuntu 16.04 operating system. See more at
@@ -1561,7 +1573,8 @@ public com.google.protobuf.ByteString getModelFormatBytes() {
      * exportable):
      * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
      *        mobile-high-accuracy-1:
-     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+     *      "docker".
      * *  For Image Classification mobile-core-ml-low-latency-1,
      *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
      *      "core_ml" (default).
@@ -1570,6 +1583,8 @@ public com.google.protobuf.ByteString getModelFormatBytes() {
      * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
      *                    devices.
      * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.
      * * docker - Used for Docker containers. Use the params field to customize
      *            the container. The container is verified to work correctly on
      *            ubuntu 16.04 operating system. See more at
@@ -1600,7 +1615,8 @@ public Builder setModelFormat(java.lang.String value) {
      * exportable):
      * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
      *        mobile-high-accuracy-1:
-     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+     *      "docker".
      * *  For Image Classification mobile-core-ml-low-latency-1,
      *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
      *      "core_ml" (default).
@@ -1609,6 +1625,8 @@ public Builder setModelFormat(java.lang.String value) {
      * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
      *                    devices.
      * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.
      * * docker - Used for Docker containers. Use the params field to customize
      *            the container. The container is verified to work correctly on
      *            ubuntu 16.04 operating system. See more at
@@ -1636,7 +1654,8 @@ public Builder clearModelFormat() {
      * exportable):
      * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
      *        mobile-high-accuracy-1:
-     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+     *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+     *      "docker".
      * *  For Image Classification mobile-core-ml-low-latency-1,
      *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
      *      "core_ml" (default).
@@ -1645,6 +1664,8 @@ public Builder clearModelFormat() {
      * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
      *                    devices.
      * * tf_saved_model - A tensorflow model in SavedModel format.
+     * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+     *           be used in the browser and in Node.js using JavaScript.
      * * docker - Used for Docker containers. Use the params field to customize
      *            the container. The container is verified to work correctly on
      *            ubuntu 16.04 operating system. See more at
diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfigOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfigOrBuilder.java
index 6ebabd7aa..82c74eff3 100644
--- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfigOrBuilder.java
+++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/ModelExportOutputConfigOrBuilder.java
@@ -29,7 +29,7 @@ public interface ModelExportOutputConfigOrBuilder
    * 
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -46,7 +46,7 @@ public interface ModelExportOutputConfigOrBuilder
    * 
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -63,7 +63,7 @@ public interface ModelExportOutputConfigOrBuilder
    * 
    * The Google Cloud Storage location where the model is to be written to.
    * This location may only be set for the following model formats:
-   *   "tflite", "edgetpu_tflite", "core_ml", "docker".
+   *   "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml".
    *  Under the directory given as the destination a new one with name
    *  "model-export-<model-display-name>-<timestamp-of-export-call>",
    *  where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
@@ -125,7 +125,8 @@ public interface ModelExportOutputConfigOrBuilder
    * exportable):
    * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
    *        mobile-high-accuracy-1:
-   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+   *      "docker".
    * *  For Image Classification mobile-core-ml-low-latency-1,
    *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
    *      "core_ml" (default).
@@ -134,6 +135,8 @@ public interface ModelExportOutputConfigOrBuilder
    * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
    *                    devices.
    * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.
    * * docker - Used for Docker containers. Use the params field to customize
    *            the container. The container is verified to work correctly on
    *            ubuntu 16.04 operating system. See more at
@@ -156,7 +159,8 @@ public interface ModelExportOutputConfigOrBuilder
    * exportable):
    * *  For Image Classification mobile-low-latency-1, mobile-versatile-1,
    *        mobile-high-accuracy-1:
-   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
+   *      "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js",
+   *      "docker".
    * *  For Image Classification mobile-core-ml-low-latency-1,
    *        mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
    *      "core_ml" (default).
@@ -165,6 +169,8 @@ public interface ModelExportOutputConfigOrBuilder
    * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
    *                    devices.
    * * tf_saved_model - A tensorflow model in SavedModel format.
+   * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can
+   *           be used in the browser and in Node.js using JavaScript.
    * * docker - Used for Docker containers. Use the params field to customize
    *            the container. The container is verified to work correctly on
    *            ubuntu 16.04 operating system. See more at
diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java
index 00d7a6458..1ef0451ce 100644
--- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java
+++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Operations.java
@@ -93,13 +93,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
   static {
     java.lang.String[] descriptorData = {
       "\n,google/cloud/automl/v1beta1/operations"
-          + ".proto\022\033google.cloud.automl.v1beta1\032$goo"
-          + "gle/cloud/automl/v1beta1/io.proto\032\'googl"
-          + "e/cloud/automl/v1beta1/model.proto\0322goog"
-          + "le/cloud/automl/v1beta1/model_evaluation"
-          + ".proto\032\033google/protobuf/empty.proto\032\037goo"
-          + "gle/protobuf/timestamp.proto\032\027google/rpc"
-          + "/status.proto\032\034google/api/annotations.pr"
+          + ".proto\022\033google.cloud.automl.v1beta1\032\034goo"
+          + "gle/api/annotations.proto\032$google/cloud/"
+          + "automl/v1beta1/io.proto\032\'google/cloud/au"
+          + "toml/v1beta1/model.proto\0322google/cloud/a"
+          + "utoml/v1beta1/model_evaluation.proto\032\033go"
+          + "ogle/protobuf/empty.proto\032\037google/protob"
+          + "uf/timestamp.proto\032\027google/rpc/status.pr"
           + "oto\"\213\010\n\021OperationMetadata\022N\n\016delete_deta"
           + "ils\030\010 \001(\01324.google.cloud.automl.v1beta1."
           + "DeleteOperationMetadataH\000\022Y\n\024deploy_mode"
@@ -172,13 +172,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
         descriptorData,
         new com.google.protobuf.Descriptors.FileDescriptor[] {
+          com.google.api.AnnotationsProto.getDescriptor(),
           com.google.cloud.automl.v1beta1.Io.getDescriptor(),
           com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor(),
           com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor(),
           com.google.protobuf.EmptyProto.getDescriptor(),
           com.google.protobuf.TimestampProto.getDescriptor(),
           com.google.rpc.StatusProto.getDescriptor(),
-          com.google.api.AnnotationsProto.getDescriptor(),
         },
         assigner);
     internal_static_google_cloud_automl_v1beta1_OperationMetadata_descriptor =
@@ -304,13 +304,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
             new java.lang.String[] {
               "BigqueryOutputDataset",
             });
+    com.google.api.AnnotationsProto.getDescriptor();
     com.google.cloud.automl.v1beta1.Io.getDescriptor();
     com.google.cloud.automl.v1beta1.ModelOuterClass.getDescriptor();
     com.google.cloud.automl.v1beta1.ModelEvaluationOuterClass.getDescriptor();
     com.google.protobuf.EmptyProto.getDescriptor();
     com.google.protobuf.TimestampProto.getDescriptor();
     com.google.rpc.StatusProto.getDescriptor();
-    com.google.api.AnnotationsProto.getDescriptor();
   }
 
   // @@protoc_insertion_point(outer_class_scope)
diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Tables.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Tables.java
index 7abaa0f90..44d400048 100644
--- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Tables.java
+++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Tables.java
@@ -57,16 +57,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
   static {
     java.lang.String[] descriptorData = {
       "\n(google/cloud/automl/v1beta1/tables.pro"
-          + "to\022\033google.cloud.automl.v1beta1\0320google/"
-          + "cloud/automl/v1beta1/classification.prot"
-          + "o\032-google/cloud/automl/v1beta1/column_sp"
-          + "ec.proto\032,google/cloud/automl/v1beta1/da"
-          + "ta_items.proto\032,google/cloud/automl/v1be"
-          + "ta1/data_stats.proto\032(google/cloud/autom"
-          + "l/v1beta1/ranges.proto\032*google/cloud/aut"
-          + "oml/v1beta1/temporal.proto\032\034google/proto"
-          + "buf/struct.proto\032\037google/protobuf/timest"
-          + "amp.proto\032\034google/api/annotations.proto\""
+          + "to\022\033google.cloud.automl.v1beta1\032\034google/"
+          + "api/annotations.proto\0320google/cloud/auto"
+          + "ml/v1beta1/classification.proto\032-google/"
+          + "cloud/automl/v1beta1/column_spec.proto\032,"
+          + "google/cloud/automl/v1beta1/data_items.p"
+          + "roto\032,google/cloud/automl/v1beta1/data_s"
+          + "tats.proto\032(google/cloud/automl/v1beta1/"
+          + "ranges.proto\032*google/cloud/automl/v1beta"
+          + "1/temporal.proto\032\034google/protobuf/struct"
+          + ".proto\032\037google/protobuf/timestamp.proto\""
           + "\260\003\n\025TablesDatasetMetadata\022\035\n\025primary_tab"
           + "le_spec_id\030\001 \001(\t\022\035\n\025target_column_spec_i"
           + "d\030\002 \001(\t\022\035\n\025weight_column_spec_id\030\003 \001(\t\022\035"
@@ -77,30 +77,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "ate_time\030\007 \001(\0132\032.google.protobuf.Timesta"
           + "mp\032n\n\035TargetColumnCorrelationsEntry\022\013\n\003k"
           + "ey\030\001 \001(\t\022<\n\005value\030\002 \001(\0132-.google.cloud.a"
-          + "utoml.v1beta1.CorrelationStats:\0028\001\"\211\003\n\023T"
-          + "ablesModelMetadata\022C\n\022target_column_spec"
-          + "\030\002 \001(\0132\'.google.cloud.automl.v1beta1.Col"
-          + "umnSpec\022K\n\032input_feature_column_specs\030\003 "
-          + "\003(\0132\'.google.cloud.automl.v1beta1.Column"
-          + "Spec\022\036\n\026optimization_objective\030\004 \001(\t\022T\n\030"
-          + "tables_model_column_info\030\005 \003(\01322.google."
-          + "cloud.automl.v1beta1.TablesModelColumnIn"
-          + "fo\022%\n\035train_budget_milli_node_hours\030\006 \001("
-          + "\003\022#\n\033train_cost_milli_node_hours\030\007 \001(\003\022\036"
-          + "\n\026disable_early_stopping\030\014 \001(\010\"\345\001\n\020Table"
-          + "sAnnotation\022\r\n\005score\030\001 \001(\002\022E\n\023prediction"
-          + "_interval\030\004 \001(\0132(.google.cloud.automl.v1"
-          + "beta1.DoubleRange\022%\n\005value\030\002 \001(\0132\026.googl"
-          + "e.protobuf.Value\022T\n\030tables_model_column_"
-          + "info\030\003 \003(\01322.google.cloud.automl.v1beta1"
-          + ".TablesModelColumnInfo\"j\n\025TablesModelCol"
-          + "umnInfo\022\030\n\020column_spec_name\030\001 \001(\t\022\033\n\023col"
-          + "umn_display_name\030\002 \001(\t\022\032\n\022feature_import"
-          + "ance\030\003 \001(\002B\245\001\n\037com.google.cloud.automl.v"
-          + "1beta1P\001ZAgoogle.golang.org/genproto/goo"
-          + "gleapis/cloud/automl/v1beta1;automl\312\002\033Go"
-          + "ogle\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Clou"
-          + "d::AutoML::V1beta1b\006proto3"
+          + "utoml.v1beta1.CorrelationStats:\0028\001\"\226\004\n\023T"
+          + "ablesModelMetadata\022-\n#optimization_objec"
+          + "tive_recall_value\030\021 \001(\002H\000\0220\n&optimizatio"
+          + "n_objective_precision_value\030\022 \001(\002H\000\022C\n\022t"
+          + "arget_column_spec\030\002 \001(\0132\'.google.cloud.a"
+          + "utoml.v1beta1.ColumnSpec\022K\n\032input_featur"
+          + "e_column_specs\030\003 \003(\0132\'.google.cloud.auto"
+          + "ml.v1beta1.ColumnSpec\022\036\n\026optimization_ob"
+          + "jective\030\004 \001(\t\022T\n\030tables_model_column_inf"
+          + "o\030\005 \003(\01322.google.cloud.automl.v1beta1.Ta"
+          + "blesModelColumnInfo\022%\n\035train_budget_mill"
+          + "i_node_hours\030\006 \001(\003\022#\n\033train_cost_milli_n"
+          + "ode_hours\030\007 \001(\003\022\036\n\026disable_early_stoppin"
+          + "g\030\014 \001(\010B*\n(additional_optimization_objec"
+          + "tive_config\"\345\001\n\020TablesAnnotation\022\r\n\005scor"
+          + "e\030\001 \001(\002\022E\n\023prediction_interval\030\004 \001(\0132(.g"
+          + "oogle.cloud.automl.v1beta1.DoubleRange\022%"
+          + "\n\005value\030\002 \001(\0132\026.google.protobuf.Value\022T\n"
+          + "\030tables_model_column_info\030\003 \003(\01322.google"
+          + ".cloud.automl.v1beta1.TablesModelColumnI"
+          + "nfo\"j\n\025TablesModelColumnInfo\022\030\n\020column_s"
+          + "pec_name\030\001 \001(\t\022\033\n\023column_display_name\030\002 "
+          + "\001(\t\022\032\n\022feature_importance\030\003 \001(\002B\245\001\n\037com."
+          + "google.cloud.automl.v1beta1P\001ZAgoogle.go"
+          + "lang.org/genproto/googleapis/cloud/autom"
+          + "l/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V"
+          + "1beta1\352\002\036Google::Cloud::AutoML::V1beta1b"
+          + "\006proto3"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -113,6 +117,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
         descriptorData,
         new com.google.protobuf.Descriptors.FileDescriptor[] {
+          com.google.api.AnnotationsProto.getDescriptor(),
           com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(),
           com.google.cloud.automl.v1beta1.ColumnSpecOuterClass.getDescriptor(),
           com.google.cloud.automl.v1beta1.DataItems.getDescriptor(),
@@ -121,7 +126,6 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
           com.google.cloud.automl.v1beta1.Temporal.getDescriptor(),
           com.google.protobuf.StructProto.getDescriptor(),
           com.google.protobuf.TimestampProto.getDescriptor(),
-          com.google.api.AnnotationsProto.getDescriptor(),
         },
         assigner);
     internal_static_google_cloud_automl_v1beta1_TablesDatasetMetadata_descriptor =
@@ -153,6 +157,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_cloud_automl_v1beta1_TablesModelMetadata_descriptor,
             new java.lang.String[] {
+              "OptimizationObjectiveRecallValue",
+              "OptimizationObjectivePrecisionValue",
               "TargetColumnSpec",
               "InputFeatureColumnSpecs",
               "OptimizationObjective",
@@ -160,6 +166,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
               "TrainBudgetMilliNodeHours",
               "TrainCostMilliNodeHours",
               "DisableEarlyStopping",
+              "AdditionalOptimizationObjectiveConfig",
             });
     internal_static_google_cloud_automl_v1beta1_TablesAnnotation_descriptor =
         getDescriptor().getMessageTypes().get(2);
@@ -177,6 +184,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
             new java.lang.String[] {
               "ColumnSpecName", "ColumnDisplayName", "FeatureImportance",
             });
+    com.google.api.AnnotationsProto.getDescriptor();
     com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor();
     com.google.cloud.automl.v1beta1.ColumnSpecOuterClass.getDescriptor();
     com.google.cloud.automl.v1beta1.DataItems.getDescriptor();
@@ -185,7 +193,6 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     com.google.cloud.automl.v1beta1.Temporal.getDescriptor();
     com.google.protobuf.StructProto.getDescriptor();
     com.google.protobuf.TimestampProto.getDescriptor();
-    com.google.api.AnnotationsProto.getDescriptor();
   }
 
   // @@protoc_insertion_point(outer_class_scope)
diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadata.java
index fbcc7334e..8ccf0cfb1 100644
--- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadata.java
+++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadata.java
@@ -85,10 +85,10 @@ private TablesModelMetadata(
             }
           case 26:
             {
-              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
+              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
                 inputFeatureColumnSpecs_ =
                     new java.util.ArrayList();
-                mutable_bitField0_ |= 0x00000002;
+                mutable_bitField0_ |= 0x00000008;
               }
               inputFeatureColumnSpecs_.add(
                   input.readMessage(
@@ -104,11 +104,11 @@ private TablesModelMetadata(
             }
           case 42:
             {
-              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
+              if (!((mutable_bitField0_ & 0x00000020) != 0)) {
                 tablesModelColumnInfo_ =
                     new java.util.ArrayList<
                         com.google.cloud.automl.v1beta1.TablesModelColumnInfo>();
-                mutable_bitField0_ |= 0x00000008;
+                mutable_bitField0_ |= 0x00000020;
               }
               tablesModelColumnInfo_.add(
                   input.readMessage(
@@ -131,6 +131,18 @@ private TablesModelMetadata(
               disableEarlyStopping_ = input.readBool();
               break;
             }
+          case 141:
+            {
+              additionalOptimizationObjectiveConfigCase_ = 17;
+              additionalOptimizationObjectiveConfig_ = input.readFloat();
+              break;
+            }
+          case 149:
+            {
+              additionalOptimizationObjectiveConfigCase_ = 18;
+              additionalOptimizationObjectiveConfig_ = input.readFloat();
+              break;
+            }
           default:
             {
               if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -145,10 +157,10 @@ private TablesModelMetadata(
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
-      if (((mutable_bitField0_ & 0x00000002) != 0)) {
+      if (((mutable_bitField0_ & 0x00000008) != 0)) {
         inputFeatureColumnSpecs_ = java.util.Collections.unmodifiableList(inputFeatureColumnSpecs_);
       }
-      if (((mutable_bitField0_ & 0x00000008) != 0)) {
+      if (((mutable_bitField0_ & 0x00000020) != 0)) {
         tablesModelColumnInfo_ = java.util.Collections.unmodifiableList(tablesModelColumnInfo_);
       }
       this.unknownFields = unknownFields.build();
@@ -172,6 +184,84 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
   }
 
   private int bitField0_;
+  private int additionalOptimizationObjectiveConfigCase_ = 0;
+  private java.lang.Object additionalOptimizationObjectiveConfig_;
+
+  public enum AdditionalOptimizationObjectiveConfigCase
+      implements com.google.protobuf.Internal.EnumLite {
+    OPTIMIZATION_OBJECTIVE_RECALL_VALUE(17),
+    OPTIMIZATION_OBJECTIVE_PRECISION_VALUE(18),
+    ADDITIONALOPTIMIZATIONOBJECTIVECONFIG_NOT_SET(0);
+    private final int value;
+
+    private AdditionalOptimizationObjectiveConfigCase(int value) {
+      this.value = value;
+    }
+    /** @deprecated Use {@link #forNumber(int)} instead. */
+    @java.lang.Deprecated
+    public static AdditionalOptimizationObjectiveConfigCase valueOf(int value) {
+      return forNumber(value);
+    }
+
+    public static AdditionalOptimizationObjectiveConfigCase forNumber(int value) {
+      switch (value) {
+        case 17:
+          return OPTIMIZATION_OBJECTIVE_RECALL_VALUE;
+        case 18:
+          return OPTIMIZATION_OBJECTIVE_PRECISION_VALUE;
+        case 0:
+          return ADDITIONALOPTIMIZATIONOBJECTIVECONFIG_NOT_SET;
+        default:
+          return null;
+      }
+    }
+
+    public int getNumber() {
+      return this.value;
+    }
+  };
+
+  public AdditionalOptimizationObjectiveConfigCase getAdditionalOptimizationObjectiveConfigCase() {
+    return AdditionalOptimizationObjectiveConfigCase.forNumber(
+        additionalOptimizationObjectiveConfigCase_);
+  }
+
+  public static final int OPTIMIZATION_OBJECTIVE_RECALL_VALUE_FIELD_NUMBER = 17;
+  /**
+   *
+   *
+   * 
+   * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
+   * Must be between 0 and 1, inclusive.
+   * 
+ * + * float optimization_objective_recall_value = 17; + */ + public float getOptimizationObjectiveRecallValue() { + if (additionalOptimizationObjectiveConfigCase_ == 17) { + return (java.lang.Float) additionalOptimizationObjectiveConfig_; + } + return 0F; + } + + public static final int OPTIMIZATION_OBJECTIVE_PRECISION_VALUE_FIELD_NUMBER = 18; + /** + * + * + *
+   * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
+   * Must be between 0 and 1, inclusive.
+   * 
+ * + * float optimization_objective_precision_value = 18; + */ + public float getOptimizationObjectivePrecisionValue() { + if (additionalOptimizationObjectiveConfigCase_ == 18) { + return (java.lang.Float) additionalOptimizationObjectiveConfig_; + } + return 0F; + } + public static final int TARGET_COLUMN_SPEC_FIELD_NUMBER = 2; private com.google.cloud.automl.v1beta1.ColumnSpec targetColumnSpec_; /** @@ -625,6 +715,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (disableEarlyStopping_ != false) { output.writeBool(12, disableEarlyStopping_); } + if (additionalOptimizationObjectiveConfigCase_ == 17) { + output.writeFloat(17, (float) ((java.lang.Float) additionalOptimizationObjectiveConfig_)); + } + if (additionalOptimizationObjectiveConfigCase_ == 18) { + output.writeFloat(18, (float) ((java.lang.Float) additionalOptimizationObjectiveConfig_)); + } unknownFields.writeTo(output); } @@ -659,6 +755,16 @@ public int getSerializedSize() { if (disableEarlyStopping_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, disableEarlyStopping_); } + if (additionalOptimizationObjectiveConfigCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 17, (float) ((java.lang.Float) additionalOptimizationObjectiveConfig_)); + } + if (additionalOptimizationObjectiveConfigCase_ == 18) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 18, (float) ((java.lang.Float) additionalOptimizationObjectiveConfig_)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -686,6 +792,22 @@ public boolean equals(final java.lang.Object obj) { if (getTrainBudgetMilliNodeHours() != other.getTrainBudgetMilliNodeHours()) return false; if (getTrainCostMilliNodeHours() != other.getTrainCostMilliNodeHours()) return false; if (getDisableEarlyStopping() != other.getDisableEarlyStopping()) return false; + if (!getAdditionalOptimizationObjectiveConfigCase() + .equals(other.getAdditionalOptimizationObjectiveConfigCase())) return false; + switch (additionalOptimizationObjectiveConfigCase_) { + case 17: + if (java.lang.Float.floatToIntBits(getOptimizationObjectiveRecallValue()) + != java.lang.Float.floatToIntBits(other.getOptimizationObjectiveRecallValue())) + return false; + break; + case 18: + if (java.lang.Float.floatToIntBits(getOptimizationObjectivePrecisionValue()) + != java.lang.Float.floatToIntBits(other.getOptimizationObjectivePrecisionValue())) + return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -717,6 +839,19 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrainCostMilliNodeHours()); hash = (37 * hash) + DISABLE_EARLY_STOPPING_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableEarlyStopping()); + switch (additionalOptimizationObjectiveConfigCase_) { + case 17: + hash = (37 * hash) + OPTIMIZATION_OBJECTIVE_RECALL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOptimizationObjectiveRecallValue()); + break; + case 18: + hash = (37 * hash) + OPTIMIZATION_OBJECTIVE_PRECISION_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + java.lang.Float.floatToIntBits(getOptimizationObjectivePrecisionValue()); + break; + case 0: + default: + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -873,7 +1008,7 @@ public Builder clear() { } if (inputFeatureColumnSpecsBuilder_ == null) { inputFeatureColumnSpecs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } else { inputFeatureColumnSpecsBuilder_.clear(); } @@ -881,7 +1016,7 @@ public Builder clear() { if (tablesModelColumnInfoBuilder_ == null) { tablesModelColumnInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); } else { tablesModelColumnInfoBuilder_.clear(); } @@ -891,6 +1026,8 @@ public Builder clear() { disableEarlyStopping_ = false; + additionalOptimizationObjectiveConfigCase_ = 0; + additionalOptimizationObjectiveConfig_ = null; return this; } @@ -920,16 +1057,22 @@ public com.google.cloud.automl.v1beta1.TablesModelMetadata buildPartial() { new com.google.cloud.automl.v1beta1.TablesModelMetadata(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; + if (additionalOptimizationObjectiveConfigCase_ == 17) { + result.additionalOptimizationObjectiveConfig_ = additionalOptimizationObjectiveConfig_; + } + if (additionalOptimizationObjectiveConfigCase_ == 18) { + result.additionalOptimizationObjectiveConfig_ = additionalOptimizationObjectiveConfig_; + } if (targetColumnSpecBuilder_ == null) { result.targetColumnSpec_ = targetColumnSpec_; } else { result.targetColumnSpec_ = targetColumnSpecBuilder_.build(); } if (inputFeatureColumnSpecsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { inputFeatureColumnSpecs_ = java.util.Collections.unmodifiableList(inputFeatureColumnSpecs_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } result.inputFeatureColumnSpecs_ = inputFeatureColumnSpecs_; } else { @@ -937,9 +1080,9 @@ public com.google.cloud.automl.v1beta1.TablesModelMetadata buildPartial() { } result.optimizationObjective_ = optimizationObjective_; if (tablesModelColumnInfoBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { tablesModelColumnInfo_ = java.util.Collections.unmodifiableList(tablesModelColumnInfo_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); } result.tablesModelColumnInfo_ = tablesModelColumnInfo_; } else { @@ -949,6 +1092,8 @@ public com.google.cloud.automl.v1beta1.TablesModelMetadata buildPartial() { result.trainCostMilliNodeHours_ = trainCostMilliNodeHours_; result.disableEarlyStopping_ = disableEarlyStopping_; result.bitField0_ = to_bitField0_; + result.additionalOptimizationObjectiveConfigCase_ = + additionalOptimizationObjectiveConfigCase_; onBuilt(); return result; } @@ -1006,7 +1151,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.TablesModelMetadata oth if (!other.inputFeatureColumnSpecs_.isEmpty()) { if (inputFeatureColumnSpecs_.isEmpty()) { inputFeatureColumnSpecs_ = other.inputFeatureColumnSpecs_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureInputFeatureColumnSpecsIsMutable(); inputFeatureColumnSpecs_.addAll(other.inputFeatureColumnSpecs_); @@ -1019,7 +1164,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.TablesModelMetadata oth inputFeatureColumnSpecsBuilder_.dispose(); inputFeatureColumnSpecsBuilder_ = null; inputFeatureColumnSpecs_ = other.inputFeatureColumnSpecs_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); inputFeatureColumnSpecsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getInputFeatureColumnSpecsFieldBuilder() @@ -1037,7 +1182,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.TablesModelMetadata oth if (!other.tablesModelColumnInfo_.isEmpty()) { if (tablesModelColumnInfo_.isEmpty()) { tablesModelColumnInfo_ = other.tablesModelColumnInfo_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTablesModelColumnInfoIsMutable(); tablesModelColumnInfo_.addAll(other.tablesModelColumnInfo_); @@ -1050,7 +1195,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.TablesModelMetadata oth tablesModelColumnInfoBuilder_.dispose(); tablesModelColumnInfoBuilder_ = null; tablesModelColumnInfo_ = other.tablesModelColumnInfo_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); tablesModelColumnInfoBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTablesModelColumnInfoFieldBuilder() @@ -1069,6 +1214,22 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.TablesModelMetadata oth if (other.getDisableEarlyStopping() != false) { setDisableEarlyStopping(other.getDisableEarlyStopping()); } + switch (other.getAdditionalOptimizationObjectiveConfigCase()) { + case OPTIMIZATION_OBJECTIVE_RECALL_VALUE: + { + setOptimizationObjectiveRecallValue(other.getOptimizationObjectiveRecallValue()); + break; + } + case OPTIMIZATION_OBJECTIVE_PRECISION_VALUE: + { + setOptimizationObjectivePrecisionValue(other.getOptimizationObjectivePrecisionValue()); + break; + } + case ADDITIONALOPTIMIZATIONOBJECTIVECONFIG_NOT_SET: + { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1099,8 +1260,126 @@ public Builder mergeFrom( return this; } + private int additionalOptimizationObjectiveConfigCase_ = 0; + private java.lang.Object additionalOptimizationObjectiveConfig_; + + public AdditionalOptimizationObjectiveConfigCase + getAdditionalOptimizationObjectiveConfigCase() { + return AdditionalOptimizationObjectiveConfigCase.forNumber( + additionalOptimizationObjectiveConfigCase_); + } + + public Builder clearAdditionalOptimizationObjectiveConfig() { + additionalOptimizationObjectiveConfigCase_ = 0; + additionalOptimizationObjectiveConfig_ = null; + onChanged(); + return this; + } + private int bitField0_; + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_recall_value = 17; + */ + public float getOptimizationObjectiveRecallValue() { + if (additionalOptimizationObjectiveConfigCase_ == 17) { + return (java.lang.Float) additionalOptimizationObjectiveConfig_; + } + return 0F; + } + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_recall_value = 17; + */ + public Builder setOptimizationObjectiveRecallValue(float value) { + additionalOptimizationObjectiveConfigCase_ = 17; + additionalOptimizationObjectiveConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_recall_value = 17; + */ + public Builder clearOptimizationObjectiveRecallValue() { + if (additionalOptimizationObjectiveConfigCase_ == 17) { + additionalOptimizationObjectiveConfigCase_ = 0; + additionalOptimizationObjectiveConfig_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_precision_value = 18; + */ + public float getOptimizationObjectivePrecisionValue() { + if (additionalOptimizationObjectiveConfigCase_ == 18) { + return (java.lang.Float) additionalOptimizationObjectiveConfig_; + } + return 0F; + } + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_precision_value = 18; + */ + public Builder setOptimizationObjectivePrecisionValue(float value) { + additionalOptimizationObjectiveConfigCase_ = 18; + additionalOptimizationObjectiveConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
+     * Must be between 0 and 1, inclusive.
+     * 
+ * + * float optimization_objective_precision_value = 18; + */ + public Builder clearOptimizationObjectivePrecisionValue() { + if (additionalOptimizationObjectiveConfigCase_ == 18) { + additionalOptimizationObjectiveConfigCase_ = 0; + additionalOptimizationObjectiveConfig_ = null; + onChanged(); + } + return this; + } + private com.google.cloud.automl.v1beta1.ColumnSpec targetColumnSpec_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.automl.v1beta1.ColumnSpec, @@ -1359,11 +1638,11 @@ public com.google.cloud.automl.v1beta1.ColumnSpecOrBuilder getTargetColumnSpecOr java.util.Collections.emptyList(); private void ensureInputFeatureColumnSpecsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { inputFeatureColumnSpecs_ = new java.util.ArrayList( inputFeatureColumnSpecs_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000008; } } @@ -1736,7 +2015,7 @@ public Builder addAllInputFeatureColumnSpecs( public Builder clearInputFeatureColumnSpecs() { if (inputFeatureColumnSpecsBuilder_ == null) { inputFeatureColumnSpecs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { inputFeatureColumnSpecsBuilder_.clear(); @@ -1960,7 +2239,7 @@ public com.google.cloud.automl.v1beta1.ColumnSpec.Builder addInputFeatureColumnS com.google.cloud.automl.v1beta1.ColumnSpec.Builder, com.google.cloud.automl.v1beta1.ColumnSpecOrBuilder>( inputFeatureColumnSpecs_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); inputFeatureColumnSpecs_ = null; @@ -2161,11 +2440,11 @@ public Builder setOptimizationObjectiveBytes(com.google.protobuf.ByteString valu tablesModelColumnInfo_ = java.util.Collections.emptyList(); private void ensureTablesModelColumnInfoIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { tablesModelColumnInfo_ = new java.util.ArrayList( tablesModelColumnInfo_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000020; } } @@ -2420,7 +2699,7 @@ public Builder addAllTablesModelColumnInfo( public Builder clearTablesModelColumnInfo() { if (tablesModelColumnInfoBuilder_ == null) { tablesModelColumnInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { tablesModelColumnInfoBuilder_.clear(); @@ -2569,7 +2848,7 @@ public Builder removeTablesModelColumnInfo(int index) { com.google.cloud.automl.v1beta1.TablesModelColumnInfo.Builder, com.google.cloud.automl.v1beta1.TablesModelColumnInfoOrBuilder>( tablesModelColumnInfo_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); tablesModelColumnInfo_ = null; diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadataOrBuilder.java index a3171c5ed..da14063ed 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TablesModelMetadataOrBuilder.java @@ -23,6 +23,30 @@ public interface TablesModelMetadataOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.TablesModelMetadata) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
+   * Must be between 0 and 1, inclusive.
+   * 
+ * + * float optimization_objective_recall_value = 17; + */ + float getOptimizationObjectiveRecallValue(); + + /** + * + * + *
+   * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
+   * Must be between 0 and 1, inclusive.
+   * 
+ * + * float optimization_objective_precision_value = 18; + */ + float getOptimizationObjectivePrecisionValue(); + /** * * @@ -370,4 +394,8 @@ com.google.cloud.automl.v1beta1.TablesModelColumnInfoOrBuilder getTablesModelCol * bool disable_early_stopping = 12; */ boolean getDisableEarlyStopping(); + + public com.google.cloud.automl.v1beta1.TablesModelMetadata + .AdditionalOptimizationObjectiveConfigCase + getAdditionalOptimizationObjectiveConfigCase(); } diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java index 1822a0c9c..07ec83c7a 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadata.java @@ -38,7 +38,9 @@ private TextClassificationModelMetadata( super(builder); } - private TextClassificationModelMetadata() {} + private TextClassificationModelMetadata() { + classificationType_ = 0; + } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { @@ -53,6 +55,7 @@ private TextClassificationModelMetadata( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -63,6 +66,13 @@ private TextClassificationModelMetadata( case 0: done = true; break; + case 24: + { + int rawValue = input.readEnum(); + + classificationType_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -97,6 +107,40 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.Builder.class); } + public static final int CLASSIFICATION_TYPE_FIELD_NUMBER = 3; + private int classificationType_; + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType + getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf( + classificationType_); + return result == null + ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -111,6 +155,12 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (classificationType_ + != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType + .CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, classificationType_); + } unknownFields.writeTo(output); } @@ -120,6 +170,12 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (classificationType_ + != com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType + .CLASSIFICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, classificationType_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -136,6 +192,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.automl.v1beta1.TextClassificationModelMetadata other = (com.google.cloud.automl.v1beta1.TextClassificationModelMetadata) obj; + if (classificationType_ != other.classificationType_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -147,6 +204,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLASSIFICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + classificationType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -293,6 +352,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + classificationType_ = 0; + return this; } @@ -321,6 +382,7 @@ public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata build() { public com.google.cloud.automl.v1beta1.TextClassificationModelMetadata buildPartial() { com.google.cloud.automl.v1beta1.TextClassificationModelMetadata result = new com.google.cloud.automl.v1beta1.TextClassificationModelMetadata(this); + result.classificationType_ = classificationType_; onBuilt(); return result; } @@ -373,6 +435,9 @@ public Builder mergeFrom( if (other == com.google.cloud.automl.v1beta1.TextClassificationModelMetadata.getDefaultInstance()) return this; + if (other.classificationType_ != 0) { + setClassificationTypeValue(other.getClassificationTypeValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -404,6 +469,87 @@ public Builder mergeFrom( return this; } + private int classificationType_ = 0; + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public int getClassificationTypeValue() { + return classificationType_; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public Builder setClassificationTypeValue(int value) { + classificationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType + getClassificationType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType result = + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.valueOf( + classificationType_); + return result == null + ? com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public Builder setClassificationType( + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType value) { + if (value == null) { + throw new NullPointerException(); + } + + classificationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Classification type of the dataset used to train this model.
+     * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + public Builder clearClassificationType() { + + classificationType_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java index 9d610c779..6014e8928 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextClassificationModelMetadataOrBuilder.java @@ -21,4 +21,26 @@ public interface TextClassificationModelMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.TextClassificationModelMetadata) - com.google.protobuf.MessageOrBuilder {} + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + int getClassificationTypeValue(); + /** + * + * + *
+   * Output only. Classification type of the dataset used to train this model.
+   * 
+ * + * .google.cloud.automl.v1beta1.ClassificationType classification_type = 3; + */ + com.google.cloud.automl.v1beta1.ClassificationProto.ClassificationType getClassificationType(); +} diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java index 46e0e30a0..8932cbad4 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextProto.java @@ -61,21 +61,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n&google/cloud/automl/v1beta1/text.proto" - + "\022\033google.cloud.automl.v1beta1\0320google/cl" - + "oud/automl/v1beta1/classification.proto\032" - + "\034google/api/annotations.proto\"q\n!TextCla" + + "\022\033google.cloud.automl.v1beta1\032\034google/ap" + + "i/annotations.proto\0320google/cloud/automl" + + "/v1beta1/classification.proto\"q\n!TextCla" + "ssificationDatasetMetadata\022L\n\023classifica" + "tion_type\030\001 \001(\0162/.google.cloud.automl.v1" - + "beta1.ClassificationType\"!\n\037TextClassifi" - + "cationModelMetadata\"\037\n\035TextExtractionDat" - + "asetMetadata\"\035\n\033TextExtractionModelMetad" - + "ata\"5\n\034TextSentimentDatasetMetadata\022\025\n\rs" - + "entiment_max\030\001 \001(\005\"\034\n\032TextSentimentModel" - + "MetadataB\260\001\n\037com.google.cloud.automl.v1b" - + "eta1B\tTextProtoP\001ZAgoogle.golang.org/gen" - + "proto/googleapis/cloud/automl/v1beta1;au" - + "toml\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Goo" - + "gle::Cloud::AutoML::V1beta1b\006proto3" + + "beta1.ClassificationType\"o\n\037TextClassifi" + + "cationModelMetadata\022L\n\023classification_ty" + + "pe\030\003 \001(\0162/.google.cloud.automl.v1beta1.C" + + "lassificationType\"\037\n\035TextExtractionDatas" + + "etMetadata\"\035\n\033TextExtractionModelMetadat" + + "a\"5\n\034TextSentimentDatasetMetadata\022\025\n\rsen" + + "timent_max\030\001 \001(\005\"\034\n\032TextSentimentModelMe" + + "tadataB\260\001\n\037com.google.cloud.automl.v1bet" + + "a1B\tTextProtoP\001ZAgoogle.golang.org/genpr" + + "oto/googleapis/cloud/automl/v1beta1;auto" + + "ml\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Googl" + + "e::Cloud::AutoML::V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -88,8 +90,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(), }, assigner); internal_static_google_cloud_automl_v1beta1_TextClassificationDatasetMetadata_descriptor = @@ -105,7 +107,9 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_TextClassificationModelMetadata_descriptor, - new java.lang.String[] {}); + new java.lang.String[] { + "ClassificationType", + }); internal_static_google_cloud_automl_v1beta1_TextExtractionDatasetMetadata_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_google_cloud_automl_v1beta1_TextExtractionDatasetMetadata_fieldAccessorTable = @@ -132,8 +136,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_TextSentimentModelMetadata_descriptor, new java.lang.String[] {}); - com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.ClassificationProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadata.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadata.java index b53f40559..b2539d633 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadata.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadata.java @@ -108,12 +108,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. A sentiment is expressed as an integer ordinal, where higher value
-   * means a more positive sentiment. The range of sentiments that will be used
-   * is between 0 and sentiment_max (inclusive on both ends), and all the values
-   * in the range must be represented in the dataset before a model can be
-   * created.
-   * sentiment_max value must be between 1 and 10 (inclusive).
+   * Required. A sentiment is expressed as an integer ordinal, where higher
+   * value means a more positive sentiment. The range of sentiments that will be
+   * used is between 0 and sentiment_max (inclusive on both ends), and all the
+   * values in the range must be represented in the dataset before a model can
+   * be created. sentiment_max value must be between 1 and 10 (inclusive).
    * 
* * int32 sentiment_max = 1; @@ -447,12 +446,11 @@ public Builder mergeFrom( * * *
-     * Required. A sentiment is expressed as an integer ordinal, where higher value
-     * means a more positive sentiment. The range of sentiments that will be used
-     * is between 0 and sentiment_max (inclusive on both ends), and all the values
-     * in the range must be represented in the dataset before a model can be
-     * created.
-     * sentiment_max value must be between 1 and 10 (inclusive).
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
      * 
* * int32 sentiment_max = 1; @@ -464,12 +462,11 @@ public int getSentimentMax() { * * *
-     * Required. A sentiment is expressed as an integer ordinal, where higher value
-     * means a more positive sentiment. The range of sentiments that will be used
-     * is between 0 and sentiment_max (inclusive on both ends), and all the values
-     * in the range must be represented in the dataset before a model can be
-     * created.
-     * sentiment_max value must be between 1 and 10 (inclusive).
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
      * 
* * int32 sentiment_max = 1; @@ -484,12 +481,11 @@ public Builder setSentimentMax(int value) { * * *
-     * Required. A sentiment is expressed as an integer ordinal, where higher value
-     * means a more positive sentiment. The range of sentiments that will be used
-     * is between 0 and sentiment_max (inclusive on both ends), and all the values
-     * in the range must be represented in the dataset before a model can be
-     * created.
-     * sentiment_max value must be between 1 and 10 (inclusive).
+     * Required. A sentiment is expressed as an integer ordinal, where higher
+     * value means a more positive sentiment. The range of sentiments that will be
+     * used is between 0 and sentiment_max (inclusive on both ends), and all the
+     * values in the range must be represented in the dataset before a model can
+     * be created. sentiment_max value must be between 1 and 10 (inclusive).
      * 
* * int32 sentiment_max = 1; diff --git a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadataOrBuilder.java b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadataOrBuilder.java index 0ecedf54b..70c3fd34c 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadataOrBuilder.java +++ b/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSentimentDatasetMetadataOrBuilder.java @@ -27,12 +27,11 @@ public interface TextSentimentDatasetMetadataOrBuilder * * *
-   * Required. A sentiment is expressed as an integer ordinal, where higher value
-   * means a more positive sentiment. The range of sentiments that will be used
-   * is between 0 and sentiment_max (inclusive on both ends), and all the values
-   * in the range must be represented in the dataset before a model can be
-   * created.
-   * sentiment_max value must be between 1 and 10 (inclusive).
+   * Required. A sentiment is expressed as an integer ordinal, where higher
+   * value means a more positive sentiment. The range of sentiments that will be
+   * used is between 0 and sentiment_max (inclusive on both ends), and all the
+   * values in the range must be represented in the dataset before a model can
+   * be created. sentiment_max value must be between 1 and 10 (inclusive).
    * 
* * int32 sentiment_max = 1; diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto index 7e54238e0..c8475542a 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/classification.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; -import "google/cloud/automl/v1beta1/temporal.proto"; import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_outer_classname = "ClassificationProto"; @@ -126,7 +126,10 @@ message ClassificationEvaluationMetrics { // for each example. float false_positive_rate_at1 = 9; - // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + // Output only. The harmonic mean of + // [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] + // and + // [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. float f1_score_at1 = 7; // Output only. The number of model created labels that match a ground truth @@ -153,7 +156,9 @@ message ClassificationEvaluationMetrics { // Output only. Value of the specific cell in the confusion matrix. // The number of values each row has (i.e. the length of the row) is equal // to the length of the `annotation_spec_id` field or, if that one is not - // populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + // populated, length of the + // [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + // field. repeated int32 example_count = 1; } @@ -175,9 +180,9 @@ message ClassificationEvaluationMetrics { // Output only. Rows in the confusion matrix. The number of rows is equal to // the size of `annotation_spec_id`. - // `row[i].value[j]` is the number of examples that have ground truth of the - // `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by - // the model being evaluated. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. repeated Row row = 2; } diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto index fdbea7042..424a0c64f 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto @@ -35,9 +35,11 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // Only images up to 30MB in size are supported. message Image { // Input only. The data representing the image. - // For Predict calls [image_bytes][] must be set, as other options are not - // currently supported by prediction API. You can read the contents of an - // uploaded image by using the [content_uri][] field. + // For Predict calls + // [image_bytes][google.cloud.automl.v1beta1.Image.image_bytes] must be set, + // as other options are not currently supported by prediction API. You can + // read the contents of an uploaded image by using the + // [content_uri][google.cloud.automl.v1beta1.Image.content_uri] field. oneof data { // Image content represented as a stream of bytes. // Note: As with all `bytes` fields, protobuffers use a pure binary diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto index 61e48d12e..5995efc6e 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/image.proto @@ -98,6 +98,15 @@ message ImageClassificationModelMetadata { // to have a higher latency, but should also have a higher // prediction quality than other models. string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; } // Model metadata specific to image object detection. @@ -132,7 +141,7 @@ message ImageObjectDetectionModelMetadata { // full budget and the stop_reason will be `MODEL_CONVERGED`. // Note, node_hour = actual_hour * number_of_nodes_invovled. // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - // the train budget must be between 20,000 and 2,000,000 milli node hours, + // the train budget must be between 20,000 and 900,000 milli node hours, // inclusive. The default value is 216, 000 which represents one day in // wall time. // For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -153,7 +162,8 @@ message ImageClassificationModelDeploymentMetadata { // Input only. The number of nodes to deploy the model on. A node is an // abstraction of a machine resource, which can handle online prediction QPS // as given in the model's - // [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + // + // [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. // Must be between 1 and 100, inclusive on both ends. int64 node_count = 1; } diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto index 6f007f02a..5cc61c5ea 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto @@ -986,7 +986,7 @@ message ModelExportOutputConfig { oneof destination { // The Google Cloud Storage location where the model is to be written to. // This location may only be set for the following model formats: - // "tflite", "edgetpu_tflite", "core_ml", "docker". + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". // // Under the directory given as the destination a new one with name // "model-export--", @@ -1010,7 +1010,8 @@ message ModelExportOutputConfig { // // * For Image Classification mobile-low-latency-1, mobile-versatile-1, // mobile-high-accuracy-1: - // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker". + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". // // * For Image Classification mobile-core-ml-low-latency-1, // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: @@ -1021,6 +1022,8 @@ message ModelExportOutputConfig { // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) // devices. // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. // * docker - Used for Docker containers. Use the params field to customize // the container. The container is verified to work correctly on // ubuntu 16.04 operating system. See more at diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto index aba18cd67..c835aba3d 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/operations.proto @@ -17,13 +17,13 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; +import "google/api/annotations.proto"; import "google/cloud/automl/v1beta1/io.proto"; import "google/cloud/automl/v1beta1/model.proto"; import "google/cloud/automl/v1beta1/model_evaluation.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -61,7 +61,8 @@ message OperationMetadata { ExportModelOperationMetadata export_model_details = 22; // Details of ExportEvaluatedExamples operation. - ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = 26; + ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = + 26; } // Output only. Progress of operation. Range: [0, 100]. @@ -82,29 +83,19 @@ message OperationMetadata { } // Details of operations that perform deletes of any entities. -message DeleteOperationMetadata { - -} +message DeleteOperationMetadata {} // Details of DeployModel operation. -message DeployModelOperationMetadata { - -} +message DeployModelOperationMetadata {} // Details of UndeployModel operation. -message UndeployModelOperationMetadata { - -} +message UndeployModelOperationMetadata {} // Details of CreateModel operation. -message CreateModelOperationMetadata { - -} +message CreateModelOperationMetadata {} // Details of ImportData operation. -message ImportDataOperationMetadata { - -} +message ImportDataOperationMetadata {} // Details of ExportData operation. message ExportDataOperationMetadata { diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/tables.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/tables.proto index c8b7809b6..467a330c8 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/tables.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/tables.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; +import "google/api/annotations.proto"; import "google/cloud/automl/v1beta1/classification.proto"; import "google/cloud/automl/v1beta1/column_spec.proto"; import "google/cloud/automl/v1beta1/data_items.proto"; @@ -25,7 +26,6 @@ import "google/cloud/automl/v1beta1/ranges.proto"; import "google/cloud/automl/v1beta1/temporal.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -103,6 +103,19 @@ message TablesDatasetMetadata { // Model metadata specific to AutoML Tables. message TablesModelMetadata { + // Additional optimization objective configuration. Required for + // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 17; + + // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 18; + } + // Column spec of the dataset's primary table's column the model is // predicting. Snapshotted when model creation started. // Only 3 fields are used: diff --git a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto index 6a01b7cff..ca722e07c 100644 --- a/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto +++ b/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/text.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; -import "google/cloud/automl/v1beta1/classification.proto"; import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -35,31 +35,25 @@ message TextClassificationDatasetMetadata { // Model metadata that is specific to text classification. message TextClassificationModelMetadata { - + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; } // Dataset metadata that is specific to text extraction -message TextExtractionDatasetMetadata { - -} +message TextExtractionDatasetMetadata {} // Model metadata that is specific to text extraction. -message TextExtractionModelMetadata { - -} +message TextExtractionModelMetadata {} // Dataset metadata for text sentiment. message TextSentimentDatasetMetadata { - // Required. A sentiment is expressed as an integer ordinal, where higher value - // means a more positive sentiment. The range of sentiments that will be used - // is between 0 and sentiment_max (inclusive on both ends), and all the values - // in the range must be represented in the dataset before a model can be - // created. - // sentiment_max value must be between 1 and 10 (inclusive). + // Required. A sentiment is expressed as an integer ordinal, where higher + // value means a more positive sentiment. The range of sentiments that will be + // used is between 0 and sentiment_max (inclusive on both ends), and all the + // values in the range must be represented in the dataset before a model can + // be created. sentiment_max value must be between 1 and 10 (inclusive). int32 sentiment_max = 1; } // Model metadata that is specific to text sentiment. -message TextSentimentModelMetadata { - -} +message TextSentimentModelMetadata {} diff --git a/synth.metadata b/synth.metadata index 1e3a317a1..f71893382 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-10-19T07:51:37.211347Z", + "updateTime": "2019-11-11T21:09:10.144278Z", "sources": [ { "generator": { "name": "artman", - "version": "0.40.1", - "dockerImage": "googleapis/artman@sha256:168646efbffe41e8f8fa86a60fa0d5724fab67fa37f35082cf6cfc85cedce3c7" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e9a6d15fcb944ed40921ba0aad2082ee1bc7edd", - "internalRef": "275543900" + "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", + "internalRef": "279774957" } }, {